Static frame video and a motion-intensive appendix: how to render fast? A frequent task is to render a 5–30 minutes video from a single image + soundtrack and then append a pre-rendered outro logo animation sequence.

Output is hd720 h264 mp4 for YouTube. 

What would be the fastest aproach to combine a lo-motion static image part with motion-intensive tail animation and produce a quality result? 

I tried rendering the image part and then concat the outro:

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  \
  $RENDER

ffmpeg  \
  -f concat  \
  -safe 0  \
  -i &lt;(printf "file '%s'\n" ${RENDER} ${OUTRO})  \
  -c copy  \
  -y  \
  ${OUTPUT}


This renders rather fast but the appended logo reveal gets garbled. That's because of the h264 compression settings, I guess.

Maybe I could somehow imitate the two-pass rendering of h264 mp4? I know the exact length of the first part and it contains zero motion. There's the second animation and I can "prepare" the 1st pass for it ahead.

Please advice, how would a ffmpeg Pro aproach the task?

Upd. here are the properties of the appended outro:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'outro.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.14.101
  Duration: 00:00:03.19, start: 0.000000, bitrate: 263 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 77 kb/s, 24 fps, 24 tbr, 12288 tbn (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 181 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
As I can see, you know duration of your song, it good.

I can suggest this trick:


Generate 5 second of video with static image. With good settings, good fps, slow encoding and so on. Video must be without audio.
Join this video with itself as many times, as you want, so duration will be a little more of your clip. This operation not requires reencoding, so can be performed very fast.
Split your clip to exact size as you need. (no re-encoding)
Join outro to file
Join your file with audio (without re-encoding for video, but audio you can modify based on your needs. If you want to upload it to youtube, you can not reencode audio, youtube does it itself)


This can be pretty fast.