[FFmpeg-user] Create a black box over top of the video for a set duration at a set time.

Bouke / edit 'B bouke at editb.nl
Sat Dec 31 11:50:46 EET 2022

On 31 Dec 2022, at 10:41, Michael Koch <astroelectronic at t-online.de> wrote:
> Am 31.12.2022 um 10:31 schrieb Bouke / Videotoolshed:
>> On 31 Dec 2022, at 04:53, Gyan Doshi <ffmpeg at gyani.pro> wrote:
>>> On 2022-12-31 08:15 am, David Niklas wrote:
>>>> Sorry for taking so long to reply.
>>>> It is not working. Terminal output below.
>>>> % ffmpeg -i Ducksinarow.mp4 -filter_complex "[0:0]drawbox=color=black:t=fill=enable='between(t,1.0,2.0)'" -c:a copy -c:v libvpx ducks.mp4
>>> There should be a colon after fill, not =
>>> drawbox=color=black:t=fill:enable='between(t,1.0,2.0)'
>> And for your next question that might come up (since you want to do multiple filters, I do too and just got bitten):
>> There is a limitation on Windows that won’t accept long arguments.
> Do you have an example? I have used command lines _much_ longer than the above example, and never found a limitation.
> Michael

The limitation is 8091 chars, and afaik only exists on Windows. (Mac is fine, I don’t know about Linux, but I suspect it will be no issue there too.)
My latest issue had a line of more than 64000 chars, example from filter_complex (that caused the huge length) below.


map 0:0 -filter_complex [0:0]drawtext=enable='between(t,0.030208333333333334,75.18016666666666)':timecode='00\:49\:29\:11':fontfile='/Volumes/Data/PycharmProjects/LTC_convert/src/main/resources/base/courbd.ttf':r=25:x=(w-text_w)/2:y=h-th: y=h-(2*lh):fontsize=54.0:fontcolor=white:borderw=2.7:bordercolor=#101010 at 0.8,drawtext=enable='between(t,75.19016666666667,75.78016666666666)':text='-- NO LTC !':fontfile='/Volumes/Data/PycharmProjects/LTC_convert/src/main/resources/base/courbd.ttf':x=(w-text_w)/2:y=h-th: y=h-(2*lh):fontsize=54.0:fontcolor=white:borderw=2.7:bordercolor=#101010 at 0.8,drawtext=enable='between(t,75.79016666666666,299.980125)':timecode='00\:47\:41\:21':fontfile='/Volumes/Data/PycharmProjects/LTC_convert/src/main/resources/base/courbd.ttf':r=25:x=(w-text_w)/2:y=h-th: y=h-(2*lh):fontsize=54.0:fontcolor=white:borderw=2.7:bordercolor=#101010 at 0.8,drawtext=enable='between(t,300.0300416666667,822.9397708333333)':timecode='00\:47\:41\:21':fontfile='/Volumes/Data/PycharmProjects/LTC_convert/src/main/resources/base/courbd.ttf':r=25:x=(w-text_w)/2:y=h-th: y=h-(2*lh):fontsize=54.0:fontcolor=white:borderw=2.7:bordercolor=#101010 at 0.8,drawtext=enable='between(t,822.9497708333333,1138.6619166666667)':text='-- NO LTC !':fontfile='/Volumes/Data/PycharmProjects/LTC_convert/src/main/resources/base/courbd.ttf':x=(w-text_w)/2:y=h-th: y=h-(2*lh):fontsize=54.0:fontcolor=white:borderw=2.7:bordercolor=#101010 at 0.8, and so on….

More information about the ffmpeg-user mailing list