Opened 3 months ago

Last modified 3 months ago

#10822 new defect

av_stream_find_info fails for aac file if aac decoder is not enabled

Reported by: gamlegaz Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords: demuxer Audio
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

If aac demuxing doesn't work without enabling an aac decoder please feel free to close this!

Building FFmpeg at tot (0a5813fc6814bba2326e4f172151b2ca1f24a830) with
--disable-decoders or --disable-decoder=aac and trying to demux doesn't work.

avformat_find_stream_info on the AVFormatContext yields

[aac @ 0x134204a10] Could not find codec parameters for stream 0 (Audio: aac, 0 channels): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options

Changing the analyzeduration and probesize to (way) larger values doesn't help, I've also tried a few different aac files.

Compiling with the aac decoder enabled this works fine.

I build using

ffmpeg: 
	cd ../dependencies/ffmpeg && \
	git reset --hard && make -k clean && \
	./configure \
		--prefix="$(BUILD_PATH)" \
		$(FFMPEG_COMMON_ARGS) \
		--disable-all \
		--enable-avcodec \
		--enable-avformat \
		--enable-avutil \
		--disable-decoders \
		--disable-demuxers \
		--disable-encoders \
		--disable-muxers \
		--disable-iconv \
		--disable-zlib \
		--enable-protocol=file \
		--enable-demuxer=aac \
		&& \
	make -j8 && \
	make install

and with the minimal reproduction:

#include <libavformat/avformat.h>
#include <libavutil/opt.h>

int main()
{
    int ret = 0;
    AVFormatContext *fmt_ctx = avformat_alloc_context();
    if (!fmt_ctx)
    {
        printf("Failed to allocate fmt_ctx\n");
        return 1;
    }
    const char *filename = "file:home_short.aac";
    ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL);
    if (ret < 0) {
        printf("Failed to open input %s\n", av_err2str(ret));
        return 1;
    }

    ret = avformat_find_stream_info(fmt_ctx, NULL);
    if (ret < 0) {
        printf("Failed to find stream information: %s\n", av_err2str(ret));
        return 1;
    }

    int audio_stream_idx = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0);
    printf("File read, audio stream: %d %s\n", audio_stream_idx, av_err2str(audio_stream_idx));
    return 0;
}

mediainfo for sample audio;

Complete name                            : videos/sample4.aac
Format                                   : ADTS
Format/Info                              : Audio Data Transport Stream
File size                                : 3.87 MiB
Overall bit rate mode                    : Variable

Audio
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Format version                           : Version 4
Codec ID                                 : 2
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 3.87 MiB (100%)

Attachments (1)

aac_demuxer_without_decoder_bug.aac (50.9 KB ) - added by gamlegaz 3 months ago.
sample aac file to test aac demuxer not working without an aac decoder enabled

Download all attachments as: .zip

Change History (2)

by gamlegaz, 3 months ago

sample aac file to test aac demuxer not working without an aac decoder enabled

comment:1 by gamlegaz, 3 months ago

I noticed the attached file doesn't match the mediainfo, sorry. Though both files produce the same problem

Note: See TracTickets for help on using tickets.