Script is php with database. The ffmpeg code is saved to field in database. Then script executes that code.
With debug ffmpeg I can see problem is with variable duration:
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'drawtext=fontsize=16:
[email protected]:fontfile =/usr/local/share/fonts/freefont-ttf/FreeSans.ttf:text='Blah blah blah':y=25:x=w-(t-0)*w/20'.
You can see t-0, where 0 should be the duration.
duration=10 works
duration=$(10) does not assign value to variable, 0 output as above
duration="$(10)" does not assign value to variable, 0 output as above
duration=`10` does not work, breaks encoding
I will try and work out how to integrate bash solution, thanks. But difficult with encoded script knowing how to send value of %video_file% to a bash script.
More head scratching to do.