

$ ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4įor Windows: (echo file 'first file.mp4' & echo file 'second file.mp4' )>list.txtįfmpeg -safe 0 -f concat -i list.txt -c copy output.mp4

Use this method when you want to avoid a re-encode and your format does not support file-level concatenation (most files used by general users do not support file-level concatenation). ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv \ If you want to avoid the re-encode, you could re-encode just the inputs that don't match so they share the same codec and other parameters, then use the concat demuxer to avoid re-encoding everything. Note that this method performs a re-encode of all inputs. Use this method if your inputs do not have the same parameters (width, height, etc), or are not the same formats/codecs, or if you want to perform any filtering. ts files together and have it work.įFmpeg has three concatenation methods: 1. This happens about half way through encoding which makes me think that you can't concat two. Non-existing SPS 0 referenced in buffering periodĮrror, non monotone timestamps 13779431 >= 13779431kbits/sĪv_interleaved_write_frame(): Error while opening file Unfortunately I'm getting the following error message coming back from ffmpeg during encoding: sps_id out of range ffmpeg -i part1.mp4 -vcodec copy -vbsf h264_mp4toannexb -acodec copy part1.tsįfmpeg -i part2.mp4 -vcodec copy -vbsf h264_mp4toannexb -acodec copy part2.tsįfmpeg -y -i parts.ts -acodec copy -ar 44100 -ab 96k -coder ac -vbsf h264_mp4toannexb parts.mp4 The files are h264 and aac encoded and I'm hoping to keep the quality the same or as close to original as possible. ts files and then concatenating them and then trying to encode that concatenated.

I need this to be an automatic process hence why I chose ffmpeg. I'm trying to concatenate two mp4 files using ffmpeg.
