[FFmpeg-devel] [PATCH/TOY] zip files

Lukasz Marek lukasz.m.luki2 at gmail.com
Fri Mar 27 14:55:37 CET 2015


On 27.03.2015 14:16, Michael Niedermayer wrote:
> On Fri, Mar 27, 2015 at 01:51:08PM +0100, Lukasz Marek wrote:
>> On 27.03.2015 13:07, Peter Ross wrote:
>>> ---
>>> this was created to test the idea proposed in https://trac.ffmpeg.org/ticket/4374
>>> as result, i think a zip:// protocol has some problems
>>>
>>> - strict uri syntax can only open files in current directory
>>> - user shouldn't have to specify the archive format. this should be autodetected (zip, rar, ... arj)
>>> - want ability to grab zip files over other protocols 'vfs:http://subtitles.org/amovie.zip:amovie.srt'
>>> - default action to open the first inner file?
>>
>> We duplicated out work. I implemented it too, just wanted to add
>> write too and have no time recently. I submitted my version in
>> separate thread.
>>
>> Issue 1 and 4 are supported in my patch.
>> Issue 2 is not the issue, it just need to be implemented, but in
>> this case this "protocol" should be called "archive" or something.
>
>> Regarding Issue 3 this is probably not possible with libzip. It
>> allows to open archive by descriptor, so it gives possibility to get
>> http's or ftp's handle in theory (or ffmpeg could created named pipe
>> and push data from remote host into it), but I expect this need to
>> be seekable. I haven't tested yet though.
>
> if libzip cant be used, is there something else that can be used ?
> or can libzip be extended to not have this limitation ?

Just tested descriptors, I tried to open named pipe, like
mkfifo test.zip
cat data.zip > test.zip
./ffplay zip://test.zip

and libzip seg faulted :)

Reverted order
mkfifo test.zip
./ffplay zip://test.zip
cat data.zip > test.zip

postpones seg fault until cat is executed.

So this will not work.

libzip probably could be extended by open function that calls a callback 
to get data, like:
int(cb*)(size_t offset, void* buff, size_t size),
I haven't checked its sources, but they have similar API for write.
In real life it will take ages that API propagates into linux 
distributions. Someone who really needs this can always build it on its 
own tho.

I haven't researched deeply if there are other libs for handling zips.



More information about the ffmpeg-devel mailing list