[FFmpeg-user] Can I use ffmpeg to combine audio streams in .ts file?

skyscanner at gmx.ca skyscanner at gmx.ca
Tue Sep 30 15:48:17 CEST 2014


After looking at the page at http://ffmpeg.org/ffmpeg-filters.html#amerge I finally figured out how to get the end result I want, in stereo only, but I have to do it in two passes:
 
ffmpeg -i "original program.ts" -c:v copy -map 0:0 -map 0:1 -map_channel 0.1.0 -map_channel 0.1.1 -map 0:2 -map_channel 0.2.0 -map_channel 0.2.1 -map 0:3 -map_channel 0.3.0 -map_channel 0.3.1 -map 0:4 -map_channel -1 -map_channel 0.4.1 -c:a mp2 test.ts

That removes the right audio channel from stream 4 that I do not want.

ffmpeg -i "test.ts" -c:v copy -filter_complex "[0:1][0:2][0:3][0:4] amerge=inputs=4" -c:a mp2 test2.ts

That merges the four audio streams into a single stream.  This doesn't give me 5.1 but I don't see any way to selectively pluck channels from streams and map them to 5.1 output (not saying it isn't possible, just that I can't figure out how to do it).

Now, logically, you would think I could do this:

ffmpeg -i "original program.ts" -c:v copy -map 0:0 -map 0:1 -map_channel 0.1.0 -map_channel 0.1.1 -map 0:2 -map_channel 0.2.0 -map_channel 0.2.1 -map 0:3 -map_channel 0.3.0 -map_channel 0.3.1 -map 0:4 -map_channel -1 -map_channel 0.4.1 -c:a mp2 -filter_complex "[0:1][0:2][0:3][0:4] amerge=inputs=4" test.ts

But if I try that, the program crashes with "Segmentation fault: 11" - and just in case anyone is wondering, when I run ffmpeg -version it returns this:

ffmpeg version 2.2.2-tessus
built on May  7 2014 23:17:42 with clang version 3.3 (tags/RELEASE_33/final)
configuration: --cc=/opt/local/bin/clang-mp-3.3 --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --disable-indev=qtkit --enable-runtime-cpudetect
libavutil      52. 66.100 / 52. 66.100
libavcodec     55. 52.102 / 55. 52.102
libavformat    55. 33.100 / 55. 33.100
libavdevice    55. 10.100 / 55. 10.100
libavfilter     4.  2.100 /  4.  2.100
libswscale      2.  5.102 /  2.  5.102
libswresample   0. 18.100 /  0. 18.100
libpostproc    52.  3.100 / 52.  3.100

In case it's not apparent, for these tests ffmpeg is running under OS X.  So am I doing something wrong that is causing the "Segmentation fault", or is that a bug in the program?


More information about the ffmpeg-user mailing list