Last active
November 15, 2025 16:59
-
-
Save Voltra/90b8bbd2255b67c552574efbe344411e to your computer and use it in GitHub Desktop.
ffmpeg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fixing weird encoding issues from foreign files | |
| ffmpeg -hwaccel auto -i ./video.mp4 -acodec copy -vcodec copy ./video.fixed.mp4 | |
| # Remove audio | |
| ffmpeg -hwaccel auto -i ./render.mp4 -an -vcodec copy ./render.opti.mp4 | |
| # Good enough compression, exact same audio | |
| ffmpeg -hwaccel auto -i ./render.mp4 -acodec copy -vcodec libx264 -crf 20 ./render.opti.mp4 | |
| # Transcode to NVENC (HEVC flavor). Good enough compression, exact same audio | |
| ffmpeg -hwaccel auto -i ./render.mp4 -acodec copy -vcodec hevc_nvenc -preset llhq -rc cbr_hq -gpu any ./render.opti.mp4 | |
| # Transcode to NVENC (H264 flavor). Good enough compression, exact same audio | |
| ffmpeg -hwaccel auto -i ./render.mp4 -acodec copy -vcodec h264_nvenc -preset llhq -rc cbr_hq -gpu any ./render.opti.mp4 | |
| # Transcode to H265. Good enough compression, exact same audio | |
| ffmpeg -hwaccel auto -i ./render.mp4 -acodec copy -vcodec libx265 -crf 20 ./render.opti.mp4 | |
| # Transcode to VP9. Good enough compression. Audio converted to opus or vorbis | |
| ffmpeg -hwaccel auto -i ./render.mp4 -vcodec libvpx-vp9 -b:v 0 -crf 31 ./render.opti.webm | |
| # Transcode to H265. Good enough compression, compress audio and convert to mono | |
| ffmpeg -hwaccel auto -i ./render.mp4 -acodec copy -b:a 44000 -ar 16000 -ac 1 -vcodec libx265 -crf 20 ./render.opti.mp4 | |
| # Loudness normalize audio to -1db -14LUFS | |
| ffmpeg -hwaccel auto -i input.mp3 -af 'loudnorm=I=-14:TP=-1:LRA=11' output.mp3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment