· How To · 1 min read
ffmpeg: AMD & NVIDIA hardware video encoding (h264, h265)
I recently needed to export some video from an Enterprise Video Surveillance system. The system will only export mjpeg avi videos, which are huge files. I ended up using ffmpeg to encode these videos...
This post was originally published on jcutrer.com (WordPress) and has been migrated to the archive.
I recently needed to export some video from an Enterprise Video Surveillance system. The system will only export mjpeg avi videos, which are huge files. I ended up using ffmpeg to encode these videos into h.264 mp4 files. I performed the video encoding on a machine with an AMD GPU. This article documents some of the ffmpeg command line switches require to perform hardware video encoding on both NVIDIA and AMD GPUs.
Encode AVI to h.264 Video (Software Encoding)
ffmpeg -i input.avi -c:v libx264 output.mp4Encode AVI to h.265 Video (Software Encoding)
ffmpeg -i input.avi -c:v libx265 output.mp4Encode AVI to h.264 Video (AMD GPU Encoding)
ffmpeg -i input.avi -c:v h264_amf output.mp4Encode AVI to h.265 Video (AMD GPU Encoding)
ffmpeg -i input.avi -c:v hevc_amf output.mp4Encode AVI to h.264 Video (NVIDIA GPU Encoding)
ffmpeg -i input.avi -c:v h264_nvenc output.mp4Encode AVI to h.265 Video (NVIDIA GPU Encoding)
ffmpeg -i input.avi -c:v hevc_nvenc output.mp4Comments are disabled (Giscus not yet configured).