Skip to content

Instantly share code, notes, and snippets.

@blurymind
Created September 15, 2018 12:22
Show Gist options
  • Save blurymind/f6c11ee8eacde4a50f711e46dafd37b0 to your computer and use it in GitHub Desktop.
Save blurymind/f6c11ee8eacde4a50f711e46dafd37b0 to your computer and use it in GitHub Desktop.
Simple Batch script to extract frames from a video file- uses ffmpeg
@echo off
echo This requires you to install ffmpeg
REM ffmpeg -i file.mov -r 24/1 output%03d.png
REM nxF is for file with ext
for %%F in ("%~1") do SET fileNameExt=%%~nxF
for %%F in ("%~1") do SET fileName=%%~nF
echo file name is: %fileName%
SET ffmpegPath=C:\ffmpeg\bin\ffmpeg.exe
SET fps=30
echo Trying to run %ffmpegPath%
echo opening "%~1"
echo Fps used: %fps%
if not exist "%fileName%" mkdir "%fileName%"
%ffmpegPath% -i "%~1" -r %fps%/1 %fileName%/%fileNameExt%-%%03d.png
REM pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment