LUA interface problem

Discuss your Lua playlist, album art and interface scripts.
johney_red
New Cone
New Cone
Posts: 6
Joined: 26 Aug 2010 16:37

LUA interface problem

Postby johney_red » 26 Aug 2010 17:22

Hi everyone,
I try to make my test1.lua script, which I call from shell, but it doesn't work. I first rise VLC through shell from python script:

Code: Select all

... // Only start VLC p = subprocess.Popen([path_to_VLC,"--fullscreen","--one-instance","-v","--verbose=2"]) // - work //and then put some video to playlist p = subprocess.Popen([path_to_VLC,"--fullscreen","--started-from-file","--playlist-enqueue","D:/Filmovi/a.avi" ]) // - work //at last, I want to control video with my lua script, but next line doesn't produce any output, no video, no error... nothing p = subprocess.Popen([path_to_VLC,"-I","lua","--lua-intf","test1","--lua-config","test1={command='plp'}"]) // - doesn't work ....
test1.lua:

Code: Select all

comm = config.command if comm == "plp" then playlist.play() --try this way vlc.playlist.play() --try this way end
Every proposition is welcome :) , Best Regards

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

Re: LUA interface problem

Postby ivoire » 27 Aug 2010 12:56

The script must be in the share/lua/intf/ directory to be taken into account.
Looking at the vlc logs can help you too.

johney_red
New Cone
New Cone
Posts: 6
Joined: 26 Aug 2010 16:37

Re: LUA interface problem

Postby johney_red » 27 Aug 2010 20:28

Hello Ivorie :)
Thank you for your time to get involved. My lua script is on "C:\VLC\vlc-1.1.1-win32\vlc-1.1.1\lua\intf\test1.lua" path, and I have setup log into "C:\VLC\vlc-1.1.1-win32\vlc-1.1.1\lvlc-log.txt" file as text, but i do not get any log into it. For now, when I start VLC i turn on Messages window (Ctrl+M) with verbosity level 2,and I do get main debug output when I edit playlist form shell, but line with call to lua doesn't produce any output, and that is problem. I dont know if VLC see script, or the script is fault..

This all I get in Messages window:

Code: Select all

