我想使用ffmpeg解码从webrtc接收的音频数据并对音频进行编码并将其发送到客户端webrtc。
使用ffmpeg,我如何找到那些???
的正确参数 AVCodecContext* m_encontext=NULL;
AVCodecContext* m_decontext=NULL;
AVCodec* encoder = avcodec_find_encoder(???);
if (encoder != NULL)
{
AVCodecContext* context = avcodec_alloc_context3(encoder);
if (context != NULL)
{
context->sample_fmt = ???;
context->bit_rate = ???;
context->sample_rate = ???;
context->channels = ???;
int res = avcodec_open2(context, encoder, NULL);
if(res != 0)
m_encontext = context;
}
}
AVCodec* decoder = avcodec_find_decoder(???);
if (decoder != NULL)
{
AVCodecContext* context = avcodec_alloc_context3(decoder);
if (context != NULL)
{
context->sample_fmt = ???;
context->bit_rate = ???;
context->sample_rate = ???;
context->channels = 1;
int res = avcodec_open2(context, decoder, NULL);
if(res == 0)
m_decontext = context;
}
}