ffmpeg sample code

ffmpeg sample code

Posted by Sajith M.R in Downloads, php source code on 12. Jun, 2007 | 74 Comments

Install ffmpeg library in your server first.
Place a video file of any type on current directory (or anywhere), here it is clock.avi .
Click more for source code:

extension_loaded(’ffmpeg’) or die(’Error in loading ffmpeg’);

$ffmpegInstance = new ffmpeg_movie(’clock.avi’);
echo “getDuration: ” . $ffmpegInstance->getDuration() .
“getFrameCount: ” . $ffmpegInstance->getFrameCount() .
“getFrameRate: ” . $ffmpegInstance->getFrameRate() .
“getFilename: ” . $ffmpegInstance->getFilename() .
“getComment: ” . $ffmpegInstance->getComment() [...]