Opened 6 years ago

Closed 5 years ago

#13357 closed Developer Task (Fixed)

Add support for NVDEC (aka CUVID or CUDA) decoding using NVidia GPU through FFmpeg

Reported by: Peter Bennett Owned by: Peter Bennett
Priority: minor Milestone: 31.0
Component: MythTV - Video Playback Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

VDPAU does not support video that is bigger than 1920x1080. VDPAU is not being updated.

NVDEC is a new API for accessing the GPU of NVidia devices.

Attachments (1)

20181227_nvdec_decode_deint.patch (48.4 KB) - added by Peter Bennett 6 years ago.
Add support for nvdec decode and deinterlace

Download all attachments as: .zip

Change History (15)

comment:1 Changed 6 years ago by bjoernv

Unfortunately H265/HEVC videos currently do not play with VDPAU playback profiles (tested with v30-Pre-1011-g7d6974a9b6, see https://pastebin.com/DYxWELE9). This worked with MythTV 29. A fix for VDPAU or NVDEC is very welcome.

comment:2 Changed 6 years ago by Peter Bennett

Milestone: unknown31.0

comment:3 Changed 6 years ago by Peter Bennett

Milestone: 31.030.1

Changed 6 years ago by Peter Bennett

Add support for nvdec decode and deinterlace

comment:4 Changed 6 years ago by Peter Bennett

Status: newaccepted

This patch adds the ability to decode and deinterlace using NVDEC with the NVidia GPU. At this level it is rather useless because the frames are still brought into main memory and then put back out to the GPU for display. With all the moving around of frames this is slower than using software decode. The next step is to add the direct transfer from decoder to OpenGL without going through system memory. I am looking at this but I may need some assistance from somebody who knows OpenGL.

With this patch it is not possible to change deinterlace methods on the fly, as deinterlace has to be set up before opening the decoder. Implementing change of deinterlace on the fly will require re-instantiating the decoder when changing deinterlace method.

comment:5 Changed 6 years ago by Peter Bennett <pbennett@…>

In 718351757/mythtv:

FFmpeg: nv-codec-headers

These headers are needed for building FFmpeg with nvdec support.
These are from the FFmpeg/nv-codec-headers repository

Refs #13357

comment:6 Changed 6 years ago by Peter Bennett <pbennett@…>

In dc34c5bb85/mythtv:

Playback: NVDEC decoding

NVDEC decoding for NVidia graphics adapters. This does not yet support
GPU to Video direct rendering. It works for video up to 4K but not
4K at 50fps. It also includes support for GPU based deinterlace.

Refs #13357

comment:7 Changed 6 years ago by Peter Bennett <pbennett@…>

In 62d9915a3/mythtv:

FFmpeg: nv-codec-headers

These headers are needed for building FFmpeg with nvdec support.
These are from the FFmpeg/nv-codec-headers repository

Refs #13357

comment:8 Changed 6 years ago by Peter Bennett <pbennett@…>

In 8eb463798c/mythtv:

Playback: NVDEC decoding

NVDEC decoding for NVidia graphics adapters. This does not yet support
GPU to Video direct rendering. It works for video up to 4K but not
4K at 50fps. It also includes support for GPU based deinterlace.

Refs #13357

comment:9 Changed 6 years ago by Peter Bennett <pbennett@…>

In 0aa23ccfdf/mythtv:

NVDEC: Fix config error when FFmpeg cannot enable nvdec

Use FFmpeg auto detect to disable nvdec when dependencies are missing

Refs #13357

comment:10 Changed 6 years ago by Peter Bennett <pbennett@…>

In ffdd5c4139/mythtv:

NVDEC: Fix config error when FFmpeg cannot enable nvdec

Use FFmpeg auto detect to disable nvdec when dependencies are missing

Refs #13357

(cherry picked from commit 0aa23ccfdfccc4e30f07ce14df2f85ae00bec344)

comment:11 Changed 6 years ago by Peter Bennett <pbennett@…>

In f13a4feac/mythtv:

NVDEC: Fix compile error when nvdec is selected but vaapi is not selected

Refs #13357

comment:12 Changed 6 years ago by Peter Bennett <pbennett@…>

In 4d7ebfa901/mythtv:

NVDEC: Fix compile error when nvdec is selected but vaapi is not selected

Refs #13357

(cherry picked from commit f13a4feac08248288f37b097f1aced09d5e69697)

comment:13 Changed 6 years ago by Peter Bennett <pbennett@…>

In 136d40a968/mythtv:

NVDEC: Fix small problem with make clean

make clean should not delete files created by configure.

Refs #13357

comment:14 Changed 5 years ago by Peter Bennett

Milestone: 30.131.0
Resolution: Fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.