[FFmpeg-user] Inaccurate trimming with re-encoding
James Board
jpboard2 at yahoo.com
Mon Aug 5 18:07:55 CEST 2013
I'm able to do frame-exact editing with ffmpeg. It's described in this thread:
http://lists.ffmpeg.org/pipermail/ffmpeg-user/2013-July/016291.html
The command is something like this (thanks to Carl Lindqvist)
ffmpeg -i SOURCEFILE.avi -vf
select='-between(n,0,100)-between(n,130,200)',setpts=N/FRAME_RATE/TB
-c:v libx264 -preset veryfast -b:v 700k -profile:v main -af
aselect='-between(n,0,100)-between(n,130,200)',asetpts=N/SR/TB -c:a
libvo_aacenc -b:a 96k -ac 2 OUT.mp4
I verified that the frames are exactly what I wanted by checking the md5sums of each frame.
My input avi file used a raw codec with no inter-frame compression. I'm not sure if frame-exact editing will work when the input file is compressed with mpeg-like codecs.
More information about the ffmpeg-user
mailing list