ffmpegflacmkv

ffmpeg: combine 2 .m2ts files into one mkv/flac file


I'm currently using ffmpeg -i /mnt/dvd/BDMV/STREAM/00003.m2ts -vcodec copy -c:a flac -ignore_unknown output1.mkv to backup some Blurays and this has been fine for the smaller discs, but I'm coming across ones with multiple .m2ts files that would be better preserved as one file. is it possible to do this in one command if at all?


Solution

  • Assuming the m2ts files don't have content from multiple programs muxed in, you can run

    ffmpeg -i "concat:/mnt/dvd/BDMV/STREAM/00003.m2ts|/mnt/dvd/BDMV/STREAM/00004.m2ts" -vcodec copy -c:a flac -ignore_unknown output1.mkv.