NVDEC

Website, builds, or other suggestions.
DJX
Posts: 54
Joined: Mon Aug 06, 2012 10:37 pm

NVDEC

Post by DJX » Thu Nov 16, 2017 1:57 pm

It appears that FFmpeg got NVDEC hardware acceleration on 11/11/17:
https://lists.ffmpeg.org/pipermail/ffmp ... 10777.html

It would be awesome to see this library added to the Windows builds.
Thanks!

DJX
Posts: 54
Joined: Mon Aug 06, 2012 10:37 pm

Re: NVDEC

Post by DJX » Thu Nov 16, 2017 2:09 pm

It was also updated a few times this week and now supports H.264, HEVC, VC1 and VP9:
https://lists.ffmpeg.org/pipermail/ffmp ... 11139.html

So this is even more useful now.

hydra3333
Posts: 195
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: NVDEC

Post by hydra3333 » Fri Nov 17, 2017 2:51 am

Thanks !
This commit also changes the Libav code to dynamic loading of the cuda/cuvid libraries.
Great !

@DJX would you have an example commandline showing how to use it (assuming one has the latest CUDA installed at runtime, of course) ?
https://developer.nvidia.com/cuda-toolkit

Hmm, I wonder, does it mean that nvidia CUDA toolkit has to be installed at ffmpeg build-time for it to be enabled ?
I use a variation of rdp's cross-compile build script and installing that Windows exe toolkit on linux is currently either non-trivial or impossible, so can't currently build with cuda. I suppose I could start using the windows based https://github.com/jb-alvarado/media-autobuild_suite however I'd prefer the rdp based ffmpeg build suite.

Also, I wonder if Zeranoe's builds will incorporate this ?

red5goahead
Posts: 18
Joined: Mon Dec 05, 2016 8:26 pm

Re: NVDEC

Post by red5goahead » Fri Nov 17, 2017 3:17 pm

I've tested hwaccel with nvdec

ffmpeg.exe -y -loglevel info -c:v h264_cuvid -hwaccel nvdec -deint adaptive -resize 1920x1080 -i "[myH264_1080i.ts]" -c:v h264_nvenc -cbr true -b:v 5M -c:a aac -b:a 128k "[myresult.mp4]"

it work but no de-interlace (resize, crop is working ). I've tested also with -hwaccel cudiv

note: -hwaccel dxva2 crash ffmpeg

hydra3333
Posts: 195
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: NVDEC

Post by hydra3333 » Fri Nov 17, 2017 11:11 pm

thank you very much !

i suppose vf_scale_cuda could be used for gpu resizing if ffmpeg is built with cuda toolkit and it's installed at runtime.

i just tried to install the latest cuda 9 toolkit 9.176 on win10x64 with the latest vs2017 updated and the cuda install fails since nvidia's cuda toolkit installer doesn't recognise the very latest vs2017 (I was aiming to have a go at jb's ffmpeg windows based build toolkit); i guess waiting for nvidia to fix it is the only option. why jb's ? couldn't manage to fund a way to cross-compile with it viewtopic.php?f=5&t=5109

edit:

now I'm confused :( and very likely out of date.

Code: Select all

Decoder h264_cuvid [Nvidia CUVID H264 decoder]:
    General capabilities: delay
    Threading capabilities: none
    Supported pixel formats: cuda nv12 p010le p016le
h264_cuvid AVOptions:
  -deint             <int>        .D.V.... Set deinterlacing mode (from 0 to 2) (default weave)
     weave                        .D.V.... Weave deinterlacing (do nothing)
     bob                          .D.V.... Bob deinterlacing
     adaptive                     .D.V.... Adaptive deinterlacing
  -gpu               <string>     .D.V.... GPU to be used for decoding
  -surfaces          <int>        .D.V.... Maximum surfaces to be used for decoding (from 0 to INT_MAX) (default 25)
  -drop_second_field <boolean>    .D.V.... Drop second field when deinterlacing (default false)
  -crop              <string>     .D.V.... Crop (top)x(bottom)x(left)x(right)
  -resize            <string>     .D.V.... Resize (width)x(height)
you did have "-resize" and there used to be a "vf_scale_cuda" which was available only if you built ffmpeg with the cuda toolkit.

I wonder if "-resize" has somehow superseded vf_scale_cuda.
Last edited by hydra3333 on Sat Nov 18, 2017 5:19 am, edited 3 times in total.

red5goahead
Posts: 18
Joined: Mon Dec 05, 2016 8:26 pm

Re: NVDEC

Post by red5goahead » Fri Nov 17, 2017 11:57 pm

I'm writing a script/executable

here in github
https://github.com/Red5goahead/Lenkeng- ... er-Encoder

to use with my HDBit encoder. Hw decode and encode both would be a bless. nvidia encoder seems work well although there are no constant rate factor for this encoding method with nvidia (an asus gtx 1050 ti in my case)

the hardware de-interlace is the last step

red5goahead
Posts: 18
Joined: Mon Dec 05, 2016 8:26 pm

Re: NVDEC

Post by red5goahead » Sat Nov 18, 2017 10:50 am

hydra3333 wrote:
Fri Nov 17, 2017 11:11 pm
i just tried to install the latest cuda 9 toolkit 9.176 on win10x64
I tried to install the Cuda run-time from the network installation cuda_9.0.176_win10_network but it seems that it requires or attempts to replace the last drivers for Windows 10 with a previous one

DJX
Posts: 54
Joined: Mon Aug 06, 2012 10:37 pm

Re: NVDEC

Post by DJX » Mon Nov 27, 2017 7:05 pm

As of today (11/27), NVDEC now supports all of the following:
H.264, HEVC, MPEG-1/2/4, VC1, VP8/9

Source: https://lists.ffmpeg.org/pipermail/ffmp ... 11379.html

red5goahead
Posts: 18
Joined: Mon Dec 05, 2016 8:26 pm

Re: NVDEC

Post by red5goahead » Tue Nov 28, 2017 2:55 pm

Can anyone confirm that Nvdec is slower than cuvid? I tried several encoding using nvenc and h. 264 contextual decoding using cuvid and this nvdec, and found cuvid much faster.

red5goahead
Posts: 18
Joined: Mon Dec 05, 2016 8:26 pm

Re: NVDEC

Post by red5goahead » Wed Nov 29, 2017 11:50 am

the difference among 23 nov and 28 nov release is that a new hwaccels option in bold

cuda
dxva2
qsv
d3d11va
qsv
cuvid

Post Reply