Okay, I've been clocking my calls to avcodec_encode_audio and the
results I'm getting are very counterintuitive... bizarre in fact. It's
taking me anywhere between 150 ms to 500 ms to encode 1 2048 byte
frame (1024 samples). That's ridiculously long. Is there something
wrong with the way I initialize my codec context?

CodecContext initialization:

// Set Audio Codec Context Params
audCodecContext = actualAudStream->codec;
avcodec_get_context_defaults(audCodecContext);
                
audCodecContext->codec_id               = CODEC_ID_AAC;
audCodecContext->codec_type             = CODEC_TYPE_AUDIO;
audCodecContext->codec_tag              =
av_codec_get_tag(actualContext->oformat->codec_tag,
GLOBAL_AUD_CODEC_ID);
                
audCodecContext->sample_fmt             = SAMPLE_FMT_S16;
audCodecContext->sample_rate    = 44100;
audCodecContext->channels               = 1;
audCodecContext->profile                = FF_PROFILE_AAC_LOW;
audCodecContext->time_base              = (AVRational){1, 
audCodecContext->sample_rate};
audCodecContext->block_align    = 0;

On Wed, Mar 9, 2011 at 2:43 PM, michael chua <[email protected]> wrote:
> I'm encoding a live stream, and my encoder thread is having trouble
> keeping up with the audio source. My buffer keeps overlfowing. Is it
> possible for me to bulk encode 100 frames with 1 call instead of
> making 100 calls to avcodec_encode_audio? If not, what other
> strategies can I try to speed up encoding?
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to