Jump to content

ffmpeg


etnastyles

Recommended Posts

ffmpeg has nothing at all to do with php. Install it on your machine, then call it like any other command line program via exec().

 

but where do you get ffmpeg and how do you set it up in your php

 

Have you tried googling for it? A google search of ffmpeg brings up the official page as the very first result. Amazing!

Link to comment
https://forums.phpfreaks.com/topic/113536-ffmpeg/#findComment-583556
Share on other sites

i have read that you have to add ffmpeg to your ext / ini file pointing to a dll or some kind - i have a ffmpeg .exe file - if this is what you need to get the exec() function working could you please show me how to use it #

 

<?php

$test = exec(/www/demo/ffmpeg.exe, $convert_oldformat, $newformat_name);

?>

this is ffmpeg calliing exe

 

the only reason i ask is that i have seen methods liek this: $test = exec(ffmpeg -i, $convert_oldformat, $newformat_name);

this is the ffmpeg in php modules

 

 

how the dilly do you call the ffmpeg.exe within your php doc to convert a file????

whats the best method and is there a simple to understand tutorial to how you get ffmepg working through php using exec()

Link to comment
https://forums.phpfreaks.com/topic/113536-ffmpeg/#findComment-583616
Share on other sites

I think you may be referring to ffmpeg-php. Google

 

Nowhere has he refered to ffmpeg-php, thats just going to complicate things.

 

All you need do is as your example.

 

<?php
$test = exec(/www/demo/ffmpeg.exe, $convert_oldformat, $newformat_name);
?>

 

Just make sure ffmpeg is installed into /www/demo, or make sure you supply a valid path to where it is installed.

Link to comment
https://forums.phpfreaks.com/topic/113536-ffmpeg/#findComment-583627
Share on other sites

ffmpeg isn't installed to anywhere relating to the web path. He keeps referring to 'IN PHP' which means a php module, to me. Which is ffmpeg-php.

 

Yeah, but I think his a little confused. Theres not usually much point going the ffmpeg-php route because it not an official extension, alot of hosting providers will not install it.

Link to comment
https://forums.phpfreaks.com/topic/113536-ffmpeg/#findComment-583664
Share on other sites

i think maybe i am confused at the amount of ways to do this as there are so many tutorials on the net for using ffmpeg

 

Is this method for when you have downloaded : http://sourceforge.net/project/showfiles.php?group_id=122353 this type of ffmpeg?

<?php

if(!exec('ffmpeg -i /www/demo/bigtimeknockout.wmv -ar 22050 -f flv /www/demo/video.flv', $result))

    {

    echo "failed.<br>";

    }

else

    {

    echo "worked.<br>";

    echo $result;

    }

?>

 

 

whats about this method : http://arrozcru.no-ip.org/ffmpeg_builds/

you can download a ffmpeg.exe

 

<?php

if(!exec('ffmpeg.exe, /www/demo/bigtimeknockout.wmv -ar 22050 -f flv /www/demo/video.flv', $result))

    {

    echo "failed.<br>";

    }

else

    {

    echo "worked.<br>";

    echo $result;

    }

?>

 

so which way is best all i want to do is get it working on my loaclhost before i start on my web server... i think i would prefer the method where you install modules into php as i would gain some extra knowledge....has anyone got ffmpeg converting files using php to call it????? if so can you help...

 

 

Link to comment
https://forums.phpfreaks.com/topic/113536-ffmpeg/#findComment-583713
Share on other sites

Ok, I'll try and explain what is going on. Firstly, there is a php extension for handling ffmpeg through an extension, however this extension is not officially supported. Hence I would not recommend going this route as not many hosts will install the extension for you.

 

Now, both the examples you posted use the same method. You need to install ffmpeg on your machine. ffmpeg is a command line program used for maniulating video.

 

To execute command line programs via php you use one of the exec familly of functions.

 

So, you need to pass exec the same command you would use on the command line.

 

It really is quite simple. ffmpeg has nothing at all to do with php, but php provides a method of executing external applications via exec.

Link to comment
https://forums.phpfreaks.com/topic/113536-ffmpeg/#findComment-583726
Share on other sites

so should i just make sure that the ffmpeg.exe is in the same folder as the script that is calling the exec() function.

 

The best way is to make sure you install ffmpeg somewhere within your system PATH. I'm not a windows user but I believe the C://system32 (or whatever it is) is within your path.

 

This way you could call ffmpeg directly, otherwise, you will need to supply exec() with the full path to ffmpeg. eg C://foo/bar/ffmpeg.exe

Link to comment
https://forums.phpfreaks.com/topic/113536-ffmpeg/#findComment-583738
Share on other sites

so this is what i will do as i have a windows system

 

<?php

 

define("FFMPEG", "C:\Program Files\EasyPHP 2.0b1\www\phpvideo\ffmpeg.exe");

 

 

if(!exec('FFMPEG, /www/demo/bigtimeknockout.wmv -ar 22050 -f flv /www/demo/video.flv', $result))

    {

    echo "failed.

";

    }

else

    {

    echo "worked.

";

    echo $result;

    }

?>

Link to comment
https://forums.phpfreaks.com/topic/113536-ffmpeg/#findComment-583763
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.