Skip to content

Instantly share code, notes, and snippets.

@kfitfk
Created November 3, 2022 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kfitfk/83846197b09634b334be7ae60ab4afc4 to your computer and use it in GitHub Desktop.
Save kfitfk/83846197b09634b334be7ae60ab4afc4 to your computer and use it in GitHub Desktop.
Convert from webm to hevc using ffmpeg with hevc_videotoolbox
ffmpeg -c:v libvpx-vp9 -i [input_file.webm] -c:v hevc_videotoolbox -q:v 60 -allow_sw 1 -alpha_quality 0.7 -vtag hvc1 -movflags +faststart [output_file.mp4]
# use -q:v to set quality, 60 should suffice
# use -alpha_quality to adjust alpha channel quality
# for more options, check
# ffmpeg -h encoder=hevc_videotoolbox
# ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
# built with Apple clang version 13.0.0 (clang-1300.0.29.3)
# configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/4.4.1_5 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
# References:
# https://stackoverflow.com/questions/64924728/optimally-using-hevc-videotoolbox-and-ffmpeg-on-osx
# https://stackoverflow.com/questions/69255568/how-can-i-convert-a-webm-file-with-alpha-channel-to-a-hevc-encoded-file-that-wil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment