[FFmpeg-devel] [PATCH] lavf: add zip protocol

Lukasz Marek lukasz.m.luki2 at gmail.com
Fri Mar 27 16:18:59 CET 2015

On 27.03.2015 15:49, Nicolas George wrote:
> Le septidi 7 germinal, an CCXXIII, Lukasz Marek a écrit :
>> TODO: add doc, update doc/APIChanges, bump minor
> This is interesting, but the use case must be considered very carefully,
> there are tons of things that can be done with a zip file, even relevant to
> FFmpeg:
> - demux a bunch of images as a kind of image2 stream;
> - present an archive of font files as attachments (with the patch I have not
>    yet pushed to MPlayer, that means you could use them directly);
> - read several files in parallel (with split audio and video for example;
>    does the zip format allow interleaving);
> - etc.

Hi Nicolas, I missed you comment my patches :)
But, this time I dont understand you comments, could you elaborate it?
What's wrong, what can I do?

>> +    {"file_index", "set file index", OFFSET(file_index), AV_OPT_TYPE_INT, {.i64 = 0}, -1, INT_MAX, D|E },
> That is not very user-friendly.

I think you misunderstood this. There is no doc, but reading files by 
index is a fallback when user doesn't specify file explicitly. For example:

./ffplay zip://zipfile.zip/aaa.avi
will provide aaa.avi file from zipfile.zip

./ffplay zip://zipfile.zip
will provide first file (with index 0) in zip file

./ffplay -file_index n zip://zipfile.zip
will provide n + 1 (with index n) file in zip file

this might be helpful when user know there is only one file in zip 
archive. Yes, it must be documented. Probably it can be even better to 
allow provide whitelist/blacklist for filenames.

More information about the ffmpeg-devel mailing list