On Tue, Aug 4, 2009 at 3:24 PM, Shujaat <[email protected]> wrote:
> hello all
> I read an an audio frame from mp3, decode it, resample it and then encode
> it using lame and add that packet to audio stream of an mp4 file, in which
> there is a video stream too.
>
> But the problem is that when I compile this file and then play it the video
> plays well but the audio speed is too slow and some what distroted, i mean
> there is some noise and cracks too. I increased the bit rat, sample rate etc
> but it didnt work.
>
> Anybody Please.
>
>
> Regards,
> Shujaat
>
Following are my codec settings :
AVCodecContext *c;
AVStream *st;
st = av_new_stream(oc, 1);
if (!st)
{
fprintf(stderr, "\nCould not alloc stream\n");
exit(1);
}
c = st->codec;
c->codec_id = CODEC_ID_MP3;
c->codec_type = CODEC_TYPE_AUDIO;
c->bit_rate = 128000;
c->sample_rate = 44100;
c->channels = 2;
c->time_base.num = 1;
c->time_base.den = c->sample_rate;
c->rc_buffer_size = AUDIO_BUF_SIZE;
I initalize the resample context as :
audio_rasample_init(output channels, input channels, output sample rate,
input sample rate);
But the resulting audio is too slow in terms of speed. and there are cracks
and noise.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user