mpegtsmux: adjusting input buffer pts doesn't fully control output pts
mpegtsmux
seems to only write MPEGTS PTS values based on an internal clock. Controlling these values is important if you want to create matching segments for HLS for example.
Take a command like the following:
gst-launch-1.0 audiotestsrc timestamp-offset=50000000000 ! fdkaacenc ! mpegtsmux ! filesink location=/tmp/test.ts
Then run:
ffprobe -show_frames /tmp/test.ts | head -n 10
Expected Behavior
The expected output might look something like this:
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pts=4500000
pts_time=50.000000
pkt_dts=4500000
pkt_dts_time=50.000000
best_effort_timestamp=4500000
best_effort_timestamp_time=50.000000
Observed Behavior
The actual output looks like this:
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pts=328500000
pts_time=3650.000000
pkt_dts=328500000
pkt_dts_time=3650.000000
best_effort_timestamp=328500000
best_effort_timestamp_time=3650.000000
Setup
- Operating System: Debian/Ubuntu
- Device: Computer
- GStreamer Version: 1.18.4 – 1.23.90
How reproducible is the bug?
Always.
Solutions you have tried
avmux_mpegts
works as expected.
So does mpegtsmux
when commenting out these lines:
They were added in ead42a5e.