main debug: adding item `Filmovi/a.avi' ( file:///D:/Filmovi%2Fa.avi ) main debug: rebuilding array of current - root Playlist main debug: rebuild done - 1 items, index -1 main debug: Creating an input for 'Filmovi/a.avi' main debug: no fetch required for (null) (art currently (null)) main debug: adding item `Filmovi/For_The_Birds.avi' ( file:///D:/Filmovi%2FFor_The_Birds.avi ) main debug: Creating an input for 'Filmovi/For_The_Birds.avi' main debug: rebuilding array of current - root Playlist main debug: rebuild done - 2 items, index -1 main debug: no fetch required for (null) (art currently (null)) main debug: adding item `Filmovi/The_Chubbchubbs!.avi' ( file:///D:/Filmovi%2FThe_Chubbchubbs%21.avi ) main debug: rebuilding array of current - root Playlist main debug: rebuild done - 3 items, index -1 main debug: Creating an input for 'Filmovi/The_Chubbchubbs!.avi' main debug: adding item `Filmovi/b.avi' ( file:///D:/Filmovi%2Fb.avi ) main debug: no fetch required for (null) (art currently (null)) main debug: Creating an input for 'Filmovi/b.avi' main debug: no fetch required for (null) (art currently (null))
Any idea for solution?

Best Regards

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

Re: LUA interface problem

Postby ivoire » 31 Aug 2010 08:59

Could you send vlc directly from the command line ? This way you might see the debug output. vlc -I lua --lua-intf test1 --extraintf logger

johney_red
New Cone
New Cone
Posts: 6
Joined: 26 Aug 2010 16:37

Re: LUA interface problem

Postby johney_red » 31 Aug 2010 23:09

Hmmm.. i already try to do complete process in command line with parameter '--extraintf logger' without python and guess what, no output again... yea, it is :?: strange somehow.. but I have found way to get output with python.It is interesting that there I can get output true process connection, when I call :

Code: Select all

p = subprocess.Popen([path_to_VLC,"--fullscreen","--one-instance","-vv","--verbose=2"],stdout=subprocess.PIPE,stderr=subprocess.PIPE) stdout_value , stderr_value = p.communicate('through stdin to stdout')
and output for every line of my little script:

just start VLC with empty playlist:
p = subprocess.Popen([path_to_VLC,"--fullscreen","--one-instance","-vv","--verbose=2"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
log:

Code: Select all

[00552c44] main libvlc debug: VLC media player - 1.1.1 The Luggage [00552c44] main libvlc debug: Copyright © 1996-2010 the VideoLAN team [00552c44] main libvlc debug: revision 1.1.1-0-gcbc8a0b [00552c44] main libvlc debug: configured with .././configure '--host=i586-mingw32msvc' '--build=i386-linux' '--enable-dirac' '--enable-mkv' '--enable-taglib' '--enable-release' '--enable-nls' '--disable-projectm' '--without-contrib' '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-twolame' '--enable-quicktime' '--enable-real' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-x264' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--with-live555-tree=/usr/win32/live.com' '--enable-dvdread' '--with-dvdnav-config-path=/usr/win32/bin' '--enable-shout' '--enable-goom' '--enable-caca' '--enable-portaudio' '--enable-sdl' '--with-sdl-config-path=/usr/win32/bin' '--enable-qt4' '--enable-mozilla' '--with-mozilla-sdk-path=/usr/win32/gecko-sdk' '--enable-activex' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--disable-dvb' '--disable-sqlite' '--enable-peflags' 'build_alias=i386-linux' 'host_alias=i586-mingw32msvc' 'CC=i586-mingw32msvc-gcc' 'LDFLAGS=-L/usr/win32/lib' 'CPPFLAGS=-I/usr/win32/include -I/usr/win32/include/ebml' 'CXX=i586-mingw32msvc-g++' 'PKG_CONFIG_LIBDIR=/usr/win32/lib/pkgconfig' [00552c44] main libvlc debug: translation test: code is "C" [00552c44] main libvlc debug: opening config file (C:\Users\Johney\AppData\Roaming\vlc\vlcrc) [00552c44] main libvlc debug: loading config for module "main" [00552c44] main libvlc debug: checking plugin modules [00552c44] main libvlc debug: loading plugins cache file D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\plugins\plugins-04041e-3e8.dat [00552c44] main libvlc debug: recursively browsing `D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\plugins' [00552c44] main libvlc debug: saving plugins cache D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\plugins\plugins-04041e-3e8.dat [00552c44] main libvlc debug: module bank initialized (369 modules) [00552c44] main libvlc debug: opening config file (C:\Users\Johney\AppData\Roaming\vlc\vlcrc) [00552c44] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 FPU [00552c44] main libvlc debug: looking for memcpy module: 4 candidates [00552c44] main libvlc debug: using memcpy module "memcpymmxext" [01b533b4] main input debug: Creating an input for 'Media Library' [01b533b4] main input debug: Input is a meta file: disabling unneeded options [01b533b4] main input debug: using timeshift granularity of 50 MiB [01b533b4] main input debug: using timeshift path 'C:\Users\Johney\AppData\Local\Temp' [01b533b4] main input debug: `file/xspf-open:///C:/Users/Johney/AppData/Roaming/vlc/ml.xspf' gives access `file' demux `xspf-open' path `C:\Users\Johney\AppData\Roaming\vlc\ml.xspf' [01b533b4] main input debug: creating demux: access='file' demux='xspf-open' path='C:\Users\Johney\AppData\Roaming\vlc\ml.xspf' [01b711e4] main demux debug: looking for access_demux module: 2 candidates [01b711e4] main demux debug: no access_demux module matching "file" could be loaded [01b711e4] main demux debug: TIMER module_need() : 47.000 ms - Total 47.000 ms / 1 intvls (Avg 47.000 ms) [01b533b4] main input debug: creating access 'file' path='C:\Users\Johney\AppData\Roaming\vlc\ml.xspf' [01b91edc] main access debug: looking for access module: 2 candidates [01b91edc] filesystem access debug: opening file `C:\Users\Johney\AppData\Roaming\vlc\ml.xspf' [01b91edc] main access debug: using access module "filesystem" [01b91edc] main access debug: TIMER module_need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) [01b711e4] main stream debug: Using AStream*Stream [01b711e4] main stream debug: pre buffering [01b711e4] main stream debug: received first data after 0 ms [01b711e4] main stream debug: pre-buffering done 304 bytes in 0s - 296875 KiB/s [01b93de4] main stream debug: looking for stream_filter module: 2 candidates [01b93de4] main stream debug: no stream_filter module matching "any" could be loaded [01b93de4] main stream debug: TIMER module_need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) [01b93de4] main stream debug: looking for stream_filter module: 1 candidate [01b93de4] main stream debug: using stream_filter module "stream_filter_record" [01b93de4] main stream debug: TIMER module_need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) [01b533b4] main input debug: creating demux: access='file' demux='xspf-open' path='C:\Users\Johney\AppData\Roaming\vlc\ml.xspf' [01b93e9c] main demux debug: looking for demux module: 1 candidate [01b93e9c] playlist demux debug: using XSPF playlist reader [01b93e9c] main demux debug: using demux module "playlist" [01b93e9c] main demux debug: TIMER module_need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) [01b6c57c] main demux meta debug: looking for meta reader module: 2 candidates [01b6c57c] lua demux meta debug: Trying Lua scripts in C:\Users\Johney\AppData\Roaming\vlc\lua\meta\reader [01b6c57c] lua demux meta debug: Trying Lua scripts in D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\lua\meta\reader [01b6c57c] lua demux meta debug: Trying Lua playlist script D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\lua\meta\reader\filename.lua [01b6c57c] main demux meta debug: no meta reader module matching "any" could be loaded [01b6c57c] main demux meta debug: TIMER module_need() : 8.000 ms - Total 8.000 ms / 1 intvls (Avg 8.000 ms) [01b533b4] main input debug: `file/xspf-open:///C:/Users/Johney/AppData/Roaming/vlc/ml.xspf' successfully opened [01b22a44] main xml debug: looking for xml module: 2 candidates [01b22a44] main xml debug: using xml module "xml" [01b22a44] main xml debug: TIMER module_need() : 2.000 ms - Total 2.000 ms / 1 intvls (Avg 2.000 ms) [01b93e9c] playlist demux debug: parsed 0 tracks successfully [01b22a44] main xml debug: removing module "xml" [01b533b4] main input debug: EOF reached [01b93e9c] main demux debug: removing module "playlist" [01b93de4] main stream debug: removing module "stream_filter_record" [01b91edc] main access debug: removing module "filesystem" [01b533b4] main input debug: TIMER input launching for 'Media Library' : 60.000 ms - Total 60.000 ms / 1 intvls (Avg 60.000 ms) [00552c44] main libvlc: one instance mode ENABLED [01b8edfc] main interface debug: looking for interface module: 1 candidate [01b8edfc] main interface debug: using interface module "hotkeys" [01b8edfc] main interface debug: TIMER module_need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) [01b8ef5c] main interface debug: looking for interface module: 1 candidate [01b8ef5c] main interface debug: using interface module "globalhotkeys" [01b8ef5c] main interface debug: TIMER module_need() : 4.000 ms - Total 4.000 ms / 1 intvls (Avg 4.000 ms) [00552c44] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. [01b8f00c] main interface debug: looking for interface module: 4 candidates [01acf83c] main playlist debug: Activated [01acf83c] main playlist debug: rebuilding array of current - root Playlist [01acf83c] main playlist debug: rebuild done - 0 items, index -1 [028bb2e4] main generic debug: looking for extension module: 1 candidate [028bb2e4] lua generic debug: Opening EXPERIMENTAL Lua Extension module [028bb2e4] lua generic debug: Trying Lua scripts in C:\Users\Johney\AppData\Roaming\vlc\lua\extensions [028bb2e4] lua generic debug: Trying Lua scripts in D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\lua\extensions [028bb2e4] lua generic debug: Trying Lua playlist script D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\lua\extensions\allocine-fr.lua [028bb2e4] lua generic debug: Scanning Lua script D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\lua\extensions\allocine-fr.lua [028bb2e4] lua generic debug: Script D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\lua\extensions\allocine-fr.lua has the following capability flags: 0xc [028bb2e4] lua generic debug: Trying Lua playlist script D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\lua\extensions\imdb.lua [028bb2e4] lua generic debug: Scanning Lua script D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\lua\extensions\imdb.lua [028bb2e4] lua generic debug: Script D:\Instalacije\Programi\Film_i_Video\VLC\vlc-1.1.1-win32\vlc-1.1.1\lua\extensions\imdb.lua has the following capability flags: 0x4 [028bb2e4] main generic debug: using extension module "lua" [028bb2e4] main generic debug: TIMER module_need() : 6.000 ms - Total 6.000 ms / 1 intvls (Avg 6.000 ms) [01b539a4] main probe debug: looking for services probe module: 4 candidates [01b539a4] main probe debug: no services probe module matching "any" could be loaded [01b539a4] main probe debug: TIMER module_need() : 17.000 ms - Total 17.000 ms / 1 intvls (Avg 17.000 ms) [01b8f00c] qt4 interface debug: Sorting by column -1, order 0 [01b8f00c] qt4 interface debug: Sorting by column -1, order 0 [01b8f00c] main interface debug: using interface module "qt4" [01b8f00c] main interface debug: TIMER module_need() : 567.000 ms - Total 567.000 ms / 1 intvls (Avg 567.000 ms) [00552c44] main libvlc debug: deactivating the playlist [01acf83c] main playlist debug: Deactivate [01b53874] main playlist export debug: saving Media Library to file C:\Users\Johney\AppData\Roaming\vlc\ml.xspf [01b53874] main playlist export debug: looking for playlist export module: 1 candidate [01b53874] main playlist export debug: using playlist export module "export" [01b53874] main playlist export debug: TIMER module_need() : 2.000 ms - Total 2.000 ms / 1 intvls (Avg 2.000 ms) [01b53874] main playlist export debug: removing module "export" [01acf83c] main playlist debug: Deactivated [00552c44] main libvlc debug: removing all services discovery tasks [00552c44] main libvlc debug: removing all interfaces [01b8f00c] qt4 interface debug: Killing extension dialog provider [01b8f00c] qt4 interface debug: ExtensionsDialogProvider is quitting... [028bb2e4] lua generic debug: Deactivating all loaded extensions [028bb2e4] lua generic debug: All extensions are now deactivated [028bb2e4] main generic debug: removing module "lua" [01b8f00c] qt4 interface debug: Playlist Destroyed [01b8f00c] main interface debug: removing module "qt4" [01b8ef5c] main interface debug: removing module "globalhotkeys" [01b8edfc] main interface debug: removing module "hotkeys" [01acf83c] main playlist debug: destroying [00552c44] main libvlc debug: TIMER ML Load : Total 63.000 ms / 1 intvls (Avg 63.000 ms) [00552c44] main libvlc debug: TIMER Items array build : Total 1.000 ms / 1 intvls (Avg 1.000 ms) [00552c44] main libvlc debug: TIMER ML Dump : Total 4.000 ms / 1 intvls (Avg 4.000 ms) [00552c44] main libvlc debug: removing stats [00552c44] main libvlc debug: removing module "memcpymmxext"
add some files to playlist
p = subprocess.Popen([path_to_VLC,"--fullscreen","--started-from-file","--playlist-enqueue","D:/Filmovi/a.avi" ],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
log:

Code: Select all

[00492ce4] main libvlc: one instance mode ENABLED [00492ce4] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. frame skip 8
interesting part: play form playlist
p = subprocess.Popen([path_to_VLC,"-I","--lua","--lua-intf","test1","--lua-config","test1={command='plp'}"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
log:
empty, nothing, 0 , zero, zéro... :?: <--- again !!!!

Any idea what is happening? Or we may call Chuck Norris to help us :)
Best Regards

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

Re: LUA interface problem

Postby ivoire » 01 Sep 2010 09:28

I will have to try to use a custom lua interface tonight (I can't test it here !)

johney_red
New Cone
New Cone
Posts: 6
Joined: 26 Aug 2010 16:37

Re: LUA interface problem

Postby johney_red » 09 Sep 2010 00:48

Same results with 1.1.4 version of VLC. Ivorie, do you have some idea? :?:

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

Re: LUA interface problem

Postby ivoire » 09 Sep 2010 20:54

I don't have any problem creating a custom interface and launching it with

Code: Select all

./vlc -I luaintf --lua-intf essai
The lua interface is just a small script in share/lua/intf/essai.lua which contains:

Code: Select all

vlc.msg.err("essai")

johney_red
New Cone
New Cone
Posts: 6
Joined: 26 Aug 2010 16:37

Re: LUA interface problem

Postby johney_red » 11 Sep 2010 23:06

I see that you use Linux... i test this on Win 7 and VLC get my command, but nothing happened, i test it on another one PC to, same result.. lua just do not give any response. If I put something like :

../VLC.exe -I lua --lua-intf test1 --lua-config test1={command='plp'} //bad syntax

../VLC.exe -I --lua --lua-intf test1 --lua-config test1={command='plp'} //good syntax

I do get mistake, command is not recognized... so it is some mistake in VLC when he don't response on regular command..
I have installed "LuaForWindows_v5.1.4-40" is there mistake?

Best Regards

johney_red
New Cone
New Cone
Posts: 6
Joined: 26 Aug 2010 16:37

Re: LUA interface problem

Postby johney_red » 12 Sep 2010 00:04

Nope... I m sorry for bad information, I do not get any mistake for bad command with lua interface... I'm gonna test it until I die...

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

Re: LUA interface problem

Postby ivoire » 13 Sep 2010 11:18

Just try the command line I gave you and a really simple lua file like the one I gave you. Maybe the file is just in the wrong directory.

jeanfirst
New Cone
New Cone
Posts: 2
Joined: 25 Aug 2009 17:59

Re: LUA interface problem

Postby jeanfirst » 19 Sep 2010 20:22

Don't die before you read my reply.

I tried something similar:

Code: Select all

VLC = ['/Applications/VLC.app/Contents/MacOS/VLC', '-I', 'macosx', '--extraintf=lua', '--lua-intf=rc', '--lua-config="rc={host=\'localhost:4222\'}"', '/Users/me/Desktop/image.jpg'] vlc = subprocess.Popen(VLC)
And it always gave me the *console, but not the luarc!

So I chaged it to:

Code: Select all

VLC = '/Applications/VLC.app/Contents/MacOS/VLC -I macosx --extraintf=lua --lua-intf=rc --lua-config="rc={host=\'localhost:4222\'}" /Users/me/Desktop/image.jpg' vlc = subprocess.Popen(VLC,shell=True)
Which works the way it should.

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

Re: LUA interface problem

Postby ivoire » 20 Sep 2010 13:51

I think python is doing something strange here but I don't see what can be donne the wrong way.

Could you try vlc -I lua --lua-config=... --extraintf=logger.

A file called vlc-log.txt will be created.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 20 guests