[FFmpeg-user] How to split and then concatenate a video file?

Žygimantas Bruzgys un1x0nly at gmail.com
Wed Feb 20 15:37:24 CET 2013

On Wed, Feb 20, 2013 at 3:17 PM, Žygimantas Bruzgys <un1x0nly at gmail.com> wrote:
> On Wed, Feb 20, 2013 at 2:16 PM, Stefano Sabatini <stefasab at gmail.com> wrote:
>>> zybru at hp-6530b-bs:~/Desktop$ ffmpeg -i small.mp4 -f segment -vcodec
>>> h264 -acodec mp3 -segment_time 2 -map 0 out%03d.mp4
>> Did you try with -reset_timestamps 1?
> Let me try it now! (just fyi, I've recompiled ffmpeg today from git head)

What I've else noticed today is that:

- if you demux the video and segment it with '-f segment' with output
format .h264;
- concatenate all h264s to a single h264;
- mux h264 with audio back to mp4 file

despite couple of errors during concatenation, everything works
smoothly and as it should. This makes me draw a conclusion that there
is some kind of a bug in segmenting (or concatenating) mp4 containers.

The output was a bit big, so I put it on gist:

Žygimantas Bruzgys

More information about the ffmpeg-user mailing list