Skip to content

Instantly share code, notes, and snippets.

@Weiming-Hu
Created April 4, 2019 19:54
Show Gist options
  • Save Weiming-Hu/de8e437469675800d4b3fa3353f6b04a to your computer and use it in GitHub Desktop.
Save Weiming-Hu/de8e437469675800d4b3fa3353f6b04a to your computer and use it in GitHub Desktop.
```
x=1; for i in ../spread-*png; do counter=$(printf %03d $x); ln "$i" "$counter".png; x=$(($x+1)); done
ffmpeg -r 5 -i %03d.png -c:v libx264 -r 30 -pix_fmt yuv420p spread.mp4
-r 1/10 : Display each image for 10 seconds.
-i picture-%01d.png : Reads all pictures that starts with name “picture-“, following with 1 digit (%01d) and ending with .png. If the images name comes with 2 digits (I.e picture-10.png, picture11.png etc), use (%02d) in the above command.
-c:v libx264 : Output video codec (i.e h264).
-r 30 : framerate of output video
-pix_fmt yuv420p : Output video resolution
video.mp4 : Output video file with .mp4 format.
```
@Weiming-Hu
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment