themactep.com

A home of miscellaneous projects by Paul Philippov.

Notes

How to extract a single frame from H.264

as h264

ffmpeg -i video.mp4 -c:v copy -frames:v 1 -f h264 frame.h264

as PNG

ffmpeg -i video.mp4 -frames:v 1 -f image2 frame.png

4-th frame

ffmpeg -i video.mp4 -c:v libx264 -filter:v "select=gte(n\,4)" -frames:v 1 -f h264 frame.h264

I-frames

ffmpeg -skip_frame nokey -i video.mp4 -vsync vfr -frame_pts true out-%02d.jpeg
ffmpeg -i video.mp4 -vf "select='eq(pict_type,I)'" -vsync vfr out-%02d.jpeg