Tuesday, May 31, 2016

ffmpeg: Transcode A Specific Audio Channel

Another one of the ffmpeg snippets I've used:

ffmpeg -i my-video.ISO -map 0:v:0 -map 0:a:2 -c:v libx264 -crf 19 -preset slow -c:a aac -strict experimental -b:a 192k -ac 2 my-video.mp4

This one will convert the ISO file onto an mp4 video, and on top of that will only save on the file the audio track number 2.
The info on how to select the audio track can be obtained from:

Input #0, mpeg, from 'my-video.ISO':
  Duration: 00:04:19.23, start: 4318.404233, bitrate: 5494 kb/s
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x480 [SAR 32:27 DAR 16:9], max. 7500 kb/s, 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:2[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:3[0x81]: Audio: ac3, 48000 Hz, mono, fltp, 192 kb/s
    Stream #0:4[0x80]: Audio: ac3, 48000 Hz, mono, fltp, 192 kb/s
    Stream #0:5[0x25]: Subtitle: dvd_subtitle
    Stream #0:6[0x24]: Subtitle: dvd_subtitle
    Stream #0:7[0x21]: Subtitle: dvd_subtitle
    Stream #0:8[0x20]: Subtitle: dvd_subtitle
    Stream #0:9[0x23]: Subtitle: dvd_subtitle
    Stream #0:10[0x22]: Subtitle: dvd_subtitle
    Stream #0:11[0x1d7]: Audio: mp2, 0 channels


Which you can get issuing a:

ffmpeg -i my-video.ISO

Labels: , , ,

0 Comments:

Post a Comment

<< Home