Page 1 of 1
zlib deflate (compress) function with vlc_object?
Posted: 05 Mar 2012 19:25
by exebetche
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,
Re: zlib deflate (compress) function with vl_bject?
Posted: 07 Mar 2012 18:32
by Jean-Baptiste Kempf
Why do you need that?
Re: zlib deflate (compress) function with vl_bject?
Posted: 08 Mar 2012 14:26
by exebetche
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,
Re: zlib deflate (compress) function with vl_bject?
Posted: 08 Mar 2012 15:03
by Jean-Baptiste Kempf
Weird website.
Re: zlib deflate (compress) function with vl_bject?
Posted: 08 Mar 2012 15:22
by exebetche
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.
Re: zlib deflate (compress) function with vl_bject?
Posted: 08 Mar 2012 19:47
by exebetche
And beyond the weirdness, any idea to gzip data in LUA, pretty please, anybody?
Re: zlib deflate (compress) function with vlc_object?
Posted: 09 Mar 2012 17:48
by Jean-Baptiste Kempf
we need to export the function.
Re: zlib deflate (compress) function with vlc_object?
Posted: 09 Mar 2012 18:06
by exebetche
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.