## convert 10-12bit h265 to 8bit h264 ```sh # 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 ```sh # 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 ```sh # 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 ```