You should check PyFFmpeg first.
PyFFmpeg - a wrapper around FFmpeg's libavcodec, libavformat and libavutil libraries, the main purpose of which is to provide access to individual frames of video files of various formats (including encoding MPEG and DIVX video). It also provides access to audio data.
You can also use ffmpeg , so call it using subprocess . A simple search will give you the command you need to extract the frame from the video file. Just call this command using subprocess and this should do it.
>>> import subprocess >>> import shlex
A similar procedure applies to handbrakecli or what you can use. Just call the appropriate command.
source share