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

Move config path to "script-opts" #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snowman
Copy link

@snowman snowman commented Jul 7, 2021

Now mpv uses directory "script-opts/" as config path, which we should follow.

@elig0n
Copy link

elig0n commented Jul 16, 2021

Are the scripts working for you with mpv 0.33+ ?

@snowman
Copy link
Author

snowman commented Jul 19, 2021

yes, but i don't want to maintain two different options folder.

@elig0n
Copy link

elig0n commented Jul 19, 2021

I think this repo's maintainer is long unresponsive.

Anyway I could not get Blackbox.js or other scripts from this repo even with your patch to run on the newer mpv.
It's also too bad there is no Issues page around.

@snowman
Copy link
Author

snowman commented Jul 20, 2021

emm, I thought you were a maintainer, anyway, this is going to be off-topic.

Try add following script into your MPV_CONFIG_DIR/.init.js:

// deprecated directory
mp.module_paths.unshift("~~/scripts/modules.js");

Below to reproduce:

$ mpv --version
mpv 0.33.1-dirty Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
FFmpeg library versions:
   libavutil       56.70.100
   libavcodec      58.134.100
   libavformat     58.76.100
   libswscale      5.9.100
   libavfilter     7.110.100
   libswresample   3.9.100
FFmpeg version: n4.4

$ git clone https://github.com/VideoPlayerCode/mpv-tools /tmp/mpv-tools

$ cd /tmp/mpv-tools

$ cat <<EOF > .init.js
// deprecated directory
mp.module_paths.unshift("~~/scripts/modules.js");
EOF

$ cat <<EOF > input.conf
ctrl+b script-binding Blackbox
ctrl+f script-binding Blackbox_Favorites
EOF

$ ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 sample.mp4

$ mpv --config-dir=. sample.mp4
// press "ctrl+b" open Blackbox menu

@elig0n
Copy link

elig0n commented Jul 20, 2021

That got it working for me again thanks! I didn't know ~/scripts/modules.js was deprecated. So what does the unshift do to that path ?
Meanwhile I've merged your commit to my fork. I also put there some small usability tweaks you are welcome to check.

@Arghadatta
Copy link

Is it a problem to keep script and script-opts...
Will it give any problem??

@Arghadatta
Copy link

And what is the updated fork that i can use??
Dev purposes...

@rivertim
Copy link

rivertim commented Aug 31, 2022

First time trying to get MPV working with Colorbox.
mpv v0.34.1 built from Homebrew on Mac OS 11.6.8

Downloaded your commits for new folder name (script-opts), and following VideoPlayerCode Install-Notes instructions here for renaming Colorbox.js to main.js etc. results in broken functionality of video tools. Following errors in log:

[ 0.060][d][global] user path: '/Users/xxxx/.config/mpv/scripts/Colorbox/modules/Options.js' -> '/Users/xxxx/.config/mpv/scripts/Colorbox/modules/Options.js'
[ 0.060][v][Colorbox] Reading file '/Users/xxxx/.config/mpv/scripts/Colorbox/modules/Options.js'
[ 0.060][f][Colorbox] Error: Cannot find module file 'Options.js'
[ 0.060][f][Colorbox] at resolve_module_file (@/defaults.js:513)
[ 0.060][f][Colorbox] at require (@/defaults.js:581)
[ 0.060][f][Colorbox] at /Users/xxxx/.config/mpv/scripts/Colorbox/main.js:18
[ 0.060][f][Colorbox] at run_script (native)
[ 0.060][e][Colorbox] Could not load javascript /Users/xxxx/.config/mpv/scripts/Colorbox/main.js
[ 0.060][d][Colorbox] Exiting...

Any ideas please? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants