I'm trying to add a top and bottom section to a video like we do for image memes. I'm using ffmpeg and imagemagick but there is no inbuilt option to do this task. Let's say i have a video and I need to add the caption like this to the whole video. How can i achieve this?
From what I can tell something like this is what you're looking for:
Using pad and drawtext. In this example pad adds 50 pixels to the top and 50 pixels to the bottom, then two drawtext instances place each line.
ffmpeg -i input -filter_complex \
"[0:v]pad=iw:ih+100:0:(oh-ih)/2:color=white, \
drawtext=text='ONE DOES NOT SIMPLY':fontfile=/path/to/impact.ttf:fontsize=24:x=(w-tw)/2:y=(50-th)/2, \
drawtext=text='STOP ME FROM FILTERING':fontfile=/path/to/impact.ttf:fontsize=24:x=(w-tw)/2:y=h-25-(th/2)" \
output
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With