-
Notifications
You must be signed in to change notification settings - Fork 3k
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
access playing time - feature request #4653
Comments
On OSX you can create a keybinding like this:
This should be possible for other systems as well when you swap the pasteboard program with whatever your system is using. |
Here's some lua code to copy some text to clipboard. Right below there's also code that does what you probably want. You would place this in a script, add a couple of lines to get current time/duration and then a key binding to copy those to clipboard. This, of course, only works for Windows. For different systems there's different ways to use the clipboard. Here's some other code to paste from clipboard that does work with all three common platforms. All you'd need to do is find the respective commands/programs to copy to clipboard instead. |
thanks very much for your help, |
For Windows Vista and later that ships with
Annoyingly with a |
Maybe mpv should provide a set-clipboard command, then anyone can easily rebind their command to use it: Would have the benefit of being cross platform and not requiring to run extra binaries just to clipboard something. |
This command would be cross platform because then mpv would have to maintain platform-specific implementations for it. |
you might be onto something. This works pefectly with ffmpeg...
so are you saying mpv can do something like this too ? |
thanks wiiaboo, but i could not get the lua code to work local function set_clipboard(text) mp.add_key_binding("5", "set_clipboard", thanks medhefgo i tried neither seem to work |
Thanks garoto, that totally worked now. I really appreciate all your help guys. |
I've tried everything that's been written here with absolutely no success! it's a little ridiculous!! |
Are you on OSX? The first method works for me with xclip on x11. The second method also works (of course that requires enabling IPC). |
both methods also work for me on macOS. |
Copying to clipboard works fine on Windows10, mpv installed via chocolatey. But I want the timestamp to be appended to a particular text file, so I can use it at a later point instead of having to switch apps and paste. I tried this: Is there any obvious errors with this command? It worked for a couple of days. I used it more than a dozen times. But now it doesn't work and I can't figure out what changed. |
On Windows, use single forward slashes ( |
This allows seek-to.lua to accept and paste timestamps from copyTime.lua directly. The format accepted is HH:MM:SS.SSS and it can be invoked with ctrl+v by default. The copy from clipboard code is for Windows only, but it can be modified to accept clipboard on other OS too, see below. Psst... occivink/mpv-scripts#43 Getting data from clipboard is harder than it looks, there isn't a native and unified command to communicate with the clipboard for all OS. Instead, you have to call a function/program specific to your OS through a shell to get your clipboard data. Here is how mpv officially does it: https://github.com/mpv-player/mpv/blob/master/player/lua/console.lua#L619-L672 Here is some issues related to it: `https://github.com/mpv-player/mpv/issues/7361` `https://github.com/mpv-player/mpv/issues/4695` `https://github.com/mpv-player/mpv/issues/4653` (backticks around it so I don't create a reference to all of them)
This allows seek-to.lua to accept and paste timestamps from copyTime.lua directly. The format accepted is HH:MM:SS.SSS and it can be invoked with ctrl+v by default. The copy from clipboard code is for Windows only, but it can be modified to accept clipboard on other OS too, see below. Psst... occivink/mpv-scripts#43 Getting data from clipboard is harder than it looks, there isn't a native and unified command to communicate with the clipboard for all OS. Instead, you have to call a function/program specific to your OS through a shell to get your clipboard data. Here is how mpv officially does it: https://github.com/mpv-player/mpv/blob/master/player/lua/console.lua#L619-L672 Here is some issues related to it: mpv-player/mpv#7361 mpv-player/mpv#4695 mpv-player/mpv#4653
Any platform or version
A simple way to access time and duration...
With Media player classic or pot player we can either:
assign a key so player copies current time / duration to clipboard
press key x ( clipboard is now 01:25 / 11:16 )
or use windows messages, (better) eg with autohotkey
ControlGetText, time, Static2, ahk_class mpv
(time variable is now 01:25 / 11:16)
It may be possible using lua and socat and json ipc, but these technologies may be too complicated for a lot of potential developers
The text was updated successfully, but these errors were encountered: