[Libav-user] avformat_open_input subfile protocol for reading video from ZIP

Alexandr Dudnik dj.alexshaft at gmail.com
Thu Nov 19 16:48:23 CET 2015


Hi all. I use ffmpeg libs with Unity3D game dev platform as native plugins
for ios and android, for rendering video into textures. So simply I make
animations by such strange way =)
Everything works like a charm. But, for Android platform Unity packs my
video sources into .jar archive which is simply zip archive.

I found that ffmpeg has "subfile" protocol.
I tried simple trick:
ZipFile zip = new ZipFile(Application.streamingAssetsPath + "/test.zip");
get needed ZipEntry (it's just .avi file)
and create path like :
path = "subfile,,start," + entry.Offset + ",end," + (entry.Offset +
entry.CompressedSize) + ",,:" + Application.streamingAssetsPath +
"/test.zip";
So I get this path for example:
subfile,,start,34,end,48058542,,:C:/Users/AlexShaft/Desktop/unity/Assets/StreamingAssets/test.zip
I test it on Windows so I get path like: C:/

But when I open input by avformat_open_input(&pFormatCtx, path, NULL, 0) I
just get result 1
So, maybe someone knows what am I doing wrong and what actually that result
1?

Hope on your response!
Best regards, Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20151119/6a5164c0/attachment.html>


More information about the Libav-user mailing list