[FFmpeg-user] Cut-edits with ffmpeg

James Board jpboard2 at yahoo.com
Thu Jul 25 01:57:08 CEST 2013


I'm trying to use ffmpeg to edit AVI files.  The video is not mpeg-encoded yet
and each frame is stored in full.  I want to do frame-exact edits.  I really
want to specify the start and end frame numbers, but it appears ffmpeg doesn't
support that.  So, I have to specify a start and end time for each segment, and
then combine the segments with ffmpeg.  This is the command I'm using for each
segment:

ffmpeg -i in.avi -ss [start] -to end -vcodec copy -acodec copy out.avi

The 'start' and 'end' arguments are floating point numbers like 1.25, etc.  My
question is how ffmpeg interprets those numbers.  Since floating-point numbers
aren't exact, it isn't always possible to specify the exact position.  So what
does ffmpeg do when the 'start' argument doesn't fall exactly on a frame.
Does it start at the closest frame?  Does it start at the next frame after
that position?  Does it do something else?

Alternatively, if I have the exact start and end frame numbers, how can I then
convert that to exact start and end times?

Thanks for all your wonderful help.


More information about the ffmpeg-user mailing list