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


-y		# overwrite output flags

Cheat sheets



🏗 WIP section 🛠

This section should contain a beautifull graph displaying the relations among this note and all of the others on tommi.space. Unfortunately, showing it requires great coding skills and I am still working on it.



No webmentions were found.