mpv icon indicating copy to clipboard operation
mpv copied to clipboard

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

Open Totorrr opened this issue 2 years ago • 4 comments

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

Totorrr avatar Nov 09 '21 15:11 Totorrr

I'm not able to play this video to test it, do I need to have a French IP address? The website shows this: image (Translation: Subscribe for more content: It's simple and free. Subscribe. Sign Up. Learn More. Available until 09 November 2022)

Traneptora avatar Nov 19 '21 16:11 Traneptora

Thanks for your answer @thebombzen !

Apparently, you do need a French IP address to access the video. However, you can login from anywhere. I don't know if that would be of any help, but here is a dummy account that can be used to login (by clicking on "je me connecte"): login : [email protected] pass : YTdebug2021!

When I tried using a Dutch IP address, I would login, but then would get an error when trying to play the video (geo blocking).

Also, when not geo blocked, mpv can play the video without any authentication/login.

Let me know if I can help in any way.

Totorrr avatar Nov 23 '21 20:11 Totorrr

I don't have a VPN that can put me in France, so there's not much I can do to debug this even if I can log in. If any other mpv contributors are in France or can obtain a French IP address, they might be able to help more.

Traneptora avatar Nov 24 '21 01:11 Traneptora

I have around the same 10 second delay on a france.tv video using mpv, but this issue is not happening with yt-dlp.

Altonss avatar Jul 24 '22 20:07 Altonss