# Matroskamux and changes to SPS/PPS

**URL:** https://discourse.gstreamer.org/t/matroskamux-and-changes-to-sps-pps/5363
**Category:** Application Development
**Created:** [September 10, 2025, 8:54am UTC](https://discourse.gstreamer.org/t/matroskamux-and-changes-to-sps-pps/5363 "2025-09-10T08:54:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jonasdn](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/jonasdn/32/96_2.png) [@jonasdn](https://discourse.gstreamer.org/u/jonasdn)
#### Post date: [September 10, 2025, 8:54am UTC](https://discourse.gstreamer.org/t/matroskamux-and-changes-to-sps-pps/5363/1 "2025-09-10T08:54:58Z")

</div>

Hello codec hackers!

We had a customer ingesting video to us have a bad experience … it turned out our pipeline with a matroskamux kept erroring out because some values in SPS/PPS kept changing in the input stream.

To be exact the `Seq parameter set ID` and `Pic parameter set ID` switched values during streaming which caused GStreamer error:

```  
Failed to run switchboard Error(src: /GstPipeline:Switchboard/GstSplitMuxSink:splitmuxsink0/GstMatroskaMux:muxer\_168, message: Could not multiplex stream.), debug: ../subprojects/gst-plugins-good/gst/matroska/matroska-mux.c(1132): gst\_matroska\_mux\_video\_pad\_setcaps (): /GstPipeline:Switchboard/GstSplitMuxSink:splitmuxsink0/GstMatroskaMux:muxer\_168: Caps changes are not supported by Matroska Current: `video/x-h264, stream-format=(string)avc, alignment=(string)au, codec_data=(buffer)0164002affe100276764002a2acb403c0113f2e022000003000200000300c9c04000112a8800022551c58500f1832a01000568296f3cb0, level=(string)4.2, profile=(string)high, pixel-aspect-ratio=(fraction)1/1, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true` New: `video/x-h264, stream-format=(string)avc, alignment=(string)au, codec\_data=(buffer)0164002affe200276764002a2acb403c0113f2e022000003000200000300c9c04000112a8800022551c58500f1832a00266764002a32cb403c0113f2e022000003000200000300c9c8c000d5de0006aefc58500f1832a002000568296f3cb000056831af3cb0, level=(string)4.2, profile=(string)high, pixel-aspect-ratio=(fraction)1/1, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true  
```

Is this something we can get around? Is the `matroskamux` to strict here? Or within its rights?

All the best  
Jonas

---

<div class="post-metadata">

### Author: ![tpm](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@tpm](https://discourse.gstreamer.org/u/tpm)
#### Post date: [September 10, 2025, 1:24pm UTC](https://discourse.gstreamer.org/t/matroskamux-and-changes-to-sps-pps/5363/2 "2025-09-10T13:24:46Z")

</div>

Whilst it is possible technically, this isn’t really conformant with the Matroska spec as far as I know, that’s why we don’t allow it by default.

However, if you force the input format to the muxer to `video/x-h264, stream-format=avc3` then I believe it will accept sps/pps/caps changes within reason.

Files created like that may or may not play properly elsewhere then.

(This is from memory, I didn’t check if it works)

---

<div class="post-metadata">

### Author: ![jonasdn](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/jonasdn/32/96_2.png) [@jonasdn](https://discourse.gstreamer.org/u/jonasdn)
#### Post date: [September 10, 2025, 2:29pm UTC](https://discourse.gstreamer.org/t/matroskamux-and-changes-to-sps-pps/5363/3 "2025-09-10T14:29:38Z")

</div>

Thanks, it worked in local testing with switching cabal on x264enc at least! Not sure how to provoke the exact thing this funky stream does.
