xpra icon
Bug tracker and wiki

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#1046 closed task (fixed)

nvenc v6 support

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: minor Milestone: 0.17
Component: encodings Version: trunk
Keywords: Cc:

Description (last modified by Antoine Martin)

https://developer.nvidia.com/nvidia-video-codec-sdk, new features that might be of interest to us:

  • Unified SDK for video encoding and decoding - so we can decode, even on win32, without needing another library
  • Support for input surfaces in RGB format - saves doing the CSC step using CUDA
  • "Various quality and performance improvements in encoding"
  • GPUs supported for H.265 (HEVC) encoding:
    • GeForce? GTX 960, GTX 980. GTX Titan X
    • Quadro M4000, M5000, M6000
    • Tesla M4, M6, M60

HEVC hardware encoding would be worth testing.

Attachments (1)

nvenc6-debug-forcedefault.patch (1.9 KB) - added by Antoine Martin 2 years ago.
debug init structure and force default preset

Download all attachments as: .zip

Change History (7)

comment:1 Changed 2 years ago by Antoine Martin

Description: modified (diff)
Status: newassigned

comment:2 Changed 2 years ago by Antoine Martin

Initial support added in r11471.

Summary of the most noteworthy changes (excluding various indentation changes and typos we can ignore, new constants, etc):

  • NVENCAPI_STRUCT_VERSION is packed differently now - genius, so version 6.0 looks like 0.6 (wtf!)
  • function version packing has also changed, causes lots of noise in the diff
  • removed all the tiled picture formats, which never worked anyway (always looked like a bug to me)
  • added ARGB, ARGB10 and AYUV - so it looks like we can do transparency?
  • _NV_ENC_CONFIG_HEVC has changed, a lot
  • talks about MV buffers and ME only mode

It looks like a GTX 980 or newer is required for testing HEVC..

comment:3 Changed 2 years ago by Antoine Martin

Improvements and fixes in r11815, r11816, r11817 (most of which should be backported)

Support code added in r11818 so we can at least try to probe HEVC... (still failing).
Will need to compare API parameters between the C client and the Cython version.
This works:

./NvEncoder -codec 1 -i /opt/nvenc4/Samples/YUV/1080p/HeavyHandIdiot.3sec.yuv -size 1920 1080 -o test.hevc

But our selftests do not.

comment:4 Changed 2 years ago by Antoine Martin

Instrumenting the C and Cython versions to dump the contents of the NV_ENC_INITIALIZE_PARAMS structure, I can see that most of the structure is empty (as expected), the differences are:

  • for codec 0 / h264:
    • with the C sample code:
    • with our cython code:
  • for codec 1 / hevc:
    • with the C sample code:
    • with our cython code:
Last edited 2 years ago by Antoine Martin (previous) (diff)

Changed 2 years ago by Antoine Martin

debug init structure and force default preset

comment:5 Changed 2 years ago by Antoine Martin

With the patch above applied, the structure is closer to the C version:


comment:6 Changed 2 years ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

HEVC works as of r11896. The trick was to discover that HEVC has an undocumented minimum size of 72x72..
The tests need improving so we can feed better test input into the encoder, but with the (crappy) existing tests it looks like HEVC is marginally slower than H264 (~15%) at the same resolution and settings, but compresses at lot better. (TBC)

The big disappointment is that it does not perform any better at higher resolutions (even with the low-latency profiles), and it has the same limits as h264: 4096x4096 maximum size. (this is currently hardcoded in our codec, we should be probing it instead: FIXME added in r11897)
Let's hope that other implementations deliver better performance. (#451?).
This will do for now.

Test related fix in r11895. (could be backported - may apply to libvpx testing)

Last edited 2 years ago by Antoine Martin (previous) (diff)
Note: See TracTickets for help on using tickets.