I solved the above problem. The values of sample rate and bit rate had to be set properly.
On Thu, Dec 19, 2013 at 2:28 PM, ವಿನೋದ್ Vinod H I <[email protected]>wrote: > Hi, > I have written a c++ code for audio transcoding.. From any given format to > any output audio format.. > I have trouble creating a ".mka" file with vorbis codec. > > In my code after adding a stream , I am setting the following fields for > codec context. (AVCodecContext * enc_ctx) > > enc_ctx -> codec_id = codec_id; > enc_ctx -> codec_type = AVMEDIA_TYPE_AUDIO; > enc_ctx -> bit_rate = 128000; > enc_ctx -> sample_rate = 22050; > enc_ctx -> sample_fmt = AV_SAMPLE_FMT_FLTP; > enc_ctx -> channels = 1; > enc_ctx -> channel_layout = > av_get_default_channel_layout(enc_ctx -> channels); > enc_ctx -> global_quality = 6; > enc_ctx -> rc_min_rate = 64000; > enc_ctx -> rc_max_rate = 128000 * 1.5; > > However when I call avcodec_open2(), it gives the following error. > > [libvorbis @ 0x14c7100] encoder setup failed > > This code is working fine for .wav .aac and .ogg(with FLAC) formats. > Can someone tell what more I have to do for vorbis? > > The full code is at > http://stackoverflow.com/questions/20439640/ffmpeg-audio-transcoding-using-libav-libraries. > > > > -- > Vinod > > -- Vinod H I
_______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
