[FFmpeg-devel] [PATCH] avformat/img2: add ff_guess_image2_codec2()

wm4 nfxjfg at googlemail.com
Thu Mar 27 19:30:32 CET 2014


On Thu, 27 Mar 2014 19:06:07 +0100
Michael Niedermayer <michaelni at gmx.at> wrote:

> On Thu, Mar 27, 2014 at 01:08:55PM +0100, wm4 wrote:
> > On Thu, 27 Mar 2014 03:44:41 +0100
> > Michael Niedermayer <michaelni at gmx.at> wrote:
> > 
> > > Fixes brender detection
> > > If more input formats need this, then the code should be moved into some
> > > probe_codec() in each AVCodec or some img2 specific system of per codec
> > > probe functions inside img2.
> > > But this seems overkill for just 1 format needing it.
> > 
> > Uh what? Proper detection of image file formats instead of by file
> > extension is something libavformat always needed. You are adding a hack
> > to a hack.
> 
> yes, that hack on a hack fixes a regression though.
> try decoding brender with HEAD and ffmpeg 2.2
> 
> do you suggest that we should drop this hack on a hack patch and
> design a proper probing API ?
> 
> in that case what exact API do you suggest ?
> 
> i could add a probe function to AVCodec and a
> int(score) avcodec_probe(AVCodecProbeData *p)
> AVCodecProbeData *avcodec_alloc_probedata(void)
> 
> and then use that from ff_guess_image2_codec2()

Why not add demuxers for each image format? It could work like all
those raw codecs. Then the image pseudo-demuxer could use the
libavformat API properly.

Not sure if this works out...


More information about the ffmpeg-devel mailing list