Gstreamer vp8 use of temporal layer not working

I am trying to run gstreamer vp8 rtp stream, and temporal layers need to be used do to switch video quality on sfu side. But looks like parameters not supported. Can someone help or at least point me to right direction please.

Dummy attempt and log.

Command:

GST_DEBUG=3 gst-launch-1.0 v4l2src ! videoconvert ! vp8enc temporal-scalability-number-layers=3 ! rtpvp8pay ! udpsink host=127.0.0.1 port=5000

Log:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.142203811 511337 0x75f820000b70 WARN                  vpxenc gstvpxenc.c:1832:gst_vpx_enc_set_format:<vp8enc0> error: Failed to initialize encoder
0:00:00.142234257 511337 0x75f820000b70 WARN                  vpxenc gstvpxenc.c:1832:gst_vpx_enc_set_format:<vp8enc0> error: invalid parameter
ERROR: from element /GstPipeline:pipeline0/GstVP8Enc:vp8enc0: Failed to initialize encoder
Additional debug info:
../ext/vpx/gstvpxenc.c(1832): gst_vpx_enc_set_format (): /GstPipeline:pipeline0/GstVP8Enc:vp8enc0:
invalid parameter
Execution ended after 0:00:00.001366847
Setting pipeline to NULL ...
0:00:00.142428062 511337 0x75f820000b70 WARN            videoencoder gstvideoencoder.c:771:gst_video_encoder_setcaps:<vp8enc0> rejected caps video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)10/1, pixel-aspect-ratio=(fraction)1/1, format=(string)I420, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1
0:00:00.142468288 511337 0x75f820000b70 WARN                GST_PADS gstpad.c:4361:gst_pad_peer_query:<videoconvert0:src> could not send sticky events
0:00:00.142624718 511337 0x75f820000b70 WARN                GST_PADS gstpad.c:4361:gst_pad_peer_query:<v4l2src0:src> could not send sticky events
0:00:00.142650650 511337 0x75f820000b70 WARN                    v4l2 gstv4l2object.c:4450:gst_v4l2_object_set_crop:<v4l2src0:src> VIDIOC_S_CROP failed
0:00:00.143887741 511337 0x75f820000b70 WARN                    v4l2 gstv4l2object.c:3274:gst_v4l2_object_reset_compose_region:<v4l2src0:src> Failed to get default compose rectangle with VIDIOC_G_SELECTION: Invalid argument
0:00:00.145041960 511337 0x75f820000b70 WARN          v4l2bufferpool gstv4l2bufferpool.c:848:gst_v4l2_buffer_pool_start:<v4l2src0:pool0:src> Uncertain or not enough buffers, enabling copy threshold
Freeing pipeline ...

More complex attempts

Command:

GST_DEBUG=3 gst-launch-1.0 -v videotestsrc ! vp8enc temporal-scalability-number-layers=3 temporal-scalability-periodicity=4 temporal-scalability-layer-id={1,2,3} temporal-scalability-layer-sync-flags={false,false,false,true} temporal-scalability-rate-decimator={1,2,4} temporal-scalability-target-bitrate={500000,1000000,1500000} ! rtpvp8pay ! udpsink host=127.0.0.1 port=5000

Log:

(gst-launch-1.0:110035): GStreamer-WARNING **: 10:24:12.898: gst_value_deserialize_g_value_array: unimplemented
0:00:00.008691653 110035 0x64737587c820 ERROR           GST_PIPELINE gst/parse/grammar.y:612:gst_parse_element_make: could not set property "temporal-scalability-layer-id" in element "vp8enc" to "1"
0:00:00.008706608 110035 0x64737587c820 ERROR           GST_PIPELINE gst/parse/grammar.y:1264:priv_gst_parse_yyparse: link has no sink [source=@0x64737586bbc0]
0:00:00.009350819 110035 0x64737587c820 ERROR           GST_PIPELINE gst/parse/grammar.y:1264:priv_gst_parse_yyparse: link has no source [sink=@0x647375882590]
WARNING: erroneous pipeline: could not set property "temporal-scalability-layer-id" in element "vp8enc" to "1"

The error is correct. vp8enc does not support temporal-scalability-layer-id property with a type of integer. If you look at the gst-inspect-1.0 output:

  temporal-scalability-layer-id: Sequence defining coding layer membership
                        flags: readable, writable
                        Array of GValues of type "gint"

It says Array of GValues of type "gint".

That serialisation format is, as you can see from the previous error:

(gst-launch-1.0:110035): GStreamer-WARNING **: 10:24:12.898: gst_value_deserialize_g_value_array: unimplemented

is not implemented. Thus it seems that you currently cannot set this property from gst-launch-1.0 and would need to write an application.

1 Like

Even if I use without temporal ID pipeline like starts and finishes almost eminently.

Pipeline and Error:

GST_DEBUG=3 gst-launch-1.0 v4l2src ! videoconvert ! vp8enc temporal-scalability-number-layers=3 ! rtpvp8pay ! udpsink host=127.0.0.1 port=5000type or paste code here
../ext/vpx/gstvpxenc.c(1832): gst_vpx_enc_set_format (): /GstPipeline:pipeline0/GstVP8Enc:vp8enc0:
invalid parameter
0:00:00.149975294 169231 0x7db348000b70 WARN            videoencoder gstvideoencoder.c:771:gst_video_encoder_setcaps:<vp8enc0> rejected caps video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)10/1, pixel-aspect-ratio=(fraction)1/1, format=(string)I420, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1

Looks like there is something with caps, but I seem don’t understand what.

I imagine that having layers (with temporal-scalability-number-layers=3) requires setting the correct values for temporal-scalability-layer-id which cannot be done from the command line.

Have you tried writing a simple application?