<div dir="ltr"><div>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"?</div><div><br></div><div>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:</div><div><br></div><div><div>pi@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.</div><div> Setting pipeline to PAUSED ...</div><div> Pipeline is live and does not need PREROLL ...</div><div> 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</div><div> Pipeline is PREROLLED ...</div><div> Setting pipeline to PLAYING ...</div><div> New clock: GstSystemClock</div><div> Redistribute latency...</div><div> 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</div><div> 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</div><div> 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</div><div> 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</div><div> 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</div><div> 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)</div><div> 0:00:00.236957529 
21871   0x7fa0041300 ERROR         v4l2bufferpool 
gstv4l2bufferpool.c:2277:gst_v4l2_buffer_pool_process:<v4l2h264enc0:pool0:sink>
 failed to start streaming</div><div> 0:00:00.237190728 21871   
0x7fa0041300 WARN            v4l2videoenc 
gstv4l2videoenc.c:870:gst_v4l2_video_enc_handle_frame:<v4l2h264enc0>
 error: Failed to process frame.</div><div> 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</div><div> 0:00:00.237658145
 21871   0x7fa0041300 WARN                 basesrc 
gstbasesrc.c:3132:gst_base_src_loop:<videotestsrc1> error: 
Internal data stream error.</div><div> 0:00:00.237807327 21871   
0x7fa0041300 WARN                 basesrc 
gstbasesrc.c:3132:gst_base_src_loop:<videotestsrc1> error: 
streaming stopped, reason error (-5)</div><div> 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.</div><div> 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</div><div> ERROR: from element /GstPipeline:pipeline0/GstWebRTCSink:ws: There is no codec present that can handle the stream's type.</div><div> Additional debug info:</div><div> net/webrtc/src/webrtcsink/<a href="http://imp.rs">imp.rs</a>(2325):
 gstrswebrtc::webrtcsink::imp::WebRTCSink::sink_event::{{closure}} (): 
/GstPipeline:pipeline0/GstWebRTCSink:ws:</div><div> Failed to look up output caps: No caps found for stream video_0</div><div> Execution ended after 0:00:00.165098161</div><div> Setting pipeline to NULL ...</div><div> Freeing pipeline ...</div><div> pi@raspberrypi:~ $ </div></div><div><br></div><div>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".</div><div><br></div><div>Regards,</div><div>Daniel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié, 8 feb 2023 a la(s) 10:33, Florian Echtler (<a href="mailto:floe@butterbrot.org">floe@butterbrot.org</a>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 08.02.23 08:22, Daniel E via gstreamer-devel wrote:<br>
> I’m testing „webrtcsink“ on a Raspberry PI. The Gstreamer stack offers <br>
> „openh264enc“ and „v4l2h264enc“. In my previous scripts I was using „webrtcbin“ <br>
> with the latter encoder.   I could add „openh264“ support to „webrtcsink“ so far <br>
> but was not able to make use of „v4l2h264enc“. There are no direct properties to <br>
> get/set „bitrate“ with this encoder. What would be necessary to support it? Are <br>
> there means to select a particular encoder, e.g. by use of „video-props“? It is <br>
> of high value to support „v4l2h264enc“ because of the hardware acceleration.<br>
<br>
Setting the parameters for v4lh264enc is admittedly a bit obscure.<br>
<br>
Here's an excerpt from my pipeline using the HW encoder: <br>
"video/x-raw,format=I420 ! queue ! v4l2h264enc <br>
extra-controls="controls,video_bitrate=1500000,video_bitrate_mode=1" ! <br>
video/x-h264,profile=constrained-baseline,level=(string)3.1 ! queue ! h264parse"<br>
<br>
Note the extra-controls parameter, which is a string containing extra V4L2 <br>
parameters. On a Raspberry Pi with default installation, you can view the <br>
available parameters with "v4l2-ctl -L -d /dev/video11". You also usually need <br>
to request a specific H.264 profile and level in the downstream caps, otherwise <br>
the encoder won't initialize properly.<br>
<br>
Hope this helps!<br>
<br>
Best, Florian<br>
-- <br>
SENT FROM MY DEC VT50 TERMINAL<br>
<br>
</blockquote></div>