Given an audio and an image we create a static image "video" and then append a short clip that has a rather intense motion.
Audio and image varies from run to run. Appended animation is always the same. Rendering is done with ffmpeg on a remote server. Rendered file must be in h264 codec mpg.
Speed of encoding is crucial. Is there a fast and effective way to generate and merge the two clips quickly?
Atm we use the following ffmpeg commands:
// create first clip from image
ffmpeg -loop 1 -r 24 -i $IMAGE -i $AUDIO -t $AUDIO_LENGTH -c:a aac -profile:a aac_low -ar 48000 -b:a 192k -bsf:a aac_adtstoasc -strict -2 -y -c:v libx264 -profile:v high -preset veryfast -tune stillimage -crf 24 -x264opts bframes=2 -pix_fmt yuv420p -safe 0 clip1.mpg
// . . .
// then append the animation
ffmpeg -f concat -safe 0 -i list.txt -c copy -y -safe 0 final.mpg
Intuition is that we can benefit form knowing exact timing of a first clip with a static image and the second one with intense animation – like it is determined in the 1-st pass of a 2-pass compression.
Someone experienced in tech of h264 codec and mpeg please advice.