Code Monkey home page Code Monkey logo

Comments (20)

hooke007 avatar hooke007 commented on June 3, 2024 2

Yes

from thumbfast.

po5 avatar po5 commented on June 3, 2024

Does the script work fine after running that command?
I guess we just have to make more of an effort to find the actual path to the mpv executable.
This is also an issue on Windows for users that haven't added mpv to path.

from thumbfast.

hooke007 avatar hooke007 commented on June 3, 2024

This is also an issue on Windows for users that haven't added mpv to path.

No, as a windows portable mpv user, I can confirm that the script works well even though out of PATH.

from thumbfast.

po5 avatar po5 commented on June 3, 2024

It is, for those who don't have it in path and are launching mpv from outside its own directory.

eko: Does replacing "mpv" with "/Applications/mpv.app/Contents/MacOS/mpv" on this line also work?

"mpv", path, "--no-config", "--msg-level=all=no", "--idle", "--pause", "--keep-open=always", "--really-quiet", "--no-terminal",

Will try to add auto detection of the currently running executable path for a not-too-messy solution.

from thumbfast.

hooke007 avatar hooke007 commented on June 3, 2024

eko: Does replacing "mpv" with "/Applications/mpv.app/Contents/MacOS/mpv" on this line also work?

hooke007/MPV_lazy#186 (comment)
We actually tested before and it worked.

The only problem is the bundle app can be placed anywhere, we didn't find the solution to check it.

from thumbfast.

christoph-heinrich avatar christoph-heinrich commented on June 3, 2024

The docs mention ~~osxbundle/ for Mac and ~~exe_dir/ for Windows.

from thumbfast.

hooke007 avatar hooke007 commented on June 3, 2024

see mpv-player/mpv#10009 ~~exe_dir/ couldn't work for me.

Another info we noticed in that thread is the old thumbnailer(worker) doesn't have this issue(Mac).

from thumbfast.

po5 avatar po5 commented on June 3, 2024

Another info we noticed in that thread is the old thumbnailer(worker) doesn't have this issue.

At first glance this uses the exec_path variable which is user-defined, with a default value of

((os.getenv('PWD') or mp.get_property('working-directory')) .. ':' .. os.getenv('PATH'))

I've used functionally similar code before, but I don't know if that's enough to find the mpv path on Mac.

https://github.com/po5/audio_background/blob/85e7f3364aadc5ef4fd34cb091519003afd0f837/audio_background.lua#L35-L57

from thumbfast.

christoph-heinrich avatar christoph-heinrich commented on June 3, 2024

We already have the PID. There has got to be a way of getting the path from the pid on every OS. On linux readlink /proc/<pid>/exe gives you the executable path, but no idea how to do it on mac or windows.

from thumbfast.

po5 avatar po5 commented on June 3, 2024

on my arch system:

$ ps -o comm= -p PIDHERE
mpv

$ which mpv
/usr/bin/mpv

Is that enough on Mac?

stackoverflow says this could work:

realpath /proc/PIDHERE/exe

from thumbfast.

eko5624 avatar eko5624 commented on June 3, 2024

ln -s /Applications/mpv.app/Contents/MacOS/mpv /usr/local/bin

Yes, after running this command it works well on my Mac.

from thumbfast.

po5 avatar po5 commented on June 3, 2024

Can you install thumbfast from the mac-test branch (https://github.com/po5/thumbfast/blob/mac-test/thumbfast.lua), and try the following:

Open a file in mpv through the terminal, hover on the timeline once.
Copy the PID displayed in terminal.
Open a second terminal, don't close mpv.
Run realpath /proc/PID_HERE/exe (replace PID_HERE)
Run ps -o comm= -p PID_HERE (replace PID_HERE)
Run which RESULT_OF_PREVIOUS_COMMAND (replace RESULT_OF_PREVIOUS_COMMAND with result of ps command above)

Post the output of the 3 commands you ran.
Hopefully that will get us the path to mpv, wherever it happens to be installed, on a Mac system.

from thumbfast.

eko5624 avatar eko5624 commented on June 3, 2024
/Applications/mpv.app/Contents/MacOS/mpv /Volumes/USB/Downloads/星际穿越.mkv 
Cannot find main.* for any supported scripting backend in: /Users/huangjiajia/.config/mpv/scripts
[thumbfast] script-opts/thumbfast.conf:8 unknown key 'tnpath', ignoring 
[thumbfast] script-opts/thumbfast.conf:29 unknown key 'min_duration', ignoring 
[thumbfast] script-opts/thumbfast.conf:31 unknown key 'precise', ignoring 
[thumbfast] script-opts/thumbfast.conf:33 unknown key 'frequency', ignoring 
[uosc] script-opts/uosc.conf:126 unknown key 'font_height_to_letter_width_ratio', ignoring 
[thumbfast] PID 6850 

Open second terminal:

huangjiajia@huangjiajiadeMacBook-Pro ~ % realpath /proc/6850/exe
realpath: /proc/6850/exe: No such file or directory
huangjiajia@huangjiajiadeMacBook-Pro ~ % ps -o comm= -p 6850
/Applications/mpv.app/Contents/MacOS/mpv
huangjiajia@huangjiajiadeMacBook-Pro ~ % which /Applications/mpv.app/Contents/MacOS/mpv
/Applications/mpv.app/Contents/MacOS/mpv

from thumbfast.

po5 avatar po5 commented on June 3, 2024

What about the ps+which commands (:

from thumbfast.

eko5624 avatar eko5624 commented on June 3, 2024

I reedited, please take a look.

from thumbfast.

po5 avatar po5 commented on June 3, 2024

Seems like ps -o comm= -p PID_HERE would do the trick! Thanks for helping out.

from thumbfast.

po5 avatar po5 commented on June 3, 2024

Does the script work out of the box on the latest commit?

from thumbfast.

eko5624 avatar eko5624 commented on June 3, 2024

Weird thing, when hovering on the timeline, there's one more mpv icon popped up on dock, like this:
QQ20221030-133833@2x

from thumbfast.

LampPrinter avatar LampPrinter commented on June 3, 2024

Weird thing, when hovering on the timeline, there's one more mpv icon popped up on dock, like this: QQ20221030-133833@2x

Is there a solution to this?
Whenever thumbnails get generated playing any video in MacOS, I get 2 more MPV icons in dock.
Kinda irritating.

from thumbfast.

po5 avatar po5 commented on June 3, 2024

Another info we noticed in that thread is the old thumbnailer(worker) doesn't have this issue(Mac).

I've been able to set up a Mac VM and try this out. It doesn't even work out of the box, and the reason it doesn't generate extra icons is because it uses ffmpeg by default?
I'll commit a solution that properly picks up on the symlink if the user made it.

from thumbfast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.