There are so many guides on the internet, and unfortunately, not a single one of them satiated my desire for what I wanted to do! So below is a nice one-liner to, you guessed it, dump just about every frame from a video, with VideoLAN via the PowerShell/command prompt.
.\vlc.exe "C:\Users\UserNameHere\Documents\source-file-to-dump.mp4" --video-filter=scene --scene-format=png --scene-width=-1 --scene-height=-1 --scene-prefix=frame --start-time=0 --stop-time=60 --scene-ratio=0 --gpu-affinity=0 --vout=any --rate=0.20 --scene-path="C:\Users\UserNameHere\Documents\output" vlc://quit
The TLDR:
- Go to where you have VideoLAN installed, for me it is
C:\Program Files\VideoLAN\VLC
- Ensure you have a dump/output folder created – probably best to have it in the same location that the video file is sourced at. For me, it is aptly named
output
in the Documents folder. - Modify the command above to whatever you see fit for the output directory.
The command arguments used above explained:
--video-filter=scene
– Forces VLC to use the Scene module.--scene-format=png
– If you want to save space, use jpeg in this place.--scene-width=-1
– -1 will output the images as equal to the source, eg 1920 wide video, 1920 wide image.--scene-height=-1
– -1 just like above, will output the image height equal to the video height.--scene-prefix=frame
– Prefixes the files with a static string value, in my case, I set it toframe
. The outputted file ends up asframe0001.png
and so on.--start-time=0
– Forces the image dump to begin at 0.0 seconds. You can use decimals and sub-seconds here!--stop-time=60
– Forces the image dump to stop after 60 seconds. You can use decimals and sub-seconds here!--scene-ratio=0
– Forces it to dump every frame possible.--gpu-affinity=0
– Tells VLC to use the first GPU available. Adding this did swap the usage from CPU to GPU, and GPU usage only went to 6% on encode/decode on my GTX1080ti.--vout=any
– A miscellaneous option really, but included for sanity.- Other options are:
direct3d11,direct3d9,glwin32,gl,directdraw,wingdi,caca,vdummy,vmem,flaschen,yuv,none
- Other options are:
--rate=0.20
– Forces the playback dump to play at 0.20x of the 1x (normal) speed). Any faster will result in lost frames from being dropped! (Big note there)--scene-path=""
– Ensure where you’re going to dump out the image stills actually exists.- For me, the option set as above is:
C:\Users\UserNameHere\Documents\output
where UserNameHere if your account name on your machine andoutput
is the folder where images are dumped to.
- For me, the option set as above is:
So there you have it, VideoLAN used to dump all frames (well, nearly all frames) into their own images.