Hello, there is comment from our expert:
Yes, you are right, size of AAC audio frame is equal to 1024 samples per channel (2048 bytes), size of MP3 frame - 1152 samples per channel (2304 bytes). It means that every call GetFrame of encoder encodes exactly frame_size * num_channels samples of input data. This size doesn't depend on sample frequency. As you can see, in your case AAC can encode 46.875 audio frames per second (48000/1024), MP3 ~ 41.6667. These numbers don't equal to video frame rate (25 frames per second). It means, that you should encode audio and video streams independently and use time stamps for further synchronization.
PS. You wrote "The size of the buffer is 3840 bytes for each frame, i.e. 1920 per channel ( = 48000Hz / 25 frames in PAL)." I think that you wanted to write "The size of the buffer is 3840 * 2 bytes for each frame, i.e. 1920 * 2 per channel ( = 48000Hz * (16 bit/ 8 bit) / 25 frames in PAL)."