<p>As I can see, you know duration of your song, it good.</p>

<p>I can suggest this trick:</p>

<ol>
<li><p>Generate 5 second of video with static image. With good settings, good fps, slow encoding and so on. Video must be without audio.</p></li>
<li><p>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.</p></li>
<li><p>Split your clip to exact size as you need. (no re-encoding)</p></li>
<li><p>Join outro to file</p></li>
<li><p>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)</p></li>
</ol>

<p>This can be pretty fast.</p>

CC BY-SA 3.0
2017-10-03T18:21:06.717Z
Thank you for the suggestion! Will try soon and report here. Which container/codec, capable of the fastest concat protocol `concat:video1|video2|video3` do you recommend? I used huffyuv recently, but not sure which is better. Disk space is not limited.
Serge
CC BY-SA 3.0
2017-10-03T18:31:43.277Z
huffyuv is codec, not container. Try to use avi, I love this old container. Codec must be x264 or any other which you want in final video
bukkojot
CC BY-SA 3.0
2017-10-03T17:06:17.660Z
2017-10-03T17:06:17.660Z
bukkojot
<p>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.</p>

<p>Output is hd720 h264 mp4 for YouTube. </p>

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

<p>I tried rendering the image part and then concat the outro:</p>

<pre><code>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}
</code></pre>

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

<p>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.</p>

<p>Please advice, how would a ffmpeg Pro aproach the task?</p>

<p><strong>Upd</strong>. here are the properties of the appended outro:</p>

<pre><code>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
</code></pre>

CC BY-SA 3.0
2017-10-03T12:21:02.057Z
Show the file properties of the outro.
Gyan
CC BY-SA 3.0
2017-10-03T13:00:40.687Z
@Mulvya thank you for the attention! I updated the question with outro file properties. I wonder if there a way to build an mp4 file with two distinct compressions settings for the two parts?
Serge
<ffmpeg><mp4><performance>
Static frame video and a motion-intensive appendix: how to render fast?
Serge
# Static frame video and a motion-intensive appendix: how to render fast?

(Asked by: username_0 on 2017-10-03)

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 <(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

**Tags:** ffmpeg, mp4, performance

> **Comments:**
> **username_1**: Show the file properties of the outro.  
> **username_0**: @Mulvya thank you for the attention! I updated the question with outro file properties. I wonder if there a way to build an mp4 file with two distinct compressions settings for the two parts?  

---

## 1 answers

### Answer by username_2 on 2017-10-03. Score: 1

As I can see, you know duration of your song, it good.

I can suggest this trick:

1. Generate 5 second of video with static image. With good settings, good fps, slow encoding and so on. Video must be without audio.
2. 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.
3. Split your clip to exact size as you need. (no re-encoding)
4. Join outro to file
5. 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.

> **Comments:**
> **username_0**: Thank you for the suggestion! Will try soon and report here. Which container/codec, capable of the fastest concat protocol `concat:video1|video2|video3` do you recommend? I used huffyuv recently, but not sure which is better. Disk space is not limited.  
> **username_2**: huffyuv is codec, not container. Try to use avi, I love this old container. Codec must be x264 or any other which you want in final video  

---

