user25001: I want to compose many videos from frames and mp3 files then join them together using FFMPEG.
[frames+mp3] -> [Intermediate videos] -> [Joined intermediate videos]

Using mp4 with aac introduces noticeable audio gaps between videos when I use the concat protocol.
What are the best audio and video codes to be used for the intermediate videos? can this be done in a better way?
I'm a beginner in multimedia. Thanks a lot.

user1950: Mp4 with aac audio and h.264 video (mp4 isn't a codec as such, it's a container) isn't a good intermediate format. It is lossy, and the video is generally not all I-frame (meaning that to display a frame it references previous and following frames). h.264/aac/mp4 are great for delivery because they efficiently pack a lot of perceptual quality into a small file.
You're better off using an all-i-frame codec. Notable examples are Apple ProRes, Avid DNxHD and Cineform. These are all lossy, but minimally so. You can also use a lossless codec, like FFV1, but the speed and storage this requires might make it unworkable. Similarly you're best off using PCM (uncompressed) for your audio.
I'm not sure if that is going to affect the problem of the gaps. That might be an artefact of the way the video and audio are multiplexed.

25001: <p>I want to compose many videos from frames and mp3 files then join them together using <code>FFMPEG</code>.</p>

<pre><code>[frames+mp3] -&gt; [Intermediate videos] -&gt; [Joined intermediate videos]
</code></pre>

<p>Using <code>mp4</code> with <code>aac</code> introduces noticeable audio gaps between videos when I use the <code>concat</code> protocol.</p>

<p>What are the best audio and video codes to be used for the intermediate videos? can this be done in a better way?</p>

<p>I'm a beginner in multimedia. Thanks a lot.</p>
 1950: <p>Mp4 with aac audio and h.264 video (mp4 isn't a codec as such, it's a container) isn't a good intermediate format. It is lossy, and the video is generally not all I-frame (meaning that to display a frame it references previous and following frames). h.264/aac/mp4 are great for delivery because they efficiently pack a lot of perceptual quality into a small file.</p>

<p>You're better off using an all-i-frame codec. Notable examples are Apple ProRes, Avid DNxHD and Cineform. These are all lossy, but minimally so. You can also use a lossless codec, like FFV1, but the speed and storage this requires might make it unworkable. Similarly you're best off using PCM (uncompressed) for your audio.</p>

<p>I'm not sure if that is going to affect the problem of the gaps. That might be an artefact of the way the video and audio are multiplexed.</p>
