I'm trying to encode an audio stream to a file. I'm receiving the audio buffers and using avcodec_fill_audio_frame
to create an AVFrame
and send it to avcodec_encode_audio2
(with some other thing in between - I`m using ffmpeg muxing.c as an example)
The thing is: The audio buffer I'm getting contains 480 samples, the codec I'm using has a frame_size
of 1152 (MP2). The result is that the output audio file is kinda "chopped". It sounds like every audio frame has some silent samples in the end.
How can I fix this? Thanks!!