mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.71k stars 2.84k forks source link

Stats.lua reports VP9 video as H264 when --script-opts=ytdl_hook-all_formats=yes is passed #14243

Closed NotMithical closed 1 month ago

NotMithical commented 1 month ago

mpv Information

mpv v0.38.0-352-g88f20a70 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on May 25 2024 21:05:51
libplacebo version: v7.349.0 (v6.338.0-133-g9e1257c-dirty)
FFmpeg version: N-115390-g0b2316e37
FFmpeg library versions:
   libavutil       59.20.100
   libavcodec      61.5.104
   libavformat     61.3.104
   libswscale      8.2.100
   libavfilter     10.2.102
   libswresample   5.2.100

Other Information

Reproduction Steps

  1. Using yt-dlp --list-formats on a youtube link, find a format that uses the VP9 codec
  2. Load the video, selecting the video track found in step 1 and passing --script-opts=ytdl_hook-all_formats=yes, for example: .\mpv.exe --no-config --script-opts=ytdl_hook-all_formats=yes --vid=1 https://www.youtube.com/watch?v=oqsDQ7Zjpnc
  3. Open stats page 1 and observe the codec information in line 1 of the video section

Expected Behavior

Stats.lua reports the currently playing video track as using VP9, as can be confirmed by yt-dlp or ffprobe if the video has been downloaded. (MPV also correctly reports it as VP9 if --script-opts=ytdl_hook-all_formats=yes is omitted, or if the video URL is acquired through yt-dlp --get-url and loaded into MPV that way)

Actual Behavior

Stats.lua reports the codec as "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [h264]"

Log File

output.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

guidocella commented 1 month ago

Why do you assume that --vid=1 is the VP9 stream? That is selected with --ytdl-format.

NotMithical commented 1 month ago

I'm not assuming. I know with that link --vid=1 gives me the same stream as if I set --ytdl-format and I used the former because it was faster to type when I was repeatedly testing this. I did also skim through the log file myself and I know MPV opens the VP9 decoder for that stream.

Apologies for the confusion, let me know if it would be better for me to reproduce the log file using --ytdl-format instead for consistency.

guidocella commented 1 month ago

I see. Well I can't reproduce it as stats.lua shows VP9 for me with that command.

NotMithical commented 1 month ago

Thank you for checking. I've just tried that command on one of my linux machines and was unable to reproduce there as well, although a different command did give me the same result. I noticed another thing though; when I press ` to open the console, on the linux machine I tested "vp9" is shown in the stream information alongside resolution, fps, etc whereas on windows it says "null" as the codec on most of the same streams.

It didn't occur to me that that might be relevant as the console has always shown null on vp9 streams for me while the stats page issue is new.

guidocella commented 1 month ago

Maybe you're using different yt-dlp versions?

NotMithical commented 1 month ago

yt-dlp --version gives me 2024.05.26 on both systems. However I also ran yt-dlp --list-formats https://www.youtube.com/watch?v=oqsDQ7Zjpnc on both to ensure I got the same results, which it does for the most part except on windows I get more detailed codec info on the vp9 streams (e.g. vp09.00.50.08) while on linux it just says vp9.

NotMithical commented 1 month ago

Nothing in my system has changed but this appears to have resolved itself completely.