[Ffmpeg-devel] The question is: how to open the AMR_NB-Codec? (original) (raw)

Lars Blumberg Lars.Blumberg
Fri Feb 17 12:55:40 CET 2006


How do I have to initialize the codec with codec id CODEC_ID_AMR_NB ?

I use the output_example.c :

/*

}

To open the audio stream the following instructions are used:

void open_audio(AVFormatContext *oc, AVStream *st) { AVCodecContext *c; AVCodec *codec;

c = st->codec;

/* find the audio encoder */
codec = avcodec_find_encoder(c->codec_id);
if (!codec) {
    fprintf(stderr, "codec not found\n");
    exit(1);
}

NOW the codec cannot be opened >>>>>>

/* open it */
if (avcodec_open(c, codec) < 0) {
    fprintf(stderr, "could not open codec\n");
    exit(1);
}

... }

Is there any initialization missing for the AMR_NB codec to open it?

Thanks in advance for any help

Lars

"Lars Blumberg" <Lars.Blumberg at aquasoft.de> schrieb im Newsbeitrag news:dt2pu0$2n7$1 at sea.gmane.org...

Hello!

Has anyone tried the outputexample.exe with a 3gp-filename? I therefore included the AMR NB audio codec, described at http://www.allaboutsymbian.com/archive/t-22589 I am able to convert video files to 3gp file with ffmpeg.exe (with sound), but I can not generate a 3gp output example with "outputexample.exe test.3gp". The message is, that the audio codec cannot be opened. I also tried different bit rates and sample rates in outputexample.c but the error message is still the same. Thanks for any help in advance! Lars



More information about the ffmpeg-devel mailing list