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)

Junior Member

10+ Year Member

joined:Dec 7, 2008
votes: 0

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)

Senior Member

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

joined:Mar 30, 2003
votes: 0

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)

Full Member

10+ Year Member

joined:Feb 4, 2004
posts: 215
votes: 0

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.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members