Last active 4 hours ago

Revision ac9ffb0569335893d9153a148c292c45744f99f1

FFMPEG_tricks.md Raw

convert 10-12bit h265 to 8bit h264

# with specific formats and to mkv
ffmpeg -i input.mkv -map 0 -c:v libx264 -crf 18 -vf format=yuv420p -c:a copy output.mkv

# quick and default and convert to mp4
ffmpeg -i input.mkv -c:v libx264 -c:a aac output.mp4

remove subtitles

# Remove subtitles from a mp4, -map 0 to not affect the rest
ffmpeg -i input.mp4 -map 0 -c copy -sn output.mp4

# And on multiple at once
for i in *.mp4 ; do ffmpeg -i "$i" -map 0 -c copy -sn "{$i%.mp4).sn.mp4"; done

convert videofile to gif

# By doing a 2pass palette build to get correct colors
ffmpeg -i input.mp4 -filter_complex "[0:v] fps=10,scale=480:-1:flags=lanczos,split [a][b];[a] palettegen [p];[b][p] paletteuse" output.gif