Hi all,
    I have a flv file with only sound.  And the format id is
NELLYMOSER_8HZ_MONO.
    I want to convert it to mp3 or alaw or mulaw.
    However, the output file is not correct. The sound is anamorphic.

   Here is the main part of my program. And it works well if used to convert
mp3 to mp3.
   Could anyone please tell me what is wrong?
   Thanks a lot.


        acodecxt_dst->codec_id = CODEC_ID_MP3;
        acodecxt_dst->codec_type = CODEC_TYPE_AUDIO;
        acodecxt_dst->bit_rate = 224000;
        acodecxt_dst->sample_rate = acodecxt_src->sample_rate;

        acodecxt_dst->channels = acodecxt_src->channels;

while(av_read_frame(pfmtcxt_src, &packet)>=0){
         data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
         ret = avcodec_decode_audio2(acodecxt_src, samples, &data_size,
                                           packet.data,, packet.size);
         if(ret<0 || data_size<=0) continue;

                avcodec_encode_audio(enc, audio_out,data_size, samples);
                //and then set and write the new packet

}

yours, zhumy
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to