Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd July 2017, 21:29   #1  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
libmpv development with C#

Does anybody know if libmpv supports the OSC?

I wanted to learn Lua and thought it's nice but then I realized that I would need too much time to learn it. Now I want to try to script the player with JavaScript, does anybody know if I can rename a file or start a process that renames a file?

Are there other players that are scriptable/extendable? I know VLC supports Lua scripting and Kodi supports Python scripting.
stax76 is offline   Reply With Quote
Old 27th July 2017, 04:47   #2  |  Link
avih
Capture, Deinterlace
 
avih's Avatar
 
Join Date: Feb 2002
Location: Right there
Posts: 1,971
Quote:
Originally Posted by stax76 View Post
Does anybody know if libmpv supports the OSC?
Not sure. Regardless, I think typically you'd use libmpv to embed the video content in a GUI of your own.

Quote:
I wanted to learn Lua and thought it's nice but then I realized that I would need too much time to learn it. Now I want to try to script the player with JavaScript, does anybody know if I can rename a file or start a process that renames a file?
Lua in mpv has its standard library available - through which you can most probably rename a file (probably via the "io" module).

Both Lua and JS in mpv support "mp.utils.readdir()" and "mp.utils.subprocess" command to execute an arbitrary program with arguments, which you could probably use to rename a file.

JS in mpv also has high level functions for reading and writing (but not deleting) plain text files, so depending on your exact needs, it might be enough.

See https://mpv.io/manual/master/#lua-scripting and https://mpv.io/manual/master/#javascript .
avih is offline   Reply With Quote
Old 27th July 2017, 12:18   #3  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Thanks for the help, mp.utils.subprocess should work for me, I need it to write a rating to the filename of the video files.
stax76 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:45.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.