Commit graph

24 commits

Author SHA1 Message Date
Seungha Yang
da019bf137 nvcodec: Rename nvcuda{h264,h265}enc to nv{h264,h265}enc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang
60637b96c8 nvcodec: Update SDK header to 12.0.16
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang
ff6d6e1b3c nvencoder: Enhance lagacy encoding profile mapping
Updated based on the NVENC Preset Migration Guide

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang
cfd92819d9 nvencoder: Update property names and default value
... to be the same as old NVENC elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:51 +00:00
Seungha Yang
99b1f5ddd2 nvencoder: Fix maximum QP value setting
Fixing typo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6827>
2024-05-12 09:38:29 +00:00
Seungha Yang
106187cc59 nvencoder: Add support for RGB formats
Adding RGBA, RGBx, BGRA, BGRx, VUYA and RGB10A2_LE format support for performance.
However, these formats are not still recommended if upstream can support
native YUV formats (e.g., NV12, P010) since NVENC does not expose
conversion related optiones. Note that VUYA format is 4:4:4 YUV format
already but NVENC runtime will convert it to 4:2:0 format internally

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6417>
2024-04-02 13:07:29 +00:00
Seungha Yang
d444fe3fdc nvcodec: Update plugin cache
Updating plugin cache for IPC elements, JPEG encoder, and newly added
properties. Also removing Gst*SLDec which does not exist anymore
but renamed to Gst*Dec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6070>
2024-02-07 22:06:39 +00:00
Seungha Yang
0a05ba3f62 nvencoder: Add support for new preset/tune/multi-pass options
Adding new P1 ~ P7 presets and deprecate old preset values.
Also adding tune and multi-pass properties.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5428>
2023-10-14 11:03:40 +00:00
James Oliver
54074af8ec nvh264encoder: fix bounds for auto-select GPU enumeration
Fixes the bounds-check for encoder auto-select GPU enumeration to be
between 0-7 instead of 0-6. This should allow 8-GPU machines to work
with nvautogpuh264enc for the last enumerated GPU.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5438>
2023-10-05 13:37:32 +08:00
Seungha Yang
96555c7ee9 nvh264encoder: Fix template caps
It should include progressive as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4236>
2023-03-22 23:40:58 +00:00
Seungha Yang
fed252cabd nvencoder: Fix CQP option setting
... and zero initialize LUID and CUDA device list to address
coverity issue

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4215>
2023-03-17 18:30:19 +00:00
Seungha Yang
b88b323e04 nvencoder: Optimization for byte-stream to packetized format conversion
Allocate single memory instead of per NAL

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3992>
2023-02-20 02:15:24 +09:00
Seungha Yang
b6d371295a nvencoder: Add support for HDR10 static metadata
Insert HDR10 SEIs per IDR

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3992>
2023-02-20 02:15:24 +09:00
Seungha Yang
84ec16c67a nvencoder: Add support for GL memory
preparation to deprecate old NVENC elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3992>
2023-02-20 02:15:19 +09:00
Seungha Yang
eb0fca4180 nvencoder: Reuse input resource
Call input resource map functions (i.e., nvEncRegisterResource,
nvEncUnregisterResource, nvEncMapInputResource, and
nvEncUnmapInputResource) only once and reuse the mapped resources,
instead of per input frame map/unmap

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3884>
2023-02-16 17:49:54 +00:00
Seungha Yang
992406cf4f cuda, nvcodec: Make GstD3D11 dependency mandatory
GstD3D11 build-time dependencies should be always available on Windows already
and runtime dependencies as well, since required external
(non-GStreamer) depends are all system DLLs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3884>
2023-02-16 17:49:54 +00:00
Seungha Yang
bc0708eafb nvencoder: Fix min buffers parameter of allocation query in auto GPU mode
At the time when propose_allocation() get called, encoder session
would not be initialized yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3888>
2023-02-03 22:19:22 +09:00
Seungha Yang
722f097b9d nvcodec: Update for documentation
* Use GST_PARAM_DOC_SHOW_DEFAULT flags for GPU ID related
  properties
* Fix some typos
* Add since markers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3250>
2022-10-24 12:42:51 +00:00
Corentin Damman
0d5d94aabd nvcodec: fix caps leaks in nvh264/h265encoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2850>
2022-08-10 12:24:37 +00:00
Seungha Yang
30c8dbe032 nvencoder: Add support for dynamic GPU device selection
Adding nvautogpu{h264,h265}enc class which will accept upstream logical
GPU device object (GstCudaContext or GstD3D11Device) instead of
using pre-assigned GPU instance.

If upstream logical GPU device object is not NVENC compatible
(e.g., D3D11 device of non-NVIDIA GPU) or it's system memory,
then user specified "cuda-device-id" or "adapter-luid" property
will be used for GPU device selection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2666>
2022-06-30 12:38:08 +00:00
Thibault Saunier
c033f8fad2 cuda: Factor out a public GstCUDA library
So applications and elements implemented outside GStreamer can reuse
our infrastructure

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1472>
2022-04-19 16:39:43 +00:00
Seungha Yang
a0d8133d60 nvencoder: Update property names and default values
Update properties of newly written D3D11/CUDA mode encoders
to be consistent with Intel QSV plugin. And rename "zerolatency"
to "zero-reorder-delay" because previous "zerolatency" may
misleading

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2140>
2022-04-09 14:00:35 +00:00
Seungha Yang
5ed8e416fe nvcodec: Fix typos
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2107>
2022-04-03 22:12:33 +09:00
Seungha Yang
60735deded nvcodec: Add new Direct3D11/CUDA mode encoder implementation
Adding new encoder elements nvd3d11{h264,h265}enc for Direct3D11
input support and re-written nvcuda{h264,h265}enc elements.
Newly writeen elements have some differences compared with old
nv{h264,h265}enc including non-backward compatible changes.

* RGBA is not a supported input format any more:
  New elements will support only YUV formats to avoid implicit conversion
  done by hardware. Ideally it should be done by upstream element
  in order to have more control on it. Moreover, RGBA support can cause
  redundant RGBA -> YUV conversion if multiple encoders are
  used for the same RGBA input
* Subsampled planar format support is dropped:
  I420 and YV12 format are not supported formats for Direct3D11.
  Although it's supported in CUDA mode, it's not a hardware friendly
  memory layout and it will waste GPU memory since UV planes
  will have large padding due to the memory layout requirement of NVENC.
* GL support is dropped: Similar to the RGBA case,
  GL support in encoder would be suboptimal if GL input is
  used by multiple encoders, because each encoder will copy GL memory
  into CUDA memory.
  Upstream cudaupload element can be used for GL <-> CUDA
  interop instead.
* No more pre-allocation of encoder input surfaces. New implementation
  will use input CUDA memory without copy (zero-copy) or
  will copy into a NVENC's input buffer struct in case of
  system memory input.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1997>
2022-03-23 13:48:53 +00:00