Skip to content

Instantly share code, notes, and snippets.

@davidtron
Last active January 19, 2024 12:22
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidtron/52f6805e7a46605359c7 to your computer and use it in GitHub Desktop.
Save davidtron/52f6805e7a46605359c7 to your computer and use it in GitHub Desktop.
Transcode h265 down to h264 on OSX using ffmpeg
  • Install brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Install ffmpeg with h265 and h264 libraries
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265 --with-x264
  • I want to transcode the video from h265 to h264 and copy the audio stream without re-encoding, there's multiple streams in the source mkv
ffmpeg -i input.mkv -map 0:v -c:v libx264 -preset slow -crf 22 -map 0:a -c:a copy -strict -2 -c:a aac output.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment