# Webrtcsink: Renegotiation is not supported, when used with nvh264enc and h264parse

**URL:** <https://discourse.gstreamer.org/t/webrtcsink-renegotiation-is-not-supported-when-used-with-nvh264enc-and-h264parse/1126>\
**Category:** Application Development\
**Created:** [March 5, 2024, 6:42pm UTC](https://discourse.gstreamer.org/t/webrtcsink-renegotiation-is-not-supported-when-used-with-nvh264enc-and-h264parse/1126 "2024-03-05T18:42:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdelguercio](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/cdelguercio/32/414_2.png) [@cdelguercio](https://discourse.gstreamer.org/u/cdelguercio)\
**Post date:** [March 5, 2024, 6:42pm UTC](https://discourse.gstreamer.org/t/webrtcsink-renegotiation-is-not-supported-when-used-with-nvh264enc-and-h264parse/1126/1 "2024-03-05T18:42:24Z")

</div>

I’ve tried the following pipelines with gstreamer 1.24 built from source with a few different variations with queues and capfilters

```auto
src ! bayer2rgb ! nvh264enc ! h264parse ! webrtcsink video-caps="video/x-h264"

src ! bayer2rgb ! videorate ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! nvh264enc ! h264parse ! webrtcsink video-caps="video/x-h264"

```

I get the following error fairly immediately, it looks like the pipeline is adding a few extra caps into the stream at some point (newlines added for clarity):

```auto
webrtcsink net/webrtc/src/webrtcsink/imp.rs:3476:gstrswebrtc::webrtcsink::imp::BaseWebRTCSink::sink_event:<webrtcsink:video_0> 
Renegotiation is not supported (
old: video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)2.1, profile=(string)main, width=(int)480, height=(int)304, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)sRGB, parsed=(boolean)true, 
new: video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)2.1, profile=(string)main, width=(int)480, height=(int)304, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)sRGB, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true)

```

Here are the differences:

```auto
old: video/x-h264, ... colorimetry=(string)sRGB, parsed=(boolean)true
new: video/x-h264, ... colorimetry=(string)sRGB, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true)

```

I’m not sure how to either ensure that webrtcsink expects the extra caps immediately, or ensure that nvh264enc/h264parse doesn’t include those extra caps

---

<div class="post-metadata">

**Author:** ![cdelguercio](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/cdelguercio/32/414_2.png) [@cdelguercio](https://discourse.gstreamer.org/u/cdelguercio)\
**Post date:** [March 5, 2024, 9:48pm UTC](https://discourse.gstreamer.org/t/webrtcsink-renegotiation-is-not-supported-when-used-with-nvh264enc-and-h264parse/1126/2 "2024-03-05T21:48:10Z")

</div>

I believe I’ve solved this with an aggressive capsfilter

```auto
! bayer2rgb ! capsfilter caps="video/x-raw,format=RGBx" ! videorate ! video/x-raw,framerate=30/1 ! videoconvert ! nvh264enc ! h264parse ! capsfilter caps="video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)2.1, profile=(string)main, width=(int)480, height=(int)304, framerate=(fraction)30/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8" ! webrtcsink video-caps="video/x-h264"

```

but now I’m seeing a new error:

```auto
0:00:22.222943224 1176 0x7f37740011a0 WARN codecparsers_h264 gsth264parser.c:2473:gst_h264_parser_parse_slice_hdr: couldn't find associated picture parameter set with id: 0
0:00:22.223103477 1176 0x7f37740011a0 WARN h264parse gsth264parse.c:2028:gst_h264_parse_handle_frame:<h264parse1> Failed to update backlog

```

Googling is not yielding any help. I will try to solve on my own for a bit before making a new issue.
