Answers.Body: <p>Use</p>
  
  <p><code>ffmpeg -loglevel verbose -i test.mov -map 0:1 -map 0:2
  -codec:a:0 aac -b:a:0 160k  -codec:a:1 eac3 -ac:a:1 6 -ar:a:1 48000 -b:a:1 640k -dialnorm -24 -dsur_mode 0 -original 1 -dmix_mode 2 -channel_layout 63 -y test.ts</code></p>
  
  <p><code>acodec</code> is an alias for <code>codec:a</code> and it does not accept stream specifiers. Same goes for other codec-related options like bitrate.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-03T17:22:52.920Z
Answers.Text: Seems that ure answer partly helped the situation, as now both AAC and eAC3 are present in the mux.. But the AAC track is 5.1, but the source track is stereo. The eAC3 track is 5.1 as the source..
Answers.UserDisplayName: TEB
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-03T17:32:00.493Z
Answers.Text: It's the channel_layout. That will force all output tracks to that layout. Remove it.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-03T18:02:04.340Z
Answers.Text: That did the trick.. I got a rogue mpeg2 video track in addition.. but i muxed it out! Thx!
Answers.UserDisplayName: TEB
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-03T15:02:45.250Z
Answers.LastActivityDate: 2019-07-03T15:02:45.250Z
Answers.UserDisplayName: Gyan
Body: <p>Im trying to mux and encode a TS file with 2 audio tracks from a mov file.</p>
  
  <pre><code>ffmpeg -loglevel verbose -i test.mov -map 0:1 -map 0:2
  -acodec:0 aac -ab 160k  -acodec:1 eac3 -ac 6 -ar 48000 -ab 640k -dialnorm -24 -dsur_mode 0 -original 1 -dmix_mode 2 -channel_layout 63   -y test.ts
  </code></pre>
  
  <p>Im ending up with 2 audiotracks, both EAC3..</p>
  
  <p>Source output:</p>
  
  <pre><code>ffprobe version N-94156-g93a73df54d Copyright (c) 2007-2019 the FFmpeg developers
    built with gcc 9.1.1 (GCC) 20190621
    configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
    libavutil      56. 30.100 / 56. 30.100
    libavcodec     58. 53.101 / 58. 53.101
    libavformat    58. 28.101 / 58. 28.101
    libavdevice    58.  7.100 / 58.  7.100
    libavfilter     7. 56.100 /  7. 56.100
    libswscale      5.  4.101 /  5.  4.101
    libswresample   3.  4.100 /  3.  4.100
    libpostproc    55.  4.100 / 55.  4.100
  [h264 @ 000001c37707e640] Reinit context to 1920x1088, pix_fmt: yuv420p10le
  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 's:\test.mov':
    Metadata:
      major_brand     : qt
      minor_version   : 512
      compatible_brands: qt
      encoder         : Lavf58.21.100
    Duration: 00:02:28.61, start: 0.000000, bitrate: 61419 kb/s
      Stream #0:0(nor): Video: h264 (High 10), 1 reference frame (avc1 / 0x31637661), yuv420p10le(left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 52197 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
      Metadata:
        handler_name    : Apple Video Media Handler
        encoder         : Lavc58.36.100 libx264
        timecode        : 00:00:00:00
      Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
      Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 5.1, s32 (24 bit), 6912 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
      Stream #0:3(eng): Data: none (tmcd / 0x64636D74) (default)
      Metadata:
        handler_name    : Apple Video Media Handler
        timecode        : 00:00:00:00
  Unsupported codec with id 0 for input stream 3
  </code></pre>
  
  <p>Anyone know whats wrong?</p>
  
Tags: <ffmpeg>
Title: ffmpeg and mapping against 2 target audio tracks!
UserDisplayName: TEB
ThreadText: # ffmpeg and mapping against 2 target audio tracks!
  
  (Asked by: username_0 on 2019-07-03)
  
  Im trying to mux and encode a TS file with 2 audio tracks from a mov file.
  
  ```
  ffmpeg -loglevel verbose -i test.mov -map 0:1 -map 0:2
  -acodec:0 aac -ab 160k  -acodec:1 eac3 -ac 6 -ar 48000 -ab 640k -dialnorm -24 -dsur_mode 0 -original 1 -dmix_mode 2 -channel_layout 63   -y test.ts
  
  ```
  
  Im ending up with 2 audiotracks, both EAC3..
  
  Source output:
  
  ```
  ffprobe version N-94156-g93a73df54d Copyright (c) 2007-2019 the FFmpeg developers
    built with gcc 9.1.1 (GCC) 20190621
    configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
    libavutil      56. 30.100 / 56. 30.100
    libavcodec     58. 53.101 / 58. 53.101
    libavformat    58. 28.101 / 58. 28.101
    libavdevice    58.  7.100 / 58.  7.100
    libavfilter     7. 56.100 /  7. 56.100
    libswscale      5.  4.101 /  5.  4.101
    libswresample   3.  4.100 /  3.  4.100
    libpostproc    55.  4.100 / 55.  4.100
  [h264 @ 000001c37707e640] Reinit context to 1920x1088, pix_fmt: yuv420p10le
  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 's:\test.mov':
    Metadata:
      major_brand     : qt
      minor_version   : 512
      compatible_brands: qt
      encoder         : Lavf58.21.100
    Duration: 00:02:28.61, start: 0.000000, bitrate: 61419 kb/s
      Stream #0:0(nor): Video: h264 (High 10), 1 reference frame (avc1 / 0x31637661), yuv420p10le(left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 52197 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
      Metadata:
        handler_name    : Apple Video Media Handler
        encoder         : Lavc58.36.100 libx264
        timecode        : 00:00:00:00
      Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
      Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 5.1, s32 (24 bit), 6912 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
      Stream #0:3(eng): Data: none (tmcd / 0x64636D74) (default)
      Metadata:
        handler_name    : Apple Video Media Handler
        timecode        : 00:00:00:00
  Unsupported codec with id 0 for input stream 3
  
  ```
  
  Anyone know whats wrong?
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-07-03. Score: 0
  
  Use
  
  `ffmpeg -loglevel verbose -i test.mov -map 0:1 -map 0:2
  -codec:a:0 aac -b:a:0 160k -codec:a:1 eac3 -ac:a:1 6 -ar:a:1 48000 -b:a:1 640k -dialnorm -24 -dsur_mode 0 -original 1 -dmix_mode 2 -channel_layout 63 -y test.ts`
  
  `acodec` is an alias for `codec:a` and it does not accept stream specifiers. Same goes for other codec-related options like bitrate.
  
  > **Comments:**
  > **username_0**: Seems that ure answer partly helped the situation, as now both AAC and eAC3 are present in the mux.. But the AAC track is 5.1, but the source track is stereo. The eAC3 track is 5.1 as the source..  
  > **username_1**: It's the channel_layout. That will force all output tracks to that layout. Remove it.  
  > **username_0**: That did the trick.. I got a rogue mpeg2 video track in addition.. but i muxed it out! Thx!  
  
  ---
  
  