[FFmpeg-user] splitting and concatenating file results in a different file

Jon Beyer jbeyer at gmail.com
Thu Oct 31 15:55:35 EET 2019


I'm trying to understand the basics of splitting a file on I frames and
then concatenating the smaller files back together.  I am using the
commands below to split a basic .mp4 file with the "-f segment" option, and
then I use "-f concat" to join them.  I then extract all frames from the
file as .jpg files and compare the results.  The concatenated version has
three extra frames that seem to appear at what would be the start of the
second chunk.  Any idea what is going on here, and how to correct it?

Thanks in advance!

ffmpeg -i input.mp4 -map 0 -c copy -f segment -segment_time 10
chunk_%03d.mp4

ffmpeg -f concat -safe 0 -i mylist.txt -c copy concat.mp4

ffmpeg -i input.mp4 video1/frames_%05d.jpg
ffmpeg -i concat.mp4 video2/frames_%05d.jpg

diff -r video1/ video2/


More information about the ffmpeg-user mailing list