Thanks for help. I have tried everything so far and still no joy.
I went from using ffprobe to ffmpeg itself to output duration in seconds:
duration=$(/usr/local/bin/ffmpeg -i /path/to/file/1.mp4 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,// | sed 's@\..*@@g' | awk '{ split($1, A, ":"); split(A[3], B, "."); print 3600*A[1] + 60*A[2] + B[1] }') /usr/local/bin/ffmpeg -i /path/to/file/1.mp4 -vf 'scale=448:trunc(ow/a/vsub)*vsub' -vf drawtext="fontsize=16:
[email protected]:fontfile =/usr/local/share/fonts/freefont-ttf/FreeSans.ttf:text='Blah blah blah':y=25:x=w-(t-($duration/2))*w/20" -threads 0 -acodec libfaac -ar 44100 -ab 128k -vcodec libx264 -preset slower -keyint_min 25 -g 250 -r 24 -y /path/to/output/temp_vid.mp4
It works in command line perfect, even without a line break it works.
But when I save it in database for script to use, damn thing won't encode and shows in admin area the error code, if I copy the 'error code' into command line it works perfect.