Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script does not work with network videos on latest version of mpv #8

Closed
gotmax23 opened this issue Nov 17, 2021 · 9 comments
Closed
Labels
bug Something isn't working

Comments

@gotmax23
Copy link

gotmax23 commented Nov 17, 2021

(Bug report template based on Red Hat Bugzilla's)

Description of problem

After updating to the latest version of mpv, 0.34.0, mpv_thumbnail script stopped working.

Version-Release number of selected component (if applicable)

mpv-0.34.0-1.fc35.x86_64 (from RPMFusion)
mpv_thumbnail_script 0.4.4

How reproducible

This issue only occurs with streaming videos. Local files are not effected. Here is my local configuration in case that is relevant:

mpv.conf:

hwdec=vaapi
no-keepaspect-window
#ytdl-format="bestvideo[height<=1080][vcodec!=vp9]+bestaudio/best"
sub-auto=fuzzy
sub-scale=0.75
slang=en,en-US,eng,en*
save-position-on-quit
# Use yt-dlp instead of youtube-dl
script-opts=ytdl_hook-ytdl_path=yt-dlp
# Needed for mpv_thumbnail_script
osc=no

mpv_thumbnail_script.conf:

# Use mpv to generate thumbnail even if ffmpeg is found in PATH
# ffmpeg is slightly faster than mpv but lacks support for ordered chapters in MKVs,
# which can break the resulting thumbnails. You have been warned.
# Defaults to yes (don't use ffmpeg)
prefer_mpv=no

# Allow thumbnailing network paths (naive check for "://")
# Defaults to no
thumbnail_network=yes

# The maximum dimensions of the thumbnails, in pixels
# Defaults to 200 and 200
thumbnail_width=400
thumbnail_height=400

Steps to Reproduce

  1. mpv 'https://youtu.be/siEIKFy1Q0I' -- any other YouTube video would work too.

Expected results

Script to generate thumbnails

Actual results

  1. Thumbnailing failed, check console for details message printed

Output:

$ mpv 'https://youtu.be/siEIKFy1Q0I' --no-resume-playback
 (+) Video --vid=1 (*) (vp9 1920x1080 30.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
File tags:
 Uploader: Brodie Robertson
 Channel_URL: https://www.youtube.com/channel/UCld68syR8Wi-GY_n4CaoJGA
[ffmpeg] AVHWDeviceContext: Failed to query surface attributes: 20 (the requested function is not implemented).
[vo/gpu/vaapi-egl] failed to retrieve libavutil frame constraints
Using hardware decoding (vaapi).
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1920x1080 vaapi[nv12]
AV: 00:00:00 / 00:13:12 (0%) A-V:  0.000 Cache: 6.7s/871KB
[mpv_thumbnail_script_client_osc] Using playlist workaround due to long source path 
[mpv_thumbnail_script_server] Thumbnailing remote path, falling back on mpv. 
[mpv_thumbnail_script_server_2] Thumbnailing remote path, falling back on mpv. 
AV: 00:00:01 / 00:13:12 (0%) A-V:  0.000 Cache: 16s/3MB
[mpv_thumbnail_script_server] Thumbnailing command failed! 
[mpv_thumbnail_script_server] mpv process error: nil 
[mpv_thumbnail_script_server] Process stdout:  
[mpv_thumbnail_script_server] Debug log: /tmp/mpv_thumbs_cache/siEIKFy1Q0I-0/000000.bgra.log 
[mpv_thumbnail_script_server] Output file missing! /tmp/mpv_thumbs_cache/siEIKFy1Q0I-0/000000.bgra 
AV: 00:00:01 / 00:13:12 (0%) A-V:  0.000 Cache: 16s/3MB
[mpv_thumbnail_script_server_2] Thumbnailing command failed! 
[mpv_thumbnail_script_server_2] mpv process error: nil 
[mpv_thumbnail_script_server_2] Process stdout:  
[mpv_thumbnail_script_server_2] Debug log: /tmp/mpv_thumbs_cache/siEIKFy1Q0I-0/000032.bgra.log 
[mpv_thumbnail_script_server_2] Output file missing! /tmp/mpv_thumbs_cache/siEIKFy1Q0I-0/000032.bgra

Additional info

Here are the debug logs:

000000.bgra.log
000032.bgra.log

@gotmax23 gotmax23 changed the title Plugin does not work on latest version of mpv Script does not work on latest version of mpv Nov 21, 2021
@marzzzello
Copy link
Owner

Yeah known issue. See also #3

@marzzzello marzzzello added the bug Something isn't working label Nov 22, 2021
@jjc385
Copy link

jjc385 commented Dec 5, 2021

I'd suggest renaming this issue and ideally the top level description to make the scope (streaming videos) more clear. As a potential user, I was initially misled into thinking the entire extension no longer works.

Maybe something like: Script no longer works for streaming videos on latest version of mpv

@gotmax23 gotmax23 changed the title Script does not work on latest version of mpv Script does not work with network videos on latest version of mpv Dec 5, 2021
@gotmax23
Copy link
Author

gotmax23 commented Dec 5, 2021

That's a good idea, @jjc385. I just did.

@gotmax23
Copy link
Author

gotmax23 commented Dec 5, 2021

@marzzzello,

Is there any movement on this? What exactly is blocking it? I am interested in packaging this script in RPMFusion, but I can't do so if it doesn't work the version of mpv that we ship.

Thanks,
Maxwell

@marzzzello
Copy link
Owner

Not all network streams are affected but most. We need to debug this. I don't know when I will get around to do that and I'm not very familiar with the code so any help is much appreciated.

@mauricioquintela
Copy link

From my tests, setting remote_direct_stream=no on the mpv_thumbnail_script.conf file makes it work. It is slower than before, but better than nothing

@marzzzello
Copy link
Owner

marzzzello commented Feb 5, 2022

Most YouTube videos should work now on the latest version

The above example works now

mpv 'https://youtu.be/siEIKFy1Q0I'

I did some quick testing and seems like videos <1h work and longer ones don't
Edit: longer videos work too by setting autogenerate_max_duration = 3600 higher or by pressing T to manually start thumbnailing

@polarathene
Copy link

polarathene commented Mar 14, 2022

I did some quick testing and seems like videos <1h work and longer ones don't

Probably due to:

-- Only automatically thumbnail videos shorter than this (seconds)
autogenerate_max_duration = 3600, -- 1 hour

I haven't tried the script myself as I'm just looking into it, but the original project had an issue that your comment reminded me of: TheAMM#59 (comment)

@marzzzello
Copy link
Owner

@polarathene Thanks, I totally missed that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants