-
-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvdec hardware accelerated decoder #3703
Comments
Now working for
|
paint NV12 in opengl backend (only 'Y' plane for now until I find the correct shader / incantation) from PBOs we create for both planes
It paints... but needs a new shader: this one only paints the
For now I have used this
More
For |
this is undocumented, but not entirely unexpected for NV12 pixel storage format, this fixes colors bleeding, at least with the non-opengl case
Trying to get It finds the same valid encodings and chroma formats: GST_DEBUG=nvdec*:4 gst-inspect-1.0 nvh264dec
0:00:00.902346129 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: mpegvideo bit-depth 8 with chroma format 0 [48 - 4080] x [16 - 4080]
0:00:00.908428330 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: mpeg2video bit-depth 8 with chroma format 0 [48 - 4080] x [16 - 4080]
0:00:00.914007625 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: mpeg4video bit-depth 8 with chroma format 0 [48 - 2032] x [16 - 2032]
0:00:00.920519713 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1094:gst_nv_decoder_check_device_caps: No codec map corresponding to codec 3
0:00:00.921501455 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: h264 bit-depth 8 with chroma format 0 [48 - 4096] x [16 - 4096]
0:00:00.927115589 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: jpeg bit-depth 8 with chroma format 0 [64 - 32768] x [64 - 16384]
0:00:00.929860858 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: jpeg bit-depth 8 with chroma format 1 [64 - 32768] x [64 - 16384]
0:00:00.932570852 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1094:gst_nv_decoder_check_device_caps: No codec map corresponding to codec 6
0:00:00.932581141 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1094:gst_nv_decoder_check_device_caps: No codec map corresponding to codec 7
0:00:00.933641584 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: h265 bit-depth 8 with chroma format 0 [144 - 8192] x [144 - 8192]
0:00:00.934768056 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: h265 bit-depth 10 with chroma format 0 [144 - 8192] x [144 - 8192]
0:00:00.935946641 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: h265 bit-depth 12 with chroma format 0 [144 - 8192] x [144 - 8192]
0:00:00.939812713 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: vp8 bit-depth 8 with chroma format 0 [48 - 4096] x [16 - 4096]
0:00:00.945379570 655952 0x55f02fa992d0 INFO nvdecoder gstnvdecoder.c:1171:gst_nv_decoder_check_device_caps: vp9 bit-depth 8 with chroma format 0 [128 - 8192] x [128 - 8192]
Factory Details:
Rank primary (256)
Long-name NVDEC h264 Video Decoder
Klass Codec/Decoder/Video/Hardware
Description NVDEC video decoder
Author Ericsson AB, http://www.ericsson.com, Seungha Yang <[email protected]>
Plugin Details:
Name nvcodec
Description GStreamer NVCODEC plugin
Filename /usr/lib64/gstreamer-1.0/libgstnvcodec.so
Version 1.20.5
License LGPL
Source module gst-plugins-bad
Source release date 2022-12-19
Binary package Fedora GStreamer-plugins-bad package
Origin URL http://download.fedoraproject.org
GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstVideoDecoder
+----GstNvDec
+----nvh264dec
Pad Templates:
SINK template: 'sink'
Availability: Always
Capabilities:
video/x-h264
stream-format: byte-stream
alignment: au
profile: { (string)constrained-baseline, (string)baseline, (string)main, (string)high, (string)constrained-high, (string)progressive-high }
width: [ 48, 4096 ]
height: [ 16, 4096 ]
SRC template: 'src'
Availability: Always
Capabilities:
video/x-raw
width: [ 48, 4096 ]
height: [ 16, 4096 ]
framerate: [ 0/1, 2147483647/1 ]
format: { (string)NV12 }
video/x-raw(memory:GLMemory)
width: [ 48, 4096 ]
height: [ 16, 4096 ]
framerate: [ 0/1, 2147483647/1 ]
format: { (string)NV12 }
video/x-raw(memory:CUDAMemory)
width: [ 48, 4096 ]
height: [ 16, 4096 ]
framerate: [ 0/1, 2147483647/1 ]
format: { (string)NV12 }
Element has no clocking capabilities.
Element has no URI handling capabilities.
Pads:
SINK: 'sink'
Pad Template: 'sink'
SRC: 'src'
Pad Template: 'src'
Element Properties:
automatic-request-sync-point-flags: Flags to use when automatically requesting sync points
flags: readable, writable
Flags "GstVideoDecoderRequestSyncPointFlags" Default: 0x00000003, "corrupt-output+discard-input"
(0x00000001): discard-input - GST_VIDEO_DECODER_REQUEST_SYNC_POINT_DISCARD_INPUT
(0x00000002): corrupt-output - GST_VIDEO_DECODER_REQUEST_SYNC_POINT_CORRUPT_OUTPUT
automatic-request-sync-points: Automatically request sync points when it would be useful
flags: readable, writable
Boolean. Default: false
discard-corrupted-frames: Discard frames marked as corrupted instead of outputting them
flags: readable, writable
Boolean. Default: false
max-display-delay : Improves pipelining of decode with display, 0 means no delay (auto = -1)
flags: readable, writable
Integer. Range: -1 - 2147483647 Default: -1
max-errors : Max consecutive decoder errors before returning flow error
flags: readable, writable
Integer. Range: -1 - 2147483647 Default: 10
min-force-key-unit-interval: Minimum interval between force-keyunit requests in nanoseconds
flags: readable, writable
Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0
name : The name of the object
flags: readable, writable, 0x2000
String. Default: "nvh264dec0"
parent : The parent of the object
flags: readable, writable, 0x2000
Object of type "GstObject"
qos : Handle Quality-of-Service events from downstream
flags: readable, writable
Boolean. Default: true And gst-launch-1.0 videotestsrc ! x264enc ! queue ! nvh264dec ! videoconvert ! autovideosink Building tar -Jxvf ~/Downloads/gst-plugins-bad-1.20.5.tar.xz
cd gst-plugins-bad-1.20.5/
mkdir build
cd build/
meson ..
ninja
sudo ninja install
rm -fr ~/.cache/gstreamer-1.0
GST_PLUGIN_PATH=/usr/local/lib64/gstreamer-1.0/ GST_DEBUG=nvdec*:5 gst-inspect-1.0 nvh264dec Hoping to dump the data structures and using the sample data from xpra/xpra/codecs/codec_checks.py Lines 23 to 37 in 5be5799
then saving each frame to a different file, I can replay using: gst-launch-1.0 multifilesrc location="%02d.h264" index=0 \
caps="video/x-h264,stream-format=byte-stream,alignment=nal,width=128,height=128,framerate=1/1" \
! avdec_h264 ! videorate ! autovideosink But not with
This one works with all decoders: gst-launch-1.0 videotestsrc pattern=white ! x264enc ! nvh264dec ! videoconvert ! autovideosink But only thanks to caps negotiation. Saving the frames using: gst-launch-1.0 videotestsrc pattern=white
! video/x-raw,width=320,height=240
! x264enc
! multifilesink location="frame%d.h264" Then trying to replay them with What makes it work is to specify
|
Correction, this works for
And
Though that's only half the problem, the bigger issue is that for |
Split from #202.
There are other frameworks for hardware acceleration, but nvidia's offering is generally the most stable option.
https://docs.nvidia.com/video-technologies/video-codec-sdk/nvdec-video-decoder-api-prog-guide/
The text was updated successfully, but these errors were encountered: