[Libav-user] avcodec_decode_audio4 yields silence (zero data)
misha.penkov at gmail.com
Fri Jun 15 14:18:35 CEST 2012
I've solved my problem. I wasn't updating the packet correctly in
between calls to decode. Please disregard my previous message.
On 15 June 2012 20:50, Misha Penkov <misha.penkov at gmail.com> wrote:
> I'm playing around with the FFmpeg tutorials at
> (http://dranger.com/ffmpeg/) and trying to update them to the most
> recent version of FFmpeg. I'm having problems decoding audio. In
> particular, the entire data array of the AVFrame I pass in is zero
> after decoding.
> Here's the code around the problem area:
> int bytes_consumed;
> int got_frame;
> bytes_consumed =
> if (got_frame)
> int bytes_decoded =
> int sum = 0;
> int i = 0;
> for (i = i; i < bytes_decoded; ++i)
> sum += abs(frame->data[i]);
> fprintf(stderr, "sum: %d\n", sum);
> return bytes_decoded;
> The whole data array sums to zero every time, and I get silence as
> output. I'm attaching my full source for reference.
> Why does this happen? What am I doing wrong?
> ffmpeg version N-41103-g67b7631
> built on Jun 4 2012 17:00:05 with gcc 4.4.3
> Thank you in advance for your help.
More information about the Libav-user