0

I have some short mp4 video clips. Each one represents a response to a question or prompt. I would like to overlay the question/prompt text atop a grey semi-opaque banner. I need to be able to control the size, position, color, and opacity of the grey banner as well as the size, color, font family, justification, etc of the text that is overlaid atop it.

I'll prepend my question by stating that my experience with ffmpeg is limited to applying watermarks to videos via it's Ruby wrapper streamio-ffmpeg. I know what I want to do is possible, I just don't know where to begin. What I would like to know is how I can do this with ffmpeg. Specifically I am hoping for some sample code that I can learn from and adapt to my specific need, as well as how I can execute that code on a video within the context of a Rails app.

Daniel Bonnell
  • 4,817
  • 9
  • 48
  • 88
  • 1
    Sounds like a job for subtitles. Are you looking for something like this? [How to set background to subtitle in ffmpeg?](http://stackoverflow.com/q/25870169/1109017) Alternatively, you could use the [drawtext filter](https://ffmpeg.org/ffmpeg-filters.html#drawtext) with the `box*` options, but it gives somewhat less control compared to subtitles. – llogan Apr 07 '17 at 17:33
  • Subtitles definitely seems like the better option because of more fine grained controls. Is it possible to force the background to stretch the full width of the video and have the same string of text appear for the duration of the video? It looks like I can do this with `drawtext`, but I didn't see anything about setting the opacity of the `box` background. – Daniel Bonnell Apr 10 '17 at 15:07
  • 1
    Added a drawbox example to linked answer. – llogan Apr 10 '17 at 19:45
  • Awesome! Exactly what I was looking for! – Daniel Bonnell Apr 10 '17 at 21:26

0 Answers0