💾 Archived View for tommi.space › FFMPEG.gmi captured on 2023-01-29 at 03:03:51. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

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 cropping a video

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

improve encoding of a video using H.265

ffmpeg -i ~/desktop/in4k.mp4 -c:v libx265 -vf scale=1080:-1 ~/desktop/out1080x265.mov

Creating an animated GIF from images

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

Flags

-y	# overwrite output flags

Cheat sheets

Devhints cheatsheet

FFmpeg cheat sheet - GitHub Gist

Resources

[DEV]: https://dev.to 'DEV'

FFMPEG examples

Derk-Jan Karrenbeld

Using Command Line To Cut Out Media Files

Automated video editing

https://dev.to