3

On a video I am producing, I am overlaying a digital on screen graphic on the lower right corner (branding logo). I am overlaying an 11 second two-tiered lower third at the beginning of the video (Speaker's Name with their title below their name). Later in the video a second speaker is introduced and I am trying to add a second two-tiered lower third for the second speaker. I do this on a weekly basis and everything before the second lower third works like magic. However, the second lower third never appears. Here is the code I am using:

ffmpeg -hide_banner -loglevel 56 -report \
    -ss 00:25:00 \
    -i 00005.MTS \
    -i ./constants/edu_logo.svg \
    -i ./constants/name_animation_dr_johnson.mp4 \
    -i ./constants/name_animation_dr_halmilton.mp4 \
    -filter_complex "[1:v]scale=400:122[logo]; \
    [0:v][logo]overlay=x=main_w-overlay_w-80:y=main_h-overlay_h-80[v-l]; \
    [v-l][2:v]overlay=x=0:y=0:enable='between(t,0,10.5)'[v-l-a]; \
    [v-l-a][3:v]overlay=x=0:y=0:enable='between(t,15,25.5)'[v-l-a-a]" \
    -vcodec libx264 -preset fast \
            -flags +cgop -pix_fmt yuv420p \
            -b:v 2M -movflags +faststart \
    -map "[v-l-a-a]" -map 0:a -t 30 my_test.mp4

What do I need to modify to get the second lower third to appear?

Ubuntu Studio 18.04.2 LTS
ffmpeg version 3.4.6-0ubuntu0.18.04.1
i7-2600k @ 3.4GHz
8 Gigs of RAM
GeForce GTX 970

4

The overlay filter syncs by timestamps i.e. it overlays 2nd input's frame with timestamp X on main input's frame with timestamp X. Barring certain circumstances like the use of -copyts, timestamps start from zero. So, when your 2nd lower-third overlay enters its active timeline, there are no corresponding frames from the secondary input.

Solution: offset the input's timestamps to start from overlay start time.

ffmpeg -hide_banner -loglevel 56 -report \
    -ss 00:25:00 \
    -i 00005.MTS \
    -i ./constants/edu_logo.svg \
    -i ./constants/name_animation_dr_johnson.mp4 \
    -itsoffset 15 -i ./constants/name_animation_dr_halmilton.mp4 \
    -filter_complex "[1:v]scale=400:122[logo]; \
    [0:v][logo]overlay=x=main_w-overlay_w-80:y=main_h-overlay_h-80[v-l]; \
    [v-l][2:v]overlay=x=0:y=0:enable='between(t,0,10.5)'[v-l-a]; \
    [v-l-a][3:v]overlay=x=0:y=0:enable='between(t,15,25.5)'[v-l-a-a]" \
    -vcodec libx264 -preset fast \
            -flags +cgop -pix_fmt yuv420p \
            -b:v 2M -movflags +faststart \
    -map "[v-l-a-a]" -map 0:a -t 30 my_test.mp4
| improve this answer | |
  • the magic has returned. Your answer is perfect. I truly appreciate your help and expertise. Thank you! – Mark Cain Aug 12 '19 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.