[FFmpeg-user] Probing jpg, png and tiff images without decoding frames
Robert Krüger
krueger at lesspain.de
Wed Aug 7 15:56:01 CEST 2013
On Wed, Aug 7, 2013 at 2:17 PM, Paul B Mahol <onemda at gmail.com> wrote:
> On 8/6/13, Robert Krueger <krueger at lesspain.de> wrote:
>> On Tue, Aug 6, 2013 at 1:23 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
>>> Robert Krueger <krueger <at> lesspain.de> writes:
>>>
>>>> it seems the ffmpeg always decodes the listed
>>>> types of images to determine their properties.
>>>
>>> In your email's subject, you used the term "probing"
>>> which is defined for FFmpeg / libavformat.
>>> For all listed image formats, FFmpeg does no probing,
>>> it guesses the format reading the file suffix.
>>> (Something FFmpeg does not do for nearly all formats
>>> it supports.)
>>>
>>>> What I did to check this, was to run
>>>> ffmpeg -i <imagefile> as well as
>>>> ffprobe -show_streams <imagefile> with each of
>>>> these formats and set a breakpoint in
>>>> avcodec_decode_video2.
>>>
>>> I don't think it is generally possible to find out
>>> properties of image files (that is apparently what
>>> you need) without calling this function.
>>
>> apparently my writing is too imprecise. So let me try another time to
>> avoid misunderstandings.
>>
>> So are you saying that for the given file formats it is technically
>> not possible to find out resolution and pixel format without decoding
>> an entire frame or that it is currently not possible with
>> ffmpeg/libavformat/libavcodec?
>
> Yes, it is currently not possible, but I guess one could hack something
> which will just add some private option to interested decoder(s) to just fetch
> headers - without actual uncompressing of frames.
>
> One could also write raw image demuxers in lavf which would just do that,
> which would need bigger changes in img2 (de)muxer.
Thank you for that information!
More information about the ffmpeg-user
mailing list