I\'m trying to decode AAC with FFmpeg native decoder and encountered an error
SSR is not implemeted. Update your FFmpeg version to newest from Git. If the
f = fopen(filename, "rb"); if (!f) { fprintf(stderr, "Could not open %s\n", filename); return; } outfile = fopen(outfilename, "wb"); if (!outfile) { av_free(pCodecCtx); return; } /* decode until eof */ avpkt.data = inbuf; avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f); while (avpkt.size > 0) { int i, ch; int got_frame = 0;
Yeah, that's not going to work. You can't dump raw bytes from some random muxing format (potentially mp4) into a decoder and expect it to work. Use av_read_frame() to read individual audio packets from the muxing format, and feed the resulting AVPacket into the decoder using avcodec_decode_audio4(). See e.g. the dranger api tutorial. I know api-example.c uses the above code, but that unfortunately only works for a very limited subset of cases. Also see the detailed description in the API docs.