dexeonify / mpv-config

My personal mpv config and user scripts. :)
69 stars 7 forks source link

MPV.net ModerX and thumbnailer #3

Closed asianmusicguy closed 2 years ago

asianmusicguy commented 2 years ago

whats the best way to set this up based on my install discussed before?

dexeonify commented 2 years ago

Check out #1. Thumbnailer.lua does not work that well in mpv.net, so you will have to use mpv_thumbnail_script. The .zip file there is outdated, but I guess I can make a new one with the latest changes to the thumbnail script and OSC.

asianmusicguy commented 2 years ago

That be great together we can make mpg functional I love that it has a context menu is a more Windows centric version of MPV sometimes I think that both MPV and MPV net fantastic but lack average user functionality because it is made by a certain type of user base

dexeonify commented 2 years ago

Here's the updated files: mpv_thumbnail_script-modernx.zip

You can read more about how to configure the thumbnail script here.

Since you are using my fork, there are a few things you need to note:

asianmusicguy commented 2 years ago

@dexeonify thumbnails are working despite instructions

dexeonify commented 2 years ago

You meant not working? Anything printed in the console?

asianmusicguy commented 2 years ago

how do i pull that up?

dexeonify commented 2 years ago

Right click -> View -> Show Console or press `

asianmusicguy commented 2 years ago

image

dexeonify commented 2 years ago

No errors there. By default, the thumbnails are autogenerated so it should be obvious when you hover the OSC. Is there a mpv_thumbnail_script_server.lua file together with modernx.lua in the scripts folder?

asianmusicguy commented 2 years ago

mpv_thumbnail_script.conf is in opts with osc.conf

asianmusicguy commented 2 years ago

mpv_thumbnail_script_server.lua is in scripts

dexeonify commented 2 years ago

From what I gather after reading through related issues in mpv.net's issue tracker, you have to add mpv into PATH (yes the official mpv, not mpv.net). Modifying the code to use mpvnet doesn't work. Either that, or use ffmpeg, which you have to add to the PATH as well. It's a little bit faster too.

The weirdest of all is that it doesn't error out when it's failing. What's up with that?

asianmusicguy commented 2 years ago

@dexeonify how do i set that?

dexeonify commented 2 years ago

Ah, mpv_thumbnail_script by default only show thumbnails for videos shorter than 1 hour. You did say you were playing a movie, so it should be more than 1 hour long.

Open mpv_thumbnail_script.conf and try changing autogenerate_max_duration in seconds, like 7200 for 2 hours.

# Only automatically thumbnail videos shorter than this (in seconds)
# You will have to press T (or your own keybind) to enable the thumbnail previews
# Set to 0 to disable the check, ie. thumbnail videos no matter how long they are
# Defaults to 3600 (one hour)
autogenerate_max_duration=3600
dexeonify commented 2 years ago

To install FFmpeg:

  1. Download a FFmpeg build. I can recommend Gyan.dev's build: ffmpeg-git-essentials.7z.
  2. Extract ffmpeg.exe inside the bin/ folder with 7-zip. ffplay.exe and ffprobe.exe are nice to have but isn't needed for the thumbnail generation.
  3. Place ffmpeg.exe somewhere, like C:\ffmpeg.exe.
  4. Add ffmpeg into PATH.
    1. Start menu > Edit the system environment variables > Enviromment variables > System variables
    2. Select the entry with "Path", then click Edit...
    3. Click New, then Browse... and choose the folder you put ffmpeg.exe in.

Go back to mpv_thumbnail_script.conf and disable prefer_mpv:

# 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

Edit: If you play AV1 videos, I recommend you to install ffmpeg-git-full.7z as it contains libdav1d. libdav1d is much faster than the default libaom-av1 in decoding AV1, which in turn mean faster thumbnails generation.

asianmusicguy commented 2 years ago

where do i got to add thr path i dont see rt menu > Edit the system environment variables > Enviromment variables > System variables

dexeonify commented 2 years ago

You have to type it out in windows search...

asianmusicguy commented 2 years ago

@dexeonify never gone this system deep before what are we actaully setting up by doing this

dexeonify commented 2 years ago

Yep. Adding to PATH allows you to run an executable from anywhere, so you don't have to type C:\ffmpeg.exe every time, just ffmpeg. In case you think ffmpeg is a virus, no, it's just a program to convert/filter video and audio files. It's a quite popular CLI tool, like mpv.

dexeonify commented 2 years ago

Also, did you verify if changing autogenerate_max_duration fixes it? I did a cursory search and found that the movie is slightly more than 2 hours long, so 7200 seconds is not enough. Just set it to 0 for testing.