Web Hosting Talk







View Full Version : MPEG to FLV


tlsuess
07-28-2008, 06:42 PM
Just have a quick question and wondered if anyone knows. Is there a way to convert MPEGs to FLVs on shared web hosting?

I know ffmpeg does a pretty good job at doing that but I'm wondering if you would be able to do it on a shared web host. Are there PHP classes that you can use to convert MPEGs to FLVs or interface classes to execute ffmpeg on a shared web host, if that's even possible?

Thanks,
Todd

MountedWeb
07-28-2008, 06:46 PM
You will be a find a shared host with FFMPEG enabled here:

http://www.google.co.uk/search?hl=en&client=firefox-a&channel=s&rls=org.mozilla:en-GB:official&hs=dFw&pwst=1&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=shared+ffmpeg+hosting&spell=1

Here is a class that will be able to convert MPEG to FLV:

http://www.phpclasses.org/browse/package/3531.html

Thanks

tlsuess
07-28-2008, 07:57 PM
Thanks for the information MountedWeb!

I was also wondering if there are any converters (written as PHP classes) that convert videos to FLV without the use of calling external programs? Like the conversion code would be written in PHP and not in C++ for compilation on a server. Are there any out there or is it just not possible?

MountedWeb
07-28-2008, 08:40 PM
Thanks for the information MountedWeb!

I was also wondering if there are any converters (written as PHP classes) that convert videos to FLV without the use of calling external programs? Like the conversion code would be written in PHP and not in C++ for compilation on a server. Are there any out there or is it just not possible?

No problem.

http://php-classes.kinghost.net/browse/package/3747.html

It also currently provides FFmpeg-PHP emulation in pure PHP so you wouldn't need to compile and install the module.


Upload to your server and execute this file with the correct config:

example01.php Example
Converts video to Flash Video (ie FLV)

tlsuess
07-28-2008, 09:22 PM
This is amazing! I'll be playing around with this. Thanks again MountedWeb!!! :D

tlsuess
07-28-2008, 10:41 PM
Unfortunately it doesn't convert MPGs to FLV without FFMPEG installed. The emulator only emulates certain things like retrieving the title, author, and ID3v2 info. Thanks anyway. I suppose I'll experiment or just give up on it until later. I thought there might be something like this:

class MPGtoFLV {
function MPGtoFLV ($file, $output) {
$f = fopen($file, "r");
$o = fopen($output, "w");
while ($d = fread($f, 256)) {
// Process conversion of MPEG data for output as FLV
fwrite($o, $data);
}
fclose($f);
fclose($o);
return true;
}
}

$v = new MPGtoFLV("video.mpg", "output.flv");

Herbert01
11-18-2010, 08:41 PM
I'm sorry this is an old thread, but I want to use PHPVIDEOTOOLKIT in pure php emulation only to get thumbnails from flv videos for my php-gallery-script and I cant find good informations. If I'm right, this should be possible and shown in example11.php, but by trying it I just get these errors:

Notice: Undefined variable: buffer in [...]/phpvideotoolkit.php5.php on line 764
Warning: exec() has been disabled for security reasons in [...]/phpvideotoolkit.php5.php on line 764
Notice: Undefined variable: buffer in [...]/phpvideotoolkit.php5.php on line 765
Warning: implode() [function.implode]: Invalid arguments passed in [...]/phpvideotoolkit.php5.php on line 765
Notice: Undefined offset: 0 in [...]/phpvideotoolkit.php5.php on line 784
Notice: Undefined offset: 2 in [...]/phpvideotoolkit.php5.php on line 788
Notice: Undefined offset: 1 in [...]/phpvideotoolkit.php5.php on line 789
The frame, 1 does not exist.

Is it really not possible to create an thumbnail from a flv video on pure php emulation with PHPVIDEOTOOLKIT? If not, is there any other alternative? (pure php)

Thanks for all requests!

faca5
11-19-2010, 04:34 AM
Hello.

MPEG -> FLV
FFMPEG

Herbert01
11-19-2010, 09:27 AM
Hello.

MPEG -> FLV
FFMPEG

Sorry, I dont understand, what you want to tell me :confused:

larwilliams
11-19-2010, 03:26 PM
I'm sorry this is an old thread, but I want to use PHPVIDEOTOOLKIT in pure php emulation only to get thumbnails from flv videos for my php-gallery-script and I cant find good informations. If I'm right, this should be possible and shown in example11.php, but by trying it I just get these errors:

Notice: Undefined variable: buffer in [...]/phpvideotoolkit.php5.php on line 764
Warning: exec() has been disabled for security reasons in [...]/phpvideotoolkit.php5.php on line 764
Notice: Undefined variable: buffer in [...]/phpvideotoolkit.php5.php on line 765
Warning: implode() [function.implode]: Invalid arguments passed in [...]/phpvideotoolkit.php5.php on line 765
Notice: Undefined offset: 0 in [...]/phpvideotoolkit.php5.php on line 784
Notice: Undefined offset: 2 in [...]/phpvideotoolkit.php5.php on line 788
Notice: Undefined offset: 1 in [...]/phpvideotoolkit.php5.php on line 789
The frame, 1 does not exist.

Is it really not possible to create an thumbnail from a flv video on pure php emulation with PHPVIDEOTOOLKIT? If not, is there any other alternative? (pure php)

Thanks for all requests!

Hi,

The problem is that your host has the "exec" function disabled for PHP. Contact them and ask why, and see if they will enable it for you.

Herbert01
11-20-2010, 09:50 AM
I know. But example11.php dont have to use exec, because it should run in pure php emulation without extended modules, because it says:

This example shows you how to use the ffmpeg-php adaptor scripts. NOTE: Please note whenever possible you should use ffmpeg-php as it is much more efficient than this pure PHP emulation.

larwilliams
11-20-2010, 01:08 PM
I know. But example11.php dont have to use exec, because it should run in pure php emulation without extended modules, because it says:

This example shows you how to use the ffmpeg-php adaptor scripts. NOTE: Please note whenever possible you should use ffmpeg-php as it is much more efficient than this pure PHP emulation.

Yes, the toolkit you are using has a pure PHP emulation of "ffmpeg-php" itself. However, ffmpeg (the underlying program used by ffmpeg-php and php video toolkit to do the hard work) itself has to be accessed using the "exec" function.

The reason PHP Video Toolkit claims to offer emulation of ffmpeg-php is because that extension is still required by many PHP video scripts, and it is not compatible with the latest versions of PHP. I know this for a fact, because I tried to get it to work on our servers and never could since PHP 5.2

Herbert01
11-21-2010, 04:45 PM
Ok, thank you for your answer.
I have found now a good looking solution, will try it today.
For all who has the same problem: FLV4PHP website: h**p://fanno.dk/

Bye

larwilliams
11-21-2010, 04:54 PM
Ok, thank you for your answer.
I have found now a good looking solution, will try it today.
For all who has the same problem: FLV4PHP website: h**p://fanno.dk/

Bye

I don't think that will work for you. It says that it doesn't support PHP5, which most hosts are using nowadays.

Herbert01
11-22-2010, 03:08 PM
I tested it now on bplaced php5 webspace and it worked fine. Speed was ok, too. The script helped me a lot!

faca5
11-25-2010, 08:38 AM
Sorry, I dont understand, what you want to tell me :confused:

Hello.

For converting movie link .avi, .mpeg etc... you can use ffmpeg. This program tools allow to use on web host if you have enoght permission to run files.

From command line you can give all nesesary to convert file from mpeg to flv file.