-10 seconds audio delay on some FranceTV videos with yt-dlp
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
Important Information
Information:
- mpv version : 0.34.0
- Debian GNU/Linux Buster (10.11)
- Source of the mpv binary : own compilation (backport) from Debian/unstable package source
- which version of mpv introduced the problem: before 0.33.0 (may possibly be related to changes in yt-dlp)
- yt-dlp version : a109acbf8 (last commit from master on 2021-11-08 (includes tag/version 2021.10.22))
- youtube-dl was not used
Reproduction steps
- Go to https://www.france.tv/france-5/vu/
- Take any recent video (now I use https://www.france.tv/france-5/vu/2916059-emission-du-lundi-8-novembre-2021.html)
- launch with URL like:
mpv --no-config 'https://www.france.tv/france-5/vu/2916059-emission-du-lundi-8-novembre-2021.html'
Note: many other (but not all) videos on france.tv can be used to reproduce the problem.
Expected behavior
The video & audio plays smoothly, in sync, and the video plays to the end.
Actual behavior
- The video appears, but the sound is exactly 10 seconds in advance compared to the images.
- Also, when the playback actually starts, the OSD indicates that we are at 00:00:10
It looks like the chunk(s) for the first 10 seconds of sound is simply missing, and that creates the desync. It is possible to compensate with manually adjusting A-V delay, but that then creates glitches sometimes when seeking (and still, the first 10 seconds are missing).
Additional comment about yt-dlp
When downloading the video file with yt-dlp, and then playing the resulting local file with mpv, everything works smoothly.
In other words, doing this works as expected:
- yt-dlp 'https://www.france.tv/france-5/vu/2916059-emission-du-lundi-8-novembre-2021.html'
- mpv "VU - Emission du lundi 8 novembre 2021 [65f29c10-db4a-4c9b-9819-a8eea7bc7588].mp4"
Log file
Here is the log file (gzip compressed): francetv-yt-dlp-bug.txt.gz
Here is an interesting extract, just before the first [statusline] is shown:
[cplayer] first video frame after restart shown
[osc] osc_init
[cplayer] audio ready
[cplayer] starting video playback
[cplayer] starting audio playback
[vo/gpu/x11] Disabling screensaver.
[cplayer] playback restart complete @ 10.000000, audio=playing, video=playing
[ao/pulse] starting AO
[vd] Allocating new DR image...
[statusline] AV: 00:00:10 / 00:06:11 (3%) A-V: -0.000 Cache: 1.6s/348KB
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the FranceTV URL with mpv --no-config and inspect the linked compressed log, especially the playback restart at 10 seconds. Compare direct playback with the yt-dlp-downloaded local file. Done means the stream starts at 00:00:00 with audio and video synchronized, plays to the end, and does not lose the initial audio.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- audio-video-rtc, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100