zlib deflate (compress) function with vlc_object?

Discuss your Lua playlist, album art and interface scripts.
exebetche
Blank Cone
Blank Cone
Posts: 12
Joined: 04 Mar 2012 05:32

zlib deflate (compress) function with vlc_object?

Postby exebetche » 05 Mar 2012 19:25

Hi,

I noticed that vlc use the zlib library. Is that a method to gzip compress data with zlib through vlc_object in LUA scripis?
If not what would be the most portable way to achieve that in a script?

I intend to use this function for the extension VLsub.

Many thanks,
Last edited by exebetche on 09 Mar 2012 18:51, edited 3 times in total.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: zlib deflate (compress) function with vl_bject?

Postby Jean-Baptiste Kempf » 07 Mar 2012 18:32

Why do you need that?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

exebetche
Blank Cone
Blank Cone
Posts: 12
Joined: 04 Mar 2012 05:32

Re: zlib deflate (compress) function with vl_bject?

Postby exebetche » 08 Mar 2012 14:26

I'd like to offer the possibility to upload data to a website. The website require the data to be gzipped + base64 encoded. Base64 encode is easy with LUA. For the deflate algorithm, I could use a library like "lua-zlib" but I'd rather not because that means compile it under each OS (it seems LUA doesn't provide a way to directly use C-based .so/.dll).
So if by chance there's a way to do this with vlc out of the box that would be really great.

Thanks,
Last edited by exebetche on 08 Mar 2012 15:23, edited 1 time in total.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: zlib deflate (compress) function with vl_bject?

Postby Jean-Baptiste Kempf » 08 Mar 2012 15:03

Weird website.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

exebetche
Blank Cone
Blank Cone
Posts: 12
Joined: 04 Mar 2012 05:32

Re: zlib deflate (compress) function with vl_bject?

Postby exebetche » 08 Mar 2012 15:22

Well, it use XML-RPC protocol so binary/zipped data needs to be base64-encoded. And gzip encoding is used to speed up data transfer. It seems this format is pretty common with this protocol.

exebetche
Blank Cone
Blank Cone
Posts: 12
Joined: 04 Mar 2012 05:32

Re: zlib deflate (compress) function with vl_bject?

Postby exebetche » 08 Mar 2012 19:47

And beyond the weirdness, any idea to gzip data in LUA, pretty please, anybody?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: zlib deflate (compress) function with vlc_object?

Postby Jean-Baptiste Kempf » 09 Mar 2012 17:48

we need to export the function.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

exebetche
Blank Cone
Blank Cone
Posts: 12
Joined: 04 Mar 2012 05:32

Re: zlib deflate (compress) function with vlc_object?

Postby exebetche » 09 Mar 2012 18:06

That's would be nice!

I took a quick look at the code, the function does exist here:
https://www.videolan.org/developers/vlc ... ip/ioapi.c

Somethind else; I suppose it would not be possible to do something like this:
os.execute("cvlc -vvv file:////home/vlc/dummy_file.txt --sout #std{access=file,mux=zip,dts=OUTPUT}'")

I know this doesn't work, but I mean use Vlc from command line through LUA with the dummy interface to zip the stream. It might do the trick until a later release with a proper stream function.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 12 guests