[Libav-user] How ffmpeg insert/drop frames when applying pts filter?
halfelf.ronin at gmail.com
Thu Jul 28 13:46:45 EEST 2016
I'd like to use libav* to speed up/slow down videos. The same function in
ffmpeg -i somevideo.mp4 -vf 'setpts=3*PTS' frames_%04d.jpg
ffmpeg -i somevideo.mp4 -vf 'setpts=0.1*PTS' frames_%04d.jpg
Since the "-vf" option means "video filter", I started testing with
examples/filtering_video.c, and configured my filter graph with the same
filter str like above :
// I just modified the codes from examples/filtering_video.c
avfilter_graph_parse_ptr(filter_graph, "setpts=0.1*PTS", &inputs,
Turns out this will only set the pts field of AVFrame. However the
`ffmpeg` command-line tool will insert/drop some frames to keep fps
unchanged. Maybe it just drop some frames evenly when speeding up, but how
does it generate new frames when slow down?
Much appreciated if anyone could show me where in the source ffmpeg
inserts/drop those frames, or how to do it on my own.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user