mpegtsmux: exceeding CBR bitrate by the elementary stream
Hello, we are using GStreamer for remuxing mpegts produced by some broadcasting HW, the output container is also mpegts.
We do know that mpegtsmux's CBR mode requires the overall output bitrate must be higher than bitrate of all elementary streams combined, but it seems that we are facing bitrate exceeding problem even if the mpegtsmux output bitrate was set correctly.
The problem looks as follows:
Here is the DVBInspector's bitrate chart view of the original stream:
And here is what we have after remuxing this stream with filesrc ! tsdemux ! mpegtsmux ! filesink
pipeline:
As a result of bitrate peaks on the last pic the remuxed stream has timestamps problems exactly at the points where the peaks are presented. PTS/DTS are too late for the generated by the mpegtsmux CBR implementation PCRs:
My questions:
- Why this bitrate peaks may happen even if the original stream has no problems with timestamps?
- The original stream looks really unusual for me, seems like the stream producing HW is "CBRing" elementary streams somehow so ES streams bitrate looks perfectly flat and video ES looks like it's CBR I frames only but it's actually not. Also there is no stuffing in the original stream. Is it possible to use paddings for elementary streams instead of mpegts stuffing with null packets?
Thanks in advance!