Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP ffmpeg

PHP ffmpeg



10:44 am on Mar 29, 2009 (gmt 0)

5+ Year Member

Dear all,

I need some help in php ffmpeg.

$extension = "ffmpeg";
$extension_soname = $extension . "." . PHP_SHLIB_SUFFIX;
$extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;

// load extension
if(!extension_loaded($extension)) {
dl($extension_soname) or die("Can't load extension $extension_fullname\n");

if(exec("ffmpeg -itsoffset -4 -i 1Video5.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg")) { echo "Ok";
} else {echo "not okay";}

Above code not create a thumbnail for the video. any help would be highly appreciated.

N.B: Safe Mode is off



8:38 am on Mar 31, 2009 (gmt 0)

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Hi Mahabub,

Have you got your error reporting set to report ALL errors? E_ALL. And do your server error logs reveal any clues?



7:12 pm on Apr 1, 2009 (gmt 0)

10+ Year Member

Are you running this as a local script or on a webserver? If you are running on a server does the web user have write access to the directory where you want the file to be created?

By using "exec" to run ffmpeg, there will be no PHP errors. Similarly, there is no reason to load the php-ffmpeg extensions if php-ffmpeg isn't going to be used.


Featured Threads

Hot Threads This Week

Hot Threads This Month