[FFmpeg-user] Audio encoding problem
nicolas.george at normalesup.org
Fri Aug 23 14:01:28 CEST 2013
Le sextidi 6 fructidor, an CCXXI, Mustafa Yavuz a écrit :
> I would like to encode decoded frames in signed 16 bit little endian
You forgot to specify: PCM.
> Code is here <http://codepaste.net/rgqpc9>
# enc_ctx->sample_fmt = AV_SAMPLE_FMT_S16;
# enc_ctx->bit_rate = 64000;
# enc_ctx->sample_rate = 11025;
# enc_ctx->channel_layout = AV_CH_LAYOUT_MONO ;
# enc_ctx->channels = 1;
You got the wrong idea that this is asking the PCM encoder to encode at a
specific sample rate and with a specific channel count. It does not work
that way. You are saying to the encoder what you are giving it as input.
Since you are actually giving it something completely different, it does not
work at all.
You have to convert and remix the audio stream. For that, you can use
libswresample directly or libavfilter.
By the way, you will never achieve 64000 bit/s with these settings, your
bit_rate field is completely wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-user