[Libav-user] Speeding up codec detection of raw bitstream
Wiebe Cazemier
wiebe at halfgaar.net
Mon Feb 12 21:42:10 EET 2018
----- Original Message -----
> From: "Wiebe Cazemier" <wiebe at halfgaar.net>
> To: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." <libav-user at ffmpeg.org>
> Sent: Monday, 12 February, 2018 16:36:45
> Subject: Re: [Libav-user] Speeding up codec detection of raw bitstream
> ----- Original Message -----
>> From: "Carl Eugen Hoyos" <ceffmpeg at gmail.com>
>> To: "This list is about using libavcodec, libavformat, libavutil, libavdevice
>> and libavfilter." <libav-user at ffmpeg.org>
>> Sent: Monday, 12 February, 2018 14:56:02
>> Subject: Re: [Libav-user] Speeding up codec detection of raw bitstream
>>>
>>> I was able to register only AC3 by creating an AVCodec with 'AVCodec*
>>> avcodec_find_decoder (enum AVCodecID id)' and using avcodec_register
>>
>> What I meant was:
>> Did you test to only enable the needed demuxers (and decoders) at build time?
>>
>> Carl Eugen
>
> No, actually. Is there a reason to think that makes a difference?
I was able to improve matters. I did:
avFormatContext->probesize = 4096;
before calling 'avformat_open_input(&avFormatContext, NULL, NULL, NULL)'. It now detects it within quarter of a second.
There is also 'avFormatContext->max_analyze_duration', and even though that speeds up AC3 detection, it still hangs forever on DTS.
There are still a few quirks to work out when switching codec, but I think 'll manage.
More information about the Libav-user
mailing list