[Ffmpeg-devel] Audio corruption creating .mov withavcodec_encode_audio

Ben Weekes ben.weekes
Thu Sep 7 00:59:05 CEST 2006


I believe I have solved the problem now by sorting out the Mutexes around
our av_write_frame 

Nice ~

 regards

-----Original Message-----
From: ffmpeg-devel-bounces at mplayerhq.hu
[mailto:ffmpeg-devel-bounces at mplayerhq.hu] On Behalf Of Ben Weekes
Sent: 06 September 2006 19:02
To: 'FFMpeg development discussions and patches'
Subject: [Ffmpeg-devel] Audio corruption creating .mov
withavcodec_encode_audio 

 

On occasion, when we write raw audio to a file (together with YUV using
av_write_frame) the sound becomes corrupted with a violent, jerky sound.

 

Do you know what could be causing this?

 

The audio is fine as when writing it simultaneously to a WAV file and
replaying it sounds fine

 

We are doing this to create the .mov file 

 

    pkt.size=avcodec_encode_audio(c, audio_outbuf, AUDIO_LEN,  (short *)
abuffer);

    pkt.pts= c->coded_frame->pts;

    pkt.flags |= PKT_FLAG_KEY;

    pkt.stream_index= st->index;

    pkt.data= audio_outbuf;

 

    PWaitAndSignal mutex(write_audio_mutex);

    if (av_write_frame(oc, &pkt) != 0) {

        p.Logger("write_audio_frame Error while writing audio frame");

        exit(1);

    }

 

 

 

Any help greatly appreciated

 

Ben

 

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel





More information about the ffmpeg-devel mailing list