


If you get an error from configure complaining about missing ffnvcodec, this project is what you need. Note: FFmpeg uses its own slightly modified runtime-loader for NVIDIA's CUDA/NVENC/NVDEC-related libraries. The NVIDIA Codec SDK or compiling FFmpeg with -enable-cuda-llvmįfmpeg configured with -enable-nvenc (default if the drivers are detected while configuring) Supported drivers for your operating system In order to enable it in FFmpeg you need:

FFmpeg supports NVENC through the h264_nvenc and hevc_nvenc encoders. NVENC can be used for H.264 and HEVC encoding. They can be used for encoding and decoding on Windows and Linux. NVENC and NVDEC are NVIDIA's hardware-accelerated encoding and decoding APIs. (yes, you can do both decoding and encoding with your nvidia graphics card) if you have more than one graphics card, you can change the number. See ffmpeg -h encoder=libx265 for additional supported pixel formats.This is what worked for me: (NVIDIA GTX 1650 SUPER) ffmpeg -hwaccel_device 0 -hwaccel cuda -i "input.mkv" -c:v h264_nvenc -preset slow "output.mp4"ĭevice is set to 0 because that is the first GPU in your computer. Other 10-bit pixel formats supported by libx265 are yuv422p10le & yuv444p10le, but your player may not like these. Uses the format filter to choose the yuv420p10le pixel format to create 10-bit output. See FFmpeg Wiki: HEVC / H.265 for more info on -crf and -preset.ġ2-bit HEVC to 10-bit HEVC ffmpeg -i input -map 0 -c:v libx265 -crf 20 -vf format=yuv420p10le -c:a copy output.mkv

Add the -preset option if you want to adjust encoding speed. No need for the format filter in this case.ġ0-bit/12-bit HEVC to 8-bit HEVC ffmpeg -i input -map 0 -c:v libx265 -crf 20 -vf format=yuv420p -c:a copy output.mkvĪdjust the -crf value to provide the desired level of quality. See FFmpeg Wiki: Map.ġ0-bit/12-bit HEVC to 10-bit H.264 ffmpeg -i input -map 0 -c:v libx264 -crf 18 -c:a copy output.mkv map 0 will include all streams (default stream selection only selects 1 stream per type). Uses the format filter to choose the yuv420p pixel format to create 8-bit output.ġ0-bit/12-bit HEVC to 8-bit H.264 ffmpeg -i input -map 0 -c:v libx264 -crf 18 -vf format=yuv420p -c:a copy output.mkv See FFmpeg Wiki: H.264 for more info on -crf and -preset. Merge video + audio and convert to 8-bit H.264 with deinterlace ffmpeg -i Svatba_Petr_1.m2v -i Svatba_Petr_1.wav -c:v libx264 -crf 18 -vf "bwdif,format=yuv420p" -c:a aac D:\output3.mp4Īdjust the -crf value to provide the desired level of quality.
