This is an old revision of the document!
FFMPEG
Extract Video Frames
REM --- Utility to Extract video frames into image files --- SET inputfile=%1 MKDIR output REM --- Extract video frames for every second --- REM Example: C:\>ffmpeg.exe -i C:\path\file.mkv -q:v 1 -r 1 -ss 00:02:07 -t 00:00:30 images%05d.jpg REM C:\>ffmpeg.exe -i C:\path\file.mpg -r 1/1 $filename%03d.bmp REM REM -q:v : Sets the quality of the screenshots. The lower the number, REM the higher the quality (with 1 being the highest quality). REM It is important to include this when you want to generate REM JPEG screenshots, or low-quality images might be created. REM -r : Sets the number of frames to extract per second. REM -s : Width x Height, eg: 640×360 REM -ss : Sets the start time for commencing frame extraction. In the example above, REM it is to start at 2 minutes and 7 seconds. REM -t : Sets the duration of time to run frame extraction. REM In the example above, it sets the frame extraction to run for 30 seconds. C:\Apps\ffmpeg\bin\ffmpeg.exe -i %inputfile% -r 1/1 output\%inputfile%-%%05d.png EXPLORER output
REM --- Utility to generate video clips from frames --- REM SET inputfile=%1 SET inputfile=video MKDIR output REM Each video clip of still image will have a duration of 5 seconds (the inverse of 1/5 frames per second). REM The video stream will have a frame rate of 30 fps by duplicating the frames accordingly: REM C:\Apps\ffmpeg\bin\ffmpeg -framerate 1/5 -i img%%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p output\%inputfile%.mp4 REM C:\Apps\ffmpeg\bin\ffmpeg -framerate 1/15 -i %inputfile%.png -c:v libx264 -r 24 -pix_fmt yuv420p output\%inputfile%.mp4 C:\Apps\ffmpeg\bin\ffmpeg -framerate 3 -start_number 0001 -i CAST-%%04d.jpg -c:v libx264 -r 24 -pix_fmt yuv420p output\%inputfile%.mp4 EXPLORER output PAUSE
Generate Video From Images
REM --- Utility to Extract video frames into image files --- SET inputfile=%1 MKDIR output REM Each image will have a duration of 5 seconds (the inverse of 1/5 frames per second). REM The video stream will have a frame rate of 30 fps by duplicating the frames accordingly: REM C:\Apps\ffmpeg\bin\ffmpeg -framerate 1/5 -i img%%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p output\%inputfile%.mp4 C:\Apps\ffmpeg\bin\ffmpeg -framerate 1/15 -i %inputfile%.png -c:v libx264 -r 24 -pix_fmt yuv420p output\%inputfile%.mp4 EXPLORER output