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

Peter Ross pross at xvid.org
Sat Mar 28 00:04:27 CET 2015

On Fri, Mar 27, 2015 at 02:55:37PM +0100, Lukasz Marek wrote:
> 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.

most zip implementations seek to the table located at the end of the file,
although this can be avoided by scanning and jumping over each compressed

The uri syntax needs to support nesting of the protocols.
If ':' were used, the uri parser would need to chomp from the beginning
and end of the uri string. However this could easily be confused

>>>>>>> [----------------------------------] <<<<<<<<<< OK

>>>>>>> [------------------] <<<<<<<<<<<<<<< BAD

> >if libzip cant be used, is there something else that can be used ?
> >or can libzip be extended to not have this limitation ?


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

Did a cursory search before selecting libzip... had hoped to find a general purpose
library for reading popular archive formats. Alas, none seem to exist.

The closest thing is 7-zip, but there is no 'library' interface and it is C++.
Curiously the authors have logically seperated archive file format handling from the
stream compression algrorithms (deflate, bzip2, etc), in much the same FFmpeg has
seperated avformat from avcodec.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150328/b4fbfc38/attachment.asc>

More information about the ffmpeg-devel mailing list