<div dir="ltr">Hello everyone,<div><br></div><div> I'd like to use libav* to speed up/slow down videos. The same function in command line:</div><div><br></div><div> ffmpeg -i somevideo.mp4 -vf 'setpts=3*PTS' frames_%04d.jpg</div><div> ffmpeg -i somevideo.mp4 -vf 'setpts=0.1*PTS' frames_%04d.jpg</div><div><br></div><div> 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 :</div><div><br></div><div> // I just modified the codes from examples/filtering_video.c</div><div> avfilter_graph_parse_ptr(filter_graph, "setpts=0.1*PTS", &inputs, &outputs, NULL);</div><div> avfilter_graph_config(filter_graph, NULL);</div><div><div><br></div><div> 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? </div><div><br></div><div> Much appreciated if anyone could show me where in the source ffmpeg inserts/drop those frames, or how to do it on my own.</div><div><br></div>-- <br><div class="gmail_signature"><div>Regards,</div><div>Shu Wang</div></div>
</div></div>