Last active 3 hours ago

mag37 revised this gist 3 hours ago. Go to revision

1 file changed, 24 insertions

FFMPEG_tricks.md(file created)

@@ -0,0 +1,24 @@
1 +
2 + ## convert 10-12bit h265 to 8bit h264
3 + ```sh
4 + # with specific formats and to mkv
5 + ffmpeg -i input.mkv -map 0 -c:v libx264 -crf 18 -vf format=yuv420p -c:a copy output.mkv
6 +
7 + # quick and default and convert to mp4
8 + ffmpeg -i input.mkv -c:v libx264 -c:a aac output.mp4
9 + ```
10 +
11 + ## remove subtitles
12 + ```sh
13 + # Remove subtitles from a mp4, -map 0 to not affect the rest
14 + ffmpeg -i input.mp4 -map 0 -c copy -sn output.mp4
15 +
16 + # And on multiple at once
17 + for i in *.mp4 ; do ffmpeg -i "$i" -map 0 -c copy -sn "{$i%.mp4).sn.mp4"; done
18 + ```
19 +
20 + ## convert videofile to gif
21 + ```sh
22 + # By doing a 2pass palette build to get correct colors
23 + 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
24 + ```
Newer Older