ffmpeg - Duration of an uploaded video in PHP -


i need know duration of video have uploaded page. have written php script doing this:

<?php  $command = "ffmpeg -i video.mp4 2>&1 | grep duration | awk '{print $2}' | tr -d ,; "; $cm = shell_exec($command) ; echo "$cm";  ?> 

when execute program via terminal shows duration, on calling in php page not give output. please provide me solution....

thanks in advance.

function shell_exec returns output in string. exec returns last line.

try this

<?php  $command = "ffmpeg -i video.mp4 2>&1 | grep duration | awk '{print $2}' | tr -d ,; "; echo exec($command) ;  ?> 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -