So what you could do is first get the duration and save it to a $duration variable. The ffmpeg command you use #DURATION# where you want to have the duration. Then you run str_replace like str_replace('#DURATION#', $duration, $ffmpeg_cmd); then you run the cmd. Also the ffmpeg drawtext requires to escape some characters, if you use single quote for the drawtext options then use double quote for the text itself (or remove the single quotes, this will also work), also other characters that need to be excaped are :,} and some other characters...
|