View Full Version : FFMpeg 3 x Stereo tracks to 5.1 LPCM/FLAC?
alanisrox69
11th December 2015, 00:34
Hi All,
currently have been using this to merge 3 x stereo tracks (mp2) to AC3, but I want to merge them to LPCM/FLAC (along with the original video track in the file).
Here's what I've currently been using:
ffmpeg -i "f:\inputfile.ts" -c:v copy -filter_complex [0:1][0:2][0:3]amerge=inputs=3,pan=5.1:FL=c0:FR=c1:FC=c2:LFE=c3:BL=c4:BR=c5 -c:a ac3 "f:\outputfile.ts"
I tried changing ac3 to flac or lpcm but no dice. Any help is greatly appreciated! Thanks!
tebasuna51
11th December 2015, 11:18
I'm not a ffmpeg expert but maybe you can try other output container, like .mkv, AFAIK than at least FLAC is not supported in .ts container.
I think than only AC3 (I see also E-AC3) multichannel is allowed in .ts container: https://en.wikipedia.org/wiki/MPEG_Multichannel
EDIT: for LPCM multichannel you can try .m2ts container.
alanisrox69
11th December 2015, 15:58
I semi figured it out, I had to revert to ffmpeg 2.1.3 because all the latest builds give a:
Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
or
av_interleaved_write_frame(): Invalid argument
error.
but once I reverted to that old version (after some googling those errors), I got this to work:
ffmpeg -i "inputfile.ts" -c:v copy -filter_complex [0:1][0:2][0:3] amerge=inputs=3,pan=5.1:FL=c0:FR=c1:FC=c2:LFE=c3:BL=c4:BR=c5 -c:a pcm_s16le "outputfile.mkv"
I am OK with it being in mkv container. I guess I could also try .m2ts, but for now, the Popcorn Hour A400 that I use plays the files perfectly.
seems like FFMpeg has a bug with h264 video that doesn't allow the newer versions to mux it properly (at least with this h264 video!)
pandy
14th December 2015, 18:32
seems like FFMpeg has a bug with h264 video that doesn't allow the newer versions to mux it properly (at least with this h264 video!)
Perhaps? https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmp4toannexb
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.