Here I am going to get details related to FFMPEG including orientation, duration.
Step to get details related to FFMPEGincluding orientation, duration.
1. Get Video duration:
$ffmpeg_path = “/usr/bin/ffmpeg”; //Path to your FFMPEG
$video_path = “/vidoes/myvideo.mov”; // Path to your Video $command = $ffmpeg_path . ‘ -i “‘ . $video_path . ‘” -vstats 2>&1’; $output = shell_exec($command);$regex_duration = “/Duration: ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}).([0-9]{1,2})/”;if (preg_match($regex_duration, $output, $regs)) {$hours = $regs [1] ? $regs [1] : null;$mins = $regs [2] ? $regs [2] : null;$secs = $regs [3] ? $regs [3] : null;} $video_Length = $hours . “:” . $mins . “:” . $secs;
Original Source: Orientation Duration Using FFMPEG
No comments:
Post a Comment