Thread: Tech FFmpeg duration
View Single Post
Old 10-27-2017, 12:17 AM  
symtab
Confirmed User
 
Join Date: Nov 2009
Posts: 415
You can use ffprobe to actually get a json string. You can then convert this json string to an object in php with json_decode. This is more elegant and simplier.

Code:
exec('ffprobe -v quiet -loglevel quiet -show_format -show_streams -print_format json file.mp4', $output);
$json = json_decode(implode('', $output));
$duration = $json->format->duration;
Now in your watermark cmd you replace the duration with the above $duration variable.
__________________
Adult Scripts: Adult Script Pro 3.4.0 - Adult Search Script 3.8.0
Adult Traffic: Plug Rush - ExoClick
symtab is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote