mpv-player / mpv-player/mpv

-10 seconds audio delay on some FranceTV videos with yt-dlp

Open
#9,429 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

os:linux
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

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:

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.