Skip to content

Instantly share code, notes, and snippets.

@jahed

jahed/ffmpeg-tricks.md

Last active Apr 22, 2021
Embed
What would you like to do?
FFMPEG Tricks

FFMPEG Tricks

Merging Multiple Audio Tracks

Useful for gamerips where music is split into multiple tracks for dynamic mixes and need to be merged together for a true track.

amerge is more flexible than amix so prefer using amerge.

ffmpeg -i layer-1.ogg -i layer-2.ogg -filter_complex amerge=inputs=2 -ac 2 output.mp3

Video to GIF

ffmpeg -i video.mp4 -vf "fps=10,scale=800:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 video.gif

FAQ

-ac is to set the number of audio channels (e.g. -ac 2 for stereo)

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