mpv
mpv copied to clipboard
pts discontinuous content (audio and video increase at the same time, but the actual content is aligned), playback is out of sync
Important Information
Provide following Information:
- mpv version git master
- Linux Distribution and Version ubuntu 20.04
- Source of the mpv binary git master
- If known which version of mpv introduced the problem none
- Window Manager and version none
- GPU driver and version none
- Possible screenshot or video of visual glitches
If you're not using git master or the latest release, update. Releases are listed here: https://github.com/mpv-player/mpv/releases
Reproduction steps
run:
mpv --no-config --log-file=~/Desktop/mpv.log out_jump_40s.ts
The content's pts is not continuous, like this:
[0~10s][jump about 40s in the middle][51s~64s],
With ffplay playback sync well, mpv starts to get out of sync after +10s playback.
Expected behavior
sync well
Actual behavior
desync at +10s
Log file
Sample files
I can confirm that mpv stutters slightly when it restarts playback about 10 seconds in, but the audio and video remains synced.
@thebombzen Thank you for your verification.
Maybe we can detect the change of pts by any way then do something like pts compensation? I have the impression that if the EXT-X-DISCONTINUITY tag appears in HLS, it is possible to allow the pts to change. If we can't handle the sudden change of the pts, there is no way to better cope with the reasonable scenario of hls' x-discontinuity. -(-
Uh, God, I actually submitted this hls https://github.com/mpv-player/mpv/issues/9297 bug before, it's been a long time and I almost can't remember...
So, the libavformat hls demuxer doesn't handle discontinuities properly. It works by constructing a single transport stream and then feeding that to the ts demuxer. There is a specific discontinuity packet in ts but it isn't used - instead the discontinuity just happens. It's not trivial to fix due to how the hls demuxer works and I'm surprised ffplay behaves meaningfully better than mpv as the hls demuxer is common.
@philipl Thanks for clarifying this. ffplay doesn't even complain about anything in the command line, in my environment ffplay out_jump_40s and hls both cases sync better, it's just that they both fail to quit at the end and hang on the last frame
encounter this problem
check this source: https://leshiyuncdn.ahjunqin.top/20231207/ZFEfauJ1/hls/index.m3u8