Jump to content

[Solved] Creating a VLC Plugin/Extension with Lua, for Communicating between VLC and AutoIt


Recommended Posts

Hi


When reading about "Lua" in Wikipedia, I found out that VLC supports scripting via Lua Plugins/Extensions.
I thought that it can be really useful for scripting in AutoIt,
since the Lua code can access many variables regarding the currently running movie, etc,
and can also perform operations like display text OSD, and more.


My question:
Does anyone know of a "Hello World" example of such a Lua plugin/extension, in VLC?

It will enable to get started with it..


Thank you

Edited by Zohar
Link to comment
Share on other sites

  • Moderators

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Hi JLogan3o13


Thank you for the reference to that file.

I actually saw it several days ago, and kept a link for it, since it provides a reference for the available functions.
However it does not contain even the smallest example to "taste" the story, and to test that it works..


So that's what I am looking for..
A complete, yet minimalistic example, to run on my VLC..

Edited by Zohar
Link to comment
Share on other sites

  • 5 years later...

It is an old thread, but it is better to keep some reference points if some are interested who come by.

There  3 important functions to define in vlc  extension:

descriptor(), activate(), deactivate()

Plus this to write to console:

vlc.msg.info("Salam")

Here some examples from official source code:

- https://github.com/videolan/vlc/tree/master/share/lua/

Also it is  good to make a  look on others add-on code many are in lua.

- https://addons.videolan.org/browse/cat/

Hello World:

function descriptor()
    return {
        title = "Simple",
        version = "0.1",
        author = "Blue",
        shortdesc = "XYZ Loader",
        description = "Loads XYZ and apply on the fly",
        capabilities = {}
    }
end


local prefix = "[XYZ] " 


function activate()
    vlc.msg.info(prefix .. "activated!")
    local elapsedDuration = vlc.var.get(vlc.object.input(), "time")
    local timeAsString = tostring(elapsedDuration/1000000)
    vlc.msg.info(prefix .. timeAsString)
end


function deactivate()
    vlc.msg.info(prefix ..  "deactivated!")
end

 

Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...