[FFmpeg-devel] [PATCH] Description of avcodec_encode_audio()

John Fletcher john.fletcher
Fri Apr 3 11:05:52 CEST 2009


Michael,

You really seem to be missing my point here.  Let me give you an example.

I wish to encode 1920 samples of audio to a 16-bit PCM format, say for example using CODEC_ID_PCM_S16BE.

I need to set the size of the output buffer, buf_size, to 1920 * 2 = 3840 to achieve that.

But that is less than FF_MIN_BUFFER_SIZE so I am in conflict with the instructions for the function.

And furthermore, according to the instruction the number of samples read from input would be:
  buf_size * input_sample_size / output_sample_size
= buf_size
= 3840 (wrong, it is 1920 samples)


John


 
> if you provide less than FF_MIN_BUFFER_SIZE and the code ends 
> up needing
> more than behavior is undefined (that is your computer can 
> join the closest
> botnet)
> if you provide more or equal than FF_MIN_BUFFER_SIZE and the 
> code ends up
> needing more than you get a clear failure
> 
> you can never just use FF_MIN_BUFFER_SIZE, as this will in 
> general be too
> small.
> 
> [...]
> -- 
> Michael     GnuPG fingerprint: 
> 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> If you really think that XML is the answer, then you 
> definitly missunderstood
> the question -- Attila Kinali
> 




More information about the ffmpeg-devel mailing list