Trying to reduce CPU load by utilizing the GPU for h264 decoding. Tried different combinations of sinks, formats, but in every case the pipeline stucks at Redistribute latency... The same pipeline with avdec_h264 works perfectly fine:
gst-launch-1.0 -v videotestsrc ! x264enc ! h264parse ! avdec_h264 ! videoconvert ! autovideosink
Currently on Gstreamer 1.18.4, Raspberry Pi 4 32bit OS.
One of the commands I tried:
gst-launch-1.0 -v videotestsrc ! x264enc ! h264parse ! v4l2h264dec
capture-io-mode=4 ! v4l2convert output-io-mode=5 capture-io-mode=4 ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps =
video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1,
colorimetry=(string)bt601, format=(string)Y444,
multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1,
interlace-mode=(string)progressive
Redistribute latency...
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps =
video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1,
colorimetry=(string)bt601, format=(string)Y444,
multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1,
interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps =
video/x-h264, stream-format=(string)byte-stream, alignment=(string)au,
level=(string)1.3, profile=(string)high-4:4:4, width=(int)320,
height=(int)240, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)30/1, interlace-mode=(string)progressive,
colorimetry=(string)bt601, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps =
video/x-h264, stream-format=(string)byte-stream, alignment=(string)au,
level=(string)1.3, profile=(string)high-4:4:4, width=(int)320,
height=(int)240, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)30/1, interlace-mode=(string)progressive,
colorimetry=(string)bt601, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
parsed=(boolean)true
/GstPipeline:pipeline0/v4l2h264dec:v4l2h264dec0.GstPad:sink: caps =
video/x-h264, stream-format=(string)byte-stream, alignment=(string)au,
level=(string)1.3, profile=(string)high-4:4:4, width=(int)320,
height=(int)240, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)30/1, interlace-mode=(string)progressive,
colorimetry=(string)bt601, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
parsed=(boolean)true
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps =
video/x-h264, stream-format=(string)byte-stream, alignment=(string)au,
level=(string)1.3, profile=(string)high-4:4:4, width=(int)320,
height=(int)240, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)30/1, interlace-mode=(string)progressive,
colorimetry=(string)bt601, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps =
video/x-h264, stream-format=(string)byte-stream, alignment=(string)au,
level=(string)1.3, profile=(string)high-4:4:4, width=(int)320,
height=(int)240, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)30/1, interlace-mode=(string)progressive,
colorimetry=(string)bt601, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
chroma-format=(string)4:4:4, bit-depth-luma=(uint)8,
bit-depth-chroma=(uint)8, parsed=(boolean)true
/GstPipeline:pipeline0/v4l2h264dec:v4l2h264dec0.GstPad:sink: caps =
video/x-h264, stream-format=(string)byte-stream, alignment=(string)au,
level=(string)1.3, profile=(string)high-4:4:4, width=(int)320,
height=(int)240, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)30/1, interlace-mode=(string)progressive,
colorimetry=(string)bt601, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
chroma-format=(string)4:4:4, bit-depth-luma=(uint)8,
bit-depth-chroma=(uint)8, parsed=(boolean)true
/GstPipeline:pipeline0/v4l2h264dec:v4l2h264dec0.GstPad:src: caps =
video/x-raw, format=(string)I420, width=(int)320, height=(int)240,
interlace-mode=(string)progressive, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg,
colorimetry=(string)bt601, framerate=(fraction)30/1
/GstPipeline:pipeline0/v4l2convert:v4l2convert0.GstPad:src: caps =
video/x-raw, interlace-mode=(string)progressive,
multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
framerate=(fraction)30/1, format=(string)YV12, width=(int)320,
height=(int)240
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink.GstProxyPad:proxypad0:
caps = video/x-raw, interlace-mode=(string)progressive,
multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
framerate=(fraction)30/1, format=(string)YV12, width=(int)320,
height=(int)240
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstXvImageSink:autovideosink0-actual-sink-xvimage.GstPad:sink:
caps = video/x-raw, interlace-mode=(string)progressive,
multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
framerate=(fraction)30/1, format=(string)YV12, width=(int)320,
height=(int)240
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink:
caps = video/x-raw, interlace-mode=(string)progressive,
multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
framerate=(fraction)30/1, format=(string)YV12, width=(int)320,
height=(int)240
/GstPipeline:pipeline0/v4l2convert:v4l2convert0.GstPad:sink: caps =
video/x-raw, format=(string)I420, width=(int)320, height=(int)240,
interlace-mode=(string)progressive, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg,
colorimetry=(string)bt601, framerate=(fraction)30/1
Redistribute latency...
According to gst inspect the following options are available:
gst-inspect-1.0 | grep h264
video4linux2: v4l2h264dec: V4L2 H264 Decoder
video4linux2: v4l2h264enc: V4L2 H.264 Encoder
videoparsersbad: h264parse: H.264 parser
uvch264: uvch264mjpgdemux: UVC H264 MJPG Demuxer
uvch264: uvch264src: UVC H264 Source
uvch264: uvch264deviceprovider (GstDeviceProviderFactory)
typefindfunctions: video/x-h264: h264, x264, 264
libav: avdec_h264: libav H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
decoder
libav: avenc_h264_omx: libav OpenMAX IL H.264 video encoder encoder
rtp: rtph264pay: RTP H264 payloader
rtp: rtph264depay: RTP H264 depayloader