Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
video:ffmpeg [2016/03/01 08:36]
smayr [Extract Video Frames]
video:ffmpeg [2018/01/05 15:43] (current)
smayr [Extract Video Frames]
Line 28: Line 28:
 </code> </code>
  
-<code batch> 
-REM --- Utility to Extract video frames into image files --- 
  
-REM SET inputfile=%1 
-SET inputfile=video 
-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 
-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 
-</code> 
  
 == Generate Video From Images == == Generate Video From Images ==
 <code batch> <code batch>
-REM --- Utility to Extract video frames into image files ---+REM --- Utility to generate video clips from frames ---
  
 SET inputfile=%1 SET inputfile=%1
 MKDIR output MKDIR output
  
-REM Each image will have a duration of 5 seconds (the inverse of 1/5 frames per second).  +REM ### Each video clip from 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 ### 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/5 -i img%%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p output\%inputfile%.mp4
 +
 +REM ### Eg: 15 sec video clips ###
 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 1/15 -i %inputfile%.png -c:v libx264 -r 24 -pix_fmt yuv420p output\%inputfile%.mp4
 +
 +REM ### View Clips ###
 EXPLORER output EXPLORER output
 </code> </code>