[FFmpeg-user] Using ffmpeg to excerpt and concatenate video segments

Chris Herdt chris at osric.com
Wed Mar 21 04:29:44 CET 2012


I am trying to use ffmpeg to slice & splice video files (for example, from
an 1800 second video I would like to create a video that contains just
seconds 300-360, 600-660, and 900-960.

The videos I am working with are raw h.264 videos from a Night Owl security
system. The frame rate of the original videos is 7 fps.

I am able to convert segments of the video to an mp4:
ffmpeg -f h264 -r:v 7 -i infile.264 -qscale:v 1 -vsync cfr -ss 300 -t 60
outfile300-360.mp4

However, when I attempt to use one of the formats that the FAQ suggests can
be concatenated (e.g. MPEG-2, DV), it tells me:
[mpeg1video @ 0x101033200] MPEG1/2 does not support 5/1 fps

If I remove the video frame rate option, ffmpeg creates the segment, but
playback is too fast and it contains a different portion of the video than
what I'm after:
ffmpeg -f h264 -i infile.264 -qscale:v 1 -vsync cfr -ss 300 -t 60
outfile300-360.mpeg

I'm wondering if anyone has suggestions as to how to accomplish slicing and
splicing the video while maintaining the original frame rate/playback speed?


Thanks,
Chris

-- 
Chris Herdt
Web Applications Developer
267-603-1066 (home)
734-754-3585 (mobile)
http://osric.com/chris/


More information about the ffmpeg-user mailing list