[Libav-user] Settings for vorbis audio
ವಿನೋದ್ Vinod H I
vinvinod at gmail.com
Thu Dec 19 09:58:29 CET 2013
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131219/e174cf02/attachment.html>
More information about the Libav-user
mailing list