0

I am trying to get this ffmpeg command right, and think I am close but not quite there. I have a source that has 4 stereo pairs in it (RTSP), so the source looks like this in ffmpeg:

Input #0, sdp, from '/tmp/sdp':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1280x720, 30 fps, 30 tbr, 90k tbn, 60 tbc
    Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp
    Stream #0:2: Audio: aac (LC), 48000 Hz, stereo, fltp
    Stream #0:3: Audio: aac (LC), 48000 Hz, stereo, fltp
    Stream #0:4: Audio: aac (LC), 48000 Hz, stereo, fltp

And what I want to do is output a single RTMP stream with 7.1 audio. This is what I have so far (just a command fragment to leave off the output url):

ffmpeg -protocol_whitelist file,udp,rtp -threads 4 -loglevel info -i /tmp/sdp -filter_complex '[0:1][0:2][0:3][0:4]join=inputs=8:channel_layout=7.1[a]' -map 0:0 -map '[a]:1' -c:v copy  -c:a aac -b:a 384k -ac 8 -ar 44100 -f flv

In the output it throws: Cannot find a matching stream for unlabeled input pad 4 on filter Parsed_join_0

What am I missing?

0

The inputs option in ffmpeg filters refers to number of streams, not channels.

ffmpeg -protocol_whitelist file,udp,rtp -threads 4 -loglevel info -i /tmp/sdp -filter_complex '[0:1][0:2][0:3][0:4]join=inputs=4:channel_layout=7.1[a]' -map 0:0 -map '[a]' -c:v copy -c:a aac -b:a 384k -ac 8 -ar 44100 -f flv URL

|improve this answer|||||
  • That was it! Thanks so much! – Dan Pisarski Jun 12 '19 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.