Skip to content
Permalink
main
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
date updated tags description
2021-04-27 08:21:53 +0200
2021-10-30 23:33:52 +0200
geek/apps
Swiss army knife for video and audio editing from command line

Cheat sheet

Change format and bitrate of an audio file

ffmpeg -i ~/in.m4a -ab 128k out.mp3

Add a background to a transparent PNG, add an audio file and put all of them in a video.

ffmpeg -i background.png -stream_loop 50 -i animation.png -filter_complex overlay -i voiceover.m4a -c:v libx264 -c:a copy out.mp4

Scale video or image by keeping the aspect ratio and choosing the width.

ffmpeg -i ~/desktop/in.mov -vf scale=720:-1 ~/desktop/out.mp4

# multiple files at a time
for img in ~/desktop/pics/*.jpg; do ffmpeg -i '$img' -vf scale=1600:-1 '$img'; done;

both scaling and resizing a video

ffmpeg -i ~/desktop/in.mov -vf 'scale=720:-1,crop=720:720:0:300' ~/desktop/out.mp4

Creating an animated GIF from images

ffmpeg -framerate 4 -pattern_type glob -i '*.png' quotes.gif

Flags

-y		# overwrite output flags

Cheat sheets


Resources