I am using LibAV for muxing real time audio and video. For this question I am referring to output.c file from LibAV examples. If I record 250 frames at 25 fps using AV_CODEC_ID_MPEG4
then the output video file will be exactly 10 seconds long. But if I use AV_CODEC_ID_H264
for 250 frames at 25 fps then the output video file will be 8.86 seconds long approximately.
I have a working code that uses PortAudio and LibAV for real time muxing. Currently I am using MPEG-4 but the quality of video is inferior to H264. If its possible I'd rather use H264.
My question is : How can I force H264 to record 10 seconds of video for 250 frames at 25 fps?
Thanks.