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

Lukasz Marek lukasz.m.luki2 at gmail.com
Thu Apr 2 00:25:52 CEST 2015


On 01.04.2015 21:22, Alexander Strasser wrote:
> On 2015-03-28 23:30 +0100, Lukasz Marek wrote:
>> W dniu sobota, 28 marca 2015 Peter Ross <pross at xvid.org> napisał(a):

>    What about the following?
>
>    ffplay zip://dir/a.zip/m.mkv  # open dir/a.zip, read file m.mkv inside
>    ffplay -file m.mkv zip://dir/a.zip  # same effect as above
>    ffplay zip://dir.zip/a.ass/m.txt # open dir.zip, read file a.ass/m.txt inside
>    ffplay -file m.txt zip://dir.zip/a.ass # open dir.zip/a.ass, read file m.txt inside
>
>    Patch that implements that on top of Lukasz's patch is attached.
> Beware it is quickly implemented and only lightly tested, just to
> show that it is possible to implement that behaviour. Do not expect
> it to be beautiful and flawless.
>
>    Also I didn't even attempt to work out details like option name and if
> we should match first or last .zip occurrence when guessing.

I've attached another implementation based on libarchive. It is also 
just demo patch, not something that is ready to be merged.

I skipped totally the problem with selecting internal file. I just open 
the first available.

Libarchive allows:
1. Using protocols, so archive can be on remote host, tested via ftp and 
sftp (didn't check extracting from inner archive)
2. It provides archive_seek_data which seems to allow make this protocol 
seekable, but it is not working for me. Official documentation doesn't 
mention this function. Doxy in header is not much more helpful.

Libarchive does not allows:
1. Decompress encrypted archives (there is a ticket for that)
2. I cannot decompress rar archives (still better than libzip)

It still needs some tests and possibly digging in libarchive code.
Some contact with them may resolve some doubts.

Regarding selecting inner file, IMHO additional parameter and guessing 
by extension is the best choice until protocols support stat operation 
in efficient way. Of course assuming it should use protocols.

I will not work on this withing next week at least so if someone wants 
to continue then go ahead, just let me know please, so we don't 
duplicate the work again.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavf-add-zip-protocol.patch
Type: text/x-patch
Size: 8696 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150402/827a503f/attachment.bin>


More information about the ffmpeg-devel mailing list