mpv icon indicating copy to clipboard operation
mpv copied to clipboard

`auto profile` & `ytdl-format=` have race condition with `try_ytdl_first=yes`

Open test482 opened this issue 1 year ago • 0 comments

Important Information

Provide following Information:

  • mpv version
extra/mpv 1:0.37.0-2 [installed]
    a free, open source, and cross-platform media player
  • Platform and Version

    Arch Linux

  • Possible screenshot or video of visual glitches

script-opts=ytdl_hook-try_ytdl_first=yes

script-opts=ytdl_hook-try_ytdl_first=no

Reproduction steps

$ la -T ~/.config/mpv/
drwxr-xr-x   - eliot 02-19 17:43 /home/eliot/.config/mpv
.rw-r--r-- 452 eliot 02-19 17:52 └── mpv.conf

$ cat mpv.conf
[default]
volume=60

# yt-dlp
script-opts=ytdl_hook-ytdl_path=yt-dlp
script-opts=ytdl_hook-try_ytdl_first=yes

[twitch-live]
profile-desc=twitch live videos
profile-cond=path:match("https://www.twitch.tv/")~=nil
profile-restore=copy
ytdl-format=bestvideo*[height<=?720]+bestaudio/best
# https://github.com/streamlink/streamlink-twitch-gui/wiki/Recommendations#player-configuration
loop-playlist=inf
loop-file=inf
cache=yes
demuxer-max-back-bytes=1800M

$ yt-dlp --list-formats 'https://www.twitch.tv/olofmeister'
[twitch:stream] Extracting URL: https://www.twitch.tv/olofmeister
[twitch:stream] olofmeister: Downloading stream GraphQL
[twitch:stream] olofmeister: Downloading stream access token GraphQL
[twitch:stream] 41905731864: Downloading m3u8 information
[info] Available formats for 41905731864:
ID               EXT RESOLUTION FPS │   TBR PROTO │ VCODEC      ACODEC      ABR
───────────────────────────────────────────────────────────────────────────────
audio_only       mp4 audio only     │ 1438k m3u8  │ audio only  mp4a.40.2 1438k
160p             mp4 284x160     30 │  230k m3u8  │ avc1.4D401F mp4a.40.2
360p             mp4 640x360     30 │  630k m3u8  │ avc1.4D401F mp4a.40.2
480p             mp4 852x480     30 │ 2770k m3u8  │ avc1.4D401F mp4a.40.2
720p             mp4 1280x720    30 │ 3715k m3u8  │ avc1.4D401F mp4a.40.2
720p60           mp4 1280x720    60 │ 4765k m3u8  │ avc1.4D401F mp4a.40.2
1080p60__source_ mp4 1920x1080   60 │ 3021k m3u8  │ avc1.64002A mp4a.40.2

$ mpv 'https://www.twitch.tv/olofmeister'

got 1080p 60fps video here.

$ # change `script-opts=ytdl_hook-try_ytdl_first=yes` to `no`

$ mpv 'https://www.twitch.tv/olofmeister'

got 720p 60fps video here.

Expected behavior

got 720p 60fps stream with auto profile and try_ytdl_first=yes.

Actual behavior

auto profile and try_ytdl_first=yes will compete, ytdl-format= option in twitch-live profile not working.

Log file

--msg-level=ytdl_hook=debug

ytdl-first-yes.log

ytdl-first-no.log

test482 avatar Feb 19 '24 10:02 test482