Cannot execute FFMPEG in php script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arifsusam
Forum Newbie
Posts: 1
Joined: Sun Apr 15, 2007 3:23 pm

Cannot execute FFMPEG in php script

Post by arifsusam »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello,

I am trying to convert uploaded video files of various formats, automatically to the flash format.

I use ffmpeg and php's "exec" command as below:

Code: Select all

<?php 
exec("ffmpeg -i clip_25.wmv -ar 22050 -ab 32 -f flv -s 320×240 destfile.flv");
echo "Test OK.";
?>
The script works fine on my local computer (meaning i can see 'Test OK')

but when i upload and run it on the server 'Test ok' doesn't show up on the client's browser.
Always a blank page. No matter what i write after of before the conversion line.

However, the strange thing is, the file is perfectly converted, even on the server side.
Which proves that ffmpeg and it's codecs are working fine.

As the display is always a blank page,
The fact is that the error is shown nowhere and that makes the page impossible to debug.

The server is running php 4.1.1.1 and IIS 6.0.

Any suggessions?


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post by stereofrog »

try

Code: Select all

exec("your command here 2>&1", $out);
print_r($out);
also check your error_reporting and display_errors settings.
Post Reply