问题
I want to extract certain frames from video, but using this command
ffmpeg -i "video-a.mkv" -vf select="eq(n\,100)" -vsync 0 -frame_pts true "a_%06d.jpg"
ffmpeg -i "video-b.mkv" -vf select="eq(n\,100)" -vsync 0 -frame_pts true "b_%06d.jpg"
it seems I'm getting inconsistent results. for different videos I get differently named files:
a_000103.jpg
b_000101.jpg
why is that?
回答1:
The input in the log file has a delayed video start time. Reset timestamps, to make it independent of that possibility.
ffmpeg -i "video-a.mkv" -vf setpts=N/TB,select="eq(n\,100)" -r 1 -vsync 0 -frame_pts true "a_%06d.jpg"
来源:https://stackoverflow.com/questions/62608513/ffmpeg-select-filter-output-frame-numbers-are-off