Answers.Body: <p>The inputs option in ffmpeg filters refers to number of streams, not channels.</p>
  
  <p><code>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</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-12T22:36:08.613Z
Answers.Text: That was it! Thanks so much!
Answers.UserDisplayName: Dan Pisarski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-12T04:30:07.570Z
Answers.LastActivityDate: 2019-06-12T04:30:07.570Z
Answers.UserDisplayName: Gyan
Body: <p>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:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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):</p>
  
  <pre><code>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
  </code></pre>
  
  <p>In the output it throws:
  <code>Cannot find a matching stream for unlabeled input pad 4 on filter Parsed_join_0</code></p>
  
  <p>What am I missing?</p>
  
Tags: <ffmpeg><audio>
Title: ffmpeg: map 4 stereo pairs into 7.1 audio in FLV/RTMP
UserDisplayName: Dan Pisarski
ThreadText: # ffmpeg: map 4 stereo pairs into 7.1 audio in FLV/RTMP
  
  (Asked by: username_0 on 2019-06-11)
  
  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?
  
  **Tags:** ffmpeg, audio
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-06-12. Score: 0 | Accepted answer
  
  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`
  
  > **Comments:**
  > **username_0**: That was it! Thanks so much!  
  
  ---
  
  