0

i want to make multiple moving box,i tried but not work

used ffmpeg 4.1.3

./ffmpeg -i ./1115449702147276803.mp4 -vf "drawbox=x=if(between(t\,4.769586\,9.625816)\,(500+((517-500)/(9.625816-4.769586))*(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN):w=2:h=24:color=#19C7B1:t=fill:enable=between(t\,4.769586\,9.625816),drawbox=x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))*(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN):w=57:h=24:color=#19C7B1:t=fill:enable=between(t\,4.769586\,9.625816),drawtext=fontfile=/font/PingFang.ttc:text=People  :x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))*(t-4.769586))\,NAN) + 2:y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN) + 4.800000000000001:fontsize=14:fontcolor=#0000FF:enable=between(t\,4.769586\,9.625816)" ./output/1115449702147276803-1554805242.mp4

the filter desc

drawbox=x=if(between(t\,4.769586\,9.625816)\,(500+((517-500)/(9.625816-4.769586))(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN):w=2:h=24:color=#19C7B1:t=fill:enable=between(t\,4.769586\,9.625816),drawbox=x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN):w=57:h=24:color=#19C7B1:t=fill:enable=between(t\,4.769586\,9.625816),drawtext=fontfile=/font/PingFang.ttc:text=People :x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))(t-4.769586))\,NAN) + 2:y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN) + 4.800000000000001:fontsize=14:fontcolor=#0000FF:enable=between(t\,4.769586\,9.625816)

The above command not work, because drawbox do not support 't', so i tried another one

./ffmpeg -i ./1115449702147276803.mp4 -vf "color=#19C7B1:s=2*24[labelLeft0];[in][labelLeft0]overlay=x=if(between(t\,4.769586\,9.625816)\,(500+((517-500)/(9.625816-4.769586))*(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN):enable=between(t\,4.769586\,9.625816):shortest=1,color=#19C7B1:s=57*24[labelRight0];[in][labelRight0]overlay=x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))*(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN):enable=between(t\,4.769586\,9.625816):shortest=1,drawtext=fontfile=/font/PingFang.ttc:text=People  :x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))*(t-4.769586))\,NAN) + 2:y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN) + 4.800000000000001:fontsize=14:fontcolor=#0000FF:enable=between(t\,4.769586\,9.625816)" ./output/0-1554822681.mp4

the filter desc

color=#19C7B1:s=2*24[labelLeft0];[in][labelLeft0]overlay=x=if(between(t\,4.769586\,9.625816)\,(500+((517-500)/(9.625816-4.769586))(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN):enable=between(t\,4.769586\,9.625816):shortest=1,color=#19C7B1:s=57*24[labelRight0];[in][labelRight0]overlay=x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN):enable=between(t\,4.769586\,9.625816):shortest=1,drawtext=fontfile=/font/PingFang.ttc:text=People :x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))(t-4.769586))\,NAN) + 2:y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN) + 4.800000000000001:fontsize=14:fontcolor=#0000FF:enable=between(t\,4.769586\,9.625816)

still can't work, error logs as follows

[AVFilterGraph @ 0x7fb37ef08680] Too many inputs specified for the "color" filter. Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0

Your Answer

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

Browse other questions tagged or ask your own question.