[FFmpeg-devel] [PATCH] cache AVPacket if loop_input on a piped stream

Peter Holik peter
Wed May 27 17:06:18 CEST 2009


Hi!

I will fetch an image from a webserver and create a video.

I do this with

#> ffmpeg -r 1 -f image2pipe -vcodec png -loop_input -i "http://server/picture.png"
          -re -f mpegts -r 25 -vcodec mpeg2video -b 4000k -an mpeg.ts

but for every png file a http request is sent.

I think this is not necessary. The picture fetched one time could be cached.

My patch caches this picture in ffmpeg.c in the input stream's AVFormatContext
and reuses it if needed.

The caching is only done if "-loop_input" and a piped input stream is used.

please comment my idea - maybe i got also the wrong position where to cache.

cu Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cache-AVPacket-if-loop_input-on-a-piped-stream.patch
Type: text/x-diff
Size: 2195 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090527/58a20dd9/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cosmetics-for-cache-AVPacket-if-loop_input-on-a-pipe.patch
Type: text/x-diff
Size: 1306 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090527/58a20dd9/attachment-0001.patch>



More information about the ffmpeg-devel mailing list