gstreamer/subprojects/gst-plugins-bad/gst
Jordan Yelloz f11735c97b tsmux: Adjust byte counter when adjusting bitrate
When configured in constant bitrate mode, the muxer computes timing information
using the configured bitrate and the byte counter (now = bytes sent / byterate).

When an application changes the bitrate in CBR mode during playback, the
relationship between bytes sent and bitrate is no longer valid so new timing
values will be off by the ratio of the old bitrate to the new bitrate.
Furthermore, it will upset the way that padding is generated.

pad_stream() works by trying to fit the byte counter to now * byterate.
The result is that when decreasing bitrate, the muxer stalls, waiting until the
byte counter is in agreement with now * byterate. Also, when increasing
bitrate, the padding will spike in volume until the byte counter fits with
now * byterate.

If the byte counter is scaled by the ratio of new bitrate / old bitrate when
adjusting bitrate, then padding is generated in a way that applications would
more likely expect.

One detail this change doesn't yet address is whether the next PCR will match up
optimally with the previous PCR right after the byte counter is scaled. In that
case, some correction may be necessary. Also, perhaps the user should be
prevented from changing from bitrate=0 to bitrate=nonzero during playback since
it's not straightforward how to scale the byte counter in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7158>
2024-07-25 15:02:11 +00:00
..
accurip meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
adpcmdec meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
adpcmenc meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
aiff meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
asfmux asfmux: fix potentially unaligned write on 32-bit ARM 2023-06-14 04:59:05 +00:00
audiobuffersplit Revert "audiobuffersplit: Update out_segment even without discont" 2024-02-15 15:37:11 +00:00
audiofxbad meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
audiolatency audiolatency: Fix event refcounting bug handling latency events 2023-08-06 08:00:56 +00:00
audiomixmatrix meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
audiovisualizers meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
autoconvert autoconvert: Fix race condition when creating sub elements 2024-06-05 12:53:45 +00:00
bayer bayer2rgb: Support video/x-bayer 10/12/14/16 bit depths 2023-06-15 08:26:12 +00:00
camerabin2 camerabin: Correctly relink viewfinderbin_queue 2023-12-18 17:07:31 +00:00
codecalpha alphadecodebin: Explicitly pass 64 bit integers as such through varargs 2024-03-27 17:05:33 +00:00
codectimestamper codectimestamper: never set DTS to NONE 2024-06-13 16:25:57 +00:00
coloreffects meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
debugutils fpsdisplaysink: fix copy'n'paste-o in license header 2023-10-27 10:54:44 +00:00
dvbsubenc dvbsubenc: fixed some memory leaks and a crash 2024-04-17 11:37:49 +00:00
dvbsuboverlay video-filters: Fix passthrough with ANY caps feature 2023-10-03 21:13:00 +00:00
dvdspu dvdspu: use multiple minimal sized PGS overlay rectangles 2024-05-13 08:37:51 +00:00
faceoverlay meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
festival meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
fieldanalysis gst-plugins-bad: re-indent with GNU indent 2.2.12 2023-03-17 03:18:54 +00:00
freeverb meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
frei0r meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
gaudieffects gstgaussblur: delete unused code 2023-12-04 18:54:31 +00:00
gdp meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
geometrictransform meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
id3tag gst-plugins-bad: re-indent with GNU indent 2.2.12 2023-03-17 03:18:54 +00:00
insertbin insertbin/doc: add "Since" markers to pass CI 2023-11-17 01:09:49 +01:00
inter kate: remove plugin 2023-10-27 07:34:39 +00:00
interlace gst-plugins-bad: re-indent with GNU indent 2.2.12 2023-03-17 03:18:54 +00:00
ivfparse meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
ivtc meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
jp2kdecimator gst-plugins-bad: re-indent with GNU indent 2.2.12 2023-03-17 03:18:54 +00:00
jpegformat jpegparse: turn some bus warnings into object ones 2024-04-04 11:35:07 +00:00
librfb meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
midi midiparse: drop use of GSlice allocator 2023-02-03 17:48:10 +00:00
mpegdemux mpegpsdemux: Rework gap sending 2023-04-06 01:34:03 +00:00
mpegpsmux gst: Move GstQueueArray as GstVecDeque to core 2024-05-06 18:25:42 +00:00
mpegtsdemux mpegtsmux: mux meta/x-id3 2024-07-03 08:40:21 +00:00
mpegtsmux tsmux: Adjust byte counter when adjusting bitrate 2024-07-25 15:02:11 +00:00
mse bad: Added W3C Media Source Extensions library 2023-11-19 13:48:43 +00:00
mxf mxf: Use GDateTime instead of gmtime() 2024-06-06 08:33:51 +00:00
netsim netsim: drop use of GSlice 2023-01-24 15:25:07 +00:00
onvif rtponviftimestamp: make sure to set E and T bits on last buffer of lists 2024-03-07 14:02:33 +00:00
pcapparse pcapparse: Avoid unaligned memory access 2024-06-14 10:32:54 -05:00
pnm meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
proxy proxysink: Post EOS message on EOS event 2022-12-08 14:51:56 +00:00
rawparse meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
removesilence doc: Fix newline char between authors 2023-05-20 05:48:23 +00:00
rist ristsrc: Clean caps instead of unref 2024-03-23 10:31:57 +01:00
rtmp2 rtmp2: guard against calling gst_amf_node_get_type() with NULL 2024-06-28 07:18:29 +00:00
rtp rtpsrc: Give better names to internal elements 2023-04-28 16:00:47 +00:00
sdp sdpdemux: Add SDP message (aka session) attributes to the caps too 2024-02-09 14:54:29 +00:00
segmentclip meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
siren meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
smooth meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
speed meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
subenc meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
switchbin switchbin: Rework gst_switch_bin_get_allowed_caps() to limit path lock 2024-02-08 18:33:29 +00:00
timecode timecodestamper: Improve error handling and don't crash 2024-01-25 01:38:08 +00:00
transcode transcodebin: Fixes for upstream selectable support 2023-08-02 17:12:48 +00:00
unixfd unixfd: Close file descriptors on error 2024-04-26 18:52:19 +00:00
videofilters meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
videoframe_audiolevel meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
videoparsers av1parse: Properly transfer TU timestamp 2024-05-28 23:59:36 +00:00
videosignal meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
vmnc meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
y4m y4mdec: Fix some debug log categories 2024-02-06 12:42:54 +00:00
meson.build bad: Added W3C Media Source Extensions library 2023-11-19 13:48:43 +00:00