[FFmpeg-devel] [PATCH] avformat: Add image3 demuxers with format autodetection

Michael Niedermayer michaelni at gmx.at
Wed Jul 2 00:53:02 CEST 2014


On Tue, Jul 01, 2014 at 10:04:35PM +0000, Carl Eugen Hoyos wrote:
> Michael Niedermayer <michaelni <at> gmx.at> writes:
> 
> > +IMAGEAUTO_DEMUXER(exr,     AV_CODEC_ID_EXR)
> > +IMAGEAUTO_DEMUXER(pictor,  AV_CODEC_ID_PICTOR)
> > +IMAGEAUTO_DEMUXER(sgi,     AV_CODEC_ID_SGI)
> > +IMAGEAUTO_DEMUXER(sunrast, AV_CODEC_ID_SUNRAST)
> > +IMAGEAUTO_DEMUXER(tiff,    AV_CODEC_ID_TIFF)
> 
> Sorry for not realizing this earlier:
> I don't think these can work, how did you test them?

something like this should help
but ultimately, imagepipes do need parsers, otherwise they work just
with the first image

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 6fa6157..ae65b63 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -415,6 +415,8 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
             return AVERROR(EIO);
         if (s->frame_size > 0) {
             size[0] = s->frame_size;
+        } else if (!s1->streams[0]->parser) {
+            size[0] = avio_size(s1->pb);
         } else {
             size[0] = 4096;
         }


> 
> Carl Eugen
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- 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/20140702/e651b80e/attachment.asc>


More information about the ffmpeg-devel mailing list