NVIDIA FFmpeg Transcoding Guide

Hello @rzzbu5l,

FFmpeg sources have been updated since the article was published.
Below is the preferable syntax for on-GPU transcoding:

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -c:v h264_nvenc -v:b 5M output.mp4

Relevant video decoder will be selected automatically from the list of codecs supported by cuda hwaccel.

@rarzumanyan and @rzzbu5l, I’ve updated the post to use the preferred syntax. Thanks for the feedback!

Can you clarify some of the syntax and options described in the blog post?

  1. What is the difference between -hwaccel cuda and -hwaccel cuvid? Are they just different ways to do the same thing?

  2. What is the difference between the two scaling methods mentioned: -resize before -i and scale_npp as a filter? I’ve also seen the scale_cuda filter mentioned elsewhere on the nvidia web site. I realize that the filter method can be used if you want two outputs, but for a single output is there any difference in quality or speed between the three methods? I’m downscaling 4K to 1080p, and want the highest quality.

  3. Any thoughts on how -cq and -qp compare when using hardware encoding?

Thanks!

NVIDIA FFmpeg Transcoding Guide

##issues in installing ffmpeg

Hi All,

I have CentOS Stream 8 vm which has 50 gb space and i have tried the below steps for installing ffmpeg on the the vm by following steps present in the nvidia-ffmpeg-transcoding-guide

1.Downloaded repository “Making sure you're not a bot! and cloned with
git clone Making sure you're not a bot!
2.Downaloded the nvidia driver for tesla T4 product and linux 64-bit RHEL 8
file name is “nvidia-driver-local-repo-rhel8-510.47.03-1.0-1.x86_64.rpm”
3.Downloaded the cuda tool kit for centos 8 system by running following commands

(I)wget https://developer.download.nvidia.com/compute/cuda/11.6.2/local_installers/cuda-repo-rhel8-11-6-local-11.6.2_510.47.03-1.x86_64.rpm
(II)sudo rpm -i cuda-repo-rhel8-11-6-local-11.6.2_510.47.03-1.x86_64.rpm
(III)sudo dnf clean all
(IV)sudo dnf -y module install nvidia-driver:latest-dkms
(V)sudo dnf -y install cuda

4.cloned the rep FFmpeg/nv-codec-headers

5.After completion of ffmpeg/nv-codec-headers,i have entered to the nv-codec-headers
cd nv-codec-headers
6.i’m getting below installation messages when i ran the “make install” command and kindly help me in resolving the issue
[root@localhost nv-codec-headers]# make install
sed ‘s#@@PREFIX@@#/usr/local#’ ffnvcodec.pc.in > ffnvcodec.pc
install -m 0755 -d ‘/usr/local/include/ffnvcodec’
install -m 0644 include/ffnvcodec/*.h ‘/usr/local/include/ffnvcodec’
install -m 0755 -d ‘/usr/local/lib/pkgconfig’
install -m 0644 ffnvcodec.pc ‘/usr/local/lib/pkgconfig’

Hi,I have a question to ask:

  1. Does this new version support HDR (PQ and HLG format) video transcoding?
  2. If not, is there a way to support that by using or modifying (also want to know about how difficult this work may be) the encoder and decoder API?

Many thanks! Looking forward to hearing from you.