<p>The comments all suggest using an <a href="https://en.wikipedia.org/wiki/Non-linear_editing_system" rel="nofollow noreferrer">NLE</a> (I agree), but given that your question is tagged with <a href="https://video.stackexchange.com/questions/tagged/ffmpeg">ffmpeg</a>, here are a few pointers to documentation:</p>

<p>You can accomplish text overlay with the <a href="https://ffmpeg.org/ffmpeg-filters.html#drawtext-1" rel="nofollow noreferrer">drawtext</a> filter.</p>

<blockquote>
  <p>Draw a text string or text from a specified file on top of a video, using the libfreetype library.</p>
</blockquote>

<p>For changing the background, you should look into the <a href="https://ffmpeg.org/ffmpeg-filters.html#colorkey" rel="nofollow noreferrer">colorkey</a> filter. From the docs, here's an example to "make every green pixel in the input image transparent":</p>

<pre><code>ffmpeg -i input.png -vf colorkey=green out.png
</code></pre>

<p>As for timing, you should cross-reference if they support <a href="https://ffmpeg.org/ffmpeg-filters.html#Timeline-editing" rel="nofollow noreferrer">timeline editing</a>.</p>

<blockquote>
  <p>Some filters support a generic enable option. For the filters supporting timeline editing, this option can be set to an expression which is evaluated before sending a frame to the filter. If the evaluation is non-zero, the filter will be enabled, otherwise the frame will be sent unchanged to the next filter in the filtergraph.</p>
</blockquote>

<p>Again, this is probably better suited for an NLE, but it's certainly possible with <code>ffmpeg</code>, and will likely render <em>significantly</em> faster (at the tradeoff of likely taking much longer to craft the <code>ffmpeg</code> invocation vs. using an NLE). Good luck!</p>

CC BY-SA 3.0
2018-04-23T03:18:45.673Z
2018-04-23T03:18:45.673Z
0x9dedbaf9
<p>Pretty much any Non-Linear Editing program can do this: 'Free' versions include; iMovie (Mac), Microsoft Photos (Windows). KDNELIVE (Linux).</p>

<p>For more Professional apps, try the free DaVinci Resolve, or trial Adobe Premiere or Apple Final Cut Pro X.  </p>

<p>Simply overlay the text on the edited video using that software’s preferes method.</p>

CC BY-SA 3.0
2017-11-22T12:09:49.713Z
2017-11-23T22:00:15.860Z
2017-11-23T22:00:15.860Z
Alan Kael Ball
<p>I have a video that is composed of 3 parts: intro, outro and middle. in the outro and intro I need to add some text as an overlay and on the middle part, I need to change the background (which is one color) to an image I'll provide plus add a text overlay.
All the texts will appear at certain times, be displayed for few seconds in different parts of the video and disappear. The background image too needs to be displayed only for few seconds in the middle of the video.
Can you point me to something that can help me or give me few pointers that can help me accomplish this task? Thank you.</p>

CC BY-SA 3.0
2017-11-22T04:46:33.573Z
Too short to qualify for an answer - Premiere Pro, Vegas Pro, or any other competent video editing software will do this with a few mouse vlicks.
pojo-guy
CC BY-SA 3.0
2017-11-22T08:10:12.870Z
If you searching for automation solution, you can use ffmpeg and a small part of programming.
bukkojot
CC BY-SA 3.0
2017-11-22T19:27:13.210Z
This is a broad request. You can do this with `ffmpeg` (or `melt`), but you should try to figure it out yourself and then come back here to address specific issues you encounter. See the drawtext (or subtitle) and overlay filters with `enable` option for timeline editing support.
llogan
<video><ffmpeg>
add text overlay and image background to a video
tonyarcher
# add text overlay and image background to a video

(Asked by: username_0 on 2017-11-21)

I have a video that is composed of 3 parts: intro, outro and middle. in the outro and intro I need to add some text as an overlay and on the middle part, I need to change the background (which is one color) to an image I'll provide plus add a text overlay.
All the texts will appear at certain times, be displayed for few seconds in different parts of the video and disappear. The background image too needs to be displayed only for few seconds in the middle of the video.
Can you point me to something that can help me or give me few pointers that can help me accomplish this task? Thank you.

**Tags:** video, ffmpeg

> **Comments:**
> **username_1**: Too short to qualify for an answer - Premiere Pro, Vegas Pro, or any other competent video editing software will do this with a few mouse vlicks.  
> **username_2**: If you searching for automation solution, you can use ffmpeg and a small part of programming.  
> **username_3**: This is a broad request. You can do this with `ffmpeg` (or `melt`), but you should try to figure it out yourself and then come back here to address specific issues you encounter. See the drawtext (or subtitle) and overlay filters with `enable` option for timeline editing support.  

---

## 2 answers

### Answer by username_4 on 2018-04-23. Score: 1

The comments all suggest using an NLE (I agree), but given that your question is tagged with ffmpeg, here are a few pointers to documentation:
You can accomplish text overlay with the drawtext filter.

Draw a text string or text from a specified file on top of a video, using the libfreetype library.

For changing the background, you should look into the colorkey filter. From the docs, here's an example to "make every green pixel in the input image transparent":
ffmpeg -i input.png -vf colorkey=green out.png

As for timing, you should cross-reference if they support timeline editing.

Some filters support a generic enable option. For the filters supporting timeline editing, this option can be set to an expression which is evaluated before sending a frame to the filter. If the evaluation is non-zero, the filter will be enabled, otherwise the frame will be sent unchanged to the next filter in the filtergraph.

Again, this is probably better suited for an NLE, but it's certainly possible with ffmpeg, and will likely render significantly faster (at the tradeoff of likely taking much longer to craft the ffmpeg invocation vs. using an NLE). Good luck!


---

### Answer by username_5 on 2017-11-22. Score: 0

Pretty much any Non-Linear Editing program can do this: 'Free' versions include; iMovie (Mac), Microsoft Photos (Windows). KDNELIVE (Linux).

For more Professional apps, try the free DaVinci Resolve, or trial Adobe Premiere or Apple Final Cut Pro X.

Simply overlay the text on the edited video using that software’s preferes method.


---

