regard to webrtcsink

Daniel E daniedroid at gmail.com
Wed Feb 8 16:05:46 UTC 2023


Thanks for the answer. I know about the magic of "extra-controls", using it
successfully in conjunction with "webrtcbin". But how to make use of it
with "webrtcsink"?

IMHO "webrtcsink" does not expose any property which would allow me to
select or configure the encoder. Also any attempt to patch this into
"video-caps" failed. Even if I add support for "v4l2h264enc" to the Rust
code (as I did with "openh264enc"), the attempt to make use of it fails
with:

pi at raspberrypi:~ $ gst-launch-1.0 --gst-debug-level=3 webrtcsink
video-caps='video/x-h264, level=(string)3.1' name=ws videotestsrc !
'video/x-raw, width=1280, height=720, framerate=30/1' ! ws.
 Setting pipeline to PAUSED ...
 Pipeline is live and does not need PREROLL ...
 0:00:00.081498536 21871   0x558adcb0c0 FIXME                default
gstutils.c:4031:gst_pad_create_stream_id_internal:<videotestsrc0:src>
Creating random stream-id, consider implementing a deterministic way of
creating a stream-id
 Pipeline is PREROLLED ...
 Setting pipeline to PLAYING ...
 New clock: GstSystemClock
 Redistribute latency...
 0:00:00.130092163 21871   0x7fa0032b50 WARN                    v4l2
gstv4l2object.c:4675:gst_v4l2_object_probe_caps:<v4l2h264enc0:src> Failed
to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
 0:00:00.131564135 21871   0x7fa0041300 FIXME                default
gstutils.c:4031:gst_pad_create_stream_id_internal:<videotestsrc1:src>
Creating random stream-id, consider implementing a deterministic way of
creating a stream-id
 0:00:00.177215096 21871   0x7fa0041300 WARN                    v4l2
gstv4l2object.c:3228:gst_v4l2_object_reset_compose_region:<v4l2h264enc0:src>
Failed to get default compose rectangle with VIDIOC_G_SELECTION: Invalid
argument
 0:00:00.177996396 21871   0x7fa0041300 WARN                    v4l2
gstv4l2object.c:3228:gst_v4l2_object_reset_compose_region:<v4l2h264enc0:sink>
Failed to get default compose rectangle with VIDIOC_G_SELECTION: Invalid
argument
 0:00:00.223065294 21871   0x7fa0041300 WARN          v4l2bufferpool
gstv4l2bufferpool.c:848:gst_v4l2_buffer_pool_start:<v4l2h264enc0:pool0:src>
Uncertain or not enough buffers, enabling copy threshold
 0:00:00.236663238 21871   0x7fa0041300 ERROR         v4l2bufferpool
gstv4l2bufferpool.c:712:gst_v4l2_buffer_pool_streamon:<v4l2h264enc0:pool0:sink>
error with STREAMON 3 (No such process)
 0:00:00.236957529 21871   0x7fa0041300 ERROR         v4l2bufferpool
gstv4l2bufferpool.c:2277:gst_v4l2_buffer_pool_process:<v4l2h264enc0:pool0:sink>
failed to start streaming
 0:00:00.237190728 21871   0x7fa0041300 WARN            v4l2videoenc
gstv4l2videoenc.c:870:gst_v4l2_video_enc_handle_frame:<v4l2h264enc0> error:
Failed to process frame.
 0:00:00.237324114 21871   0x7fa0041300 WARN            v4l2videoenc
gstv4l2videoenc.c:870:gst_v4l2_video_enc_handle_frame:<v4l2h264enc0> error:
Maybe be due to not enough memory or failing driver
 0:00:00.237658145 21871   0x7fa0041300 WARN                 basesrc
gstbasesrc.c:3132:gst_base_src_loop:<videotestsrc1> error: Internal data
stream error.
 0:00:00.237807327 21871   0x7fa0041300 WARN                 basesrc
gstbasesrc.c:3132:gst_base_src_loop:<videotestsrc1> error: streaming
stopped, reason error (-5)
 0:00:00.246597419 21871   0x7fa0032b50 WARN              webrtcsink
net/webrtc/src/webrtcsink/imp.rs:2207:gstrswebrtc::webrtcsink::imp::WebRTCSink::lookup_caps::{{closure}}:<ws>
Codec discovery pipeline failed: Failed to process frame.
 0:00:00.246684565 21871   0x7fa0032b50 ERROR             webrtcsink
net/webrtc/src/webrtcsink/imp.rs:2324:gstrswebrtc::webrtcsink::imp::WebRTCSink::sink_event::{{closure}}:<ws>
error: No caps found for stream video_0
 ERROR: from element /GstPipeline:pipeline0/GstWebRTCSink:ws: There is no
codec present that can handle the stream's type.
 Additional debug info:
 net/webrtc/src/webrtcsink/imp.rs(2325):
gstrswebrtc::webrtcsink::imp::WebRTCSink::sink_event::{{closure}} ():
/GstPipeline:pipeline0/GstWebRTCSink:ws:
 Failed to look up output caps: No caps found for stream video_0
 Execution ended after 0:00:00.165098161
 Setting pipeline to NULL ...
 Freeing pipeline ...
 pi at raspberrypi:~ $

There is also a problem when I have multiple encoders. I had to remove
"openh264enc" entirely in order to make "webrtcsink" at least doing an
attempt with "v4l2h264enc".

Regards,
Daniel

El mié, 8 feb 2023 a la(s) 10:33, Florian Echtler (floe at butterbrot.org)
escribió:

> On 08.02.23 08:22, Daniel E via gstreamer-devel wrote:
> > I’m testing „webrtcsink“ on a Raspberry PI. The Gstreamer stack offers
> > „openh264enc“ and „v4l2h264enc“. In my previous scripts I was using
> „webrtcbin“
> > with the latter encoder.   I could add „openh264“ support to
> „webrtcsink“ so far
> > but was not able to make use of „v4l2h264enc“. There are no direct
> properties to
> > get/set „bitrate“ with this encoder. What would be necessary to support
> it? Are
> > there means to select a particular encoder, e.g. by use of
> „video-props“? It is
> > of high value to support „v4l2h264enc“ because of the hardware
> acceleration.
>
> Setting the parameters for v4lh264enc is admittedly a bit obscure.
>
> Here's an excerpt from my pipeline using the HW encoder:
> "video/x-raw,format=I420 ! queue ! v4l2h264enc
> extra-controls="controls,video_bitrate=1500000,video_bitrate_mode=1" !
> video/x-h264,profile=constrained-baseline,level=(string)3.1 ! queue !
> h264parse"
>
> Note the extra-controls parameter, which is a string containing extra V4L2
> parameters. On a Raspberry Pi with default installation, you can view the
> available parameters with "v4l2-ctl -L -d /dev/video11". You also usually
> need
> to request a specific H.264 profile and level in the downstream caps,
> otherwise
> the encoder won't initialize properly.
>
> Hope this helps!
>
> Best, Florian
> --
> SENT FROM MY DEC VT50 TERMINAL
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230208/9e9290e1/attachment.htm>


More information about the gstreamer-devel mailing list