[Libav-user] Why (c->frame_size = 0) ?

Haridas Sagar N haridassagarn at tataelxsi.co.in
Tue Feb 26 05:38:29 CET 2013


> codec = avcodec_find_encoder(AV_CODEC_ID_PCM_S16LE);
" AV_CODEC_ID_PCM_S16LE" is not the codec id it is just the sample format do you have to use AV_CODEC_ID_MP2 i guess...

and can i know what exactly you are working on decoding_encoding.c example

Regards

Haridas Sagar N
________________________________________
From: libav-user-bounces at ffmpeg.org [libav-user-bounces at ffmpeg.org] on behalf of Paul B Mahol [onemda at gmail.com]
Sent: Tuesday, February 26, 2013 12:23 AM
To: This list is about using libavcodec, libavformat, libavutil,        libavdevice and libavfilter.
Subject: Re: [Libav-user] Why (c->frame_size = 0) ?

On 2/25/13, Joe Flowers <joe.flowers at nofreewill.com> wrote:
> In the decoding_encoding.c file, I have changed
>
>
> codec = avcodec_find_encoder(AV_CODEC_ID_MP2);
> to
> codec = avcodec_find_encoder(AV_CODEC_ID_PCM_S16LE);
>
>
> but now I get
>
>
> "Could not allocate -22 bytes for samples buffer"
>
> back from
>
> buffer_size = av_samples_get_buffer_size(NULL, c->channels,
> c->frame_size, c->sample_fmt, 0);
>
>
> Anyone know how I can fix this problem?

Without exact source code? Unlikely.

>
> Thanks!
>
> Joe
>
> ----------------------------------------------------
> //For AV_CODEC_ID_PCM_S16LE:
> //c->channels = (2).
> //c->frame_size = (0).

looks wrong.

> //c->sample_fmt = (1).

looks wrong.

>
> //For AV_CODEC_ID_MP2:
> //c->channels = (2).
> //c->frame_size = (1152).
> //c->sample_fmt = (1).

looks wrong.

> -----------------------------------------------------
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
_______________________________________________
Libav-user mailing list
Libav-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user

Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you




More information about the Libav-user mailing list