By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,521 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,521 IT Pros & Developers. It's quick & easy.

convert mpg to flv using php

100+
P: 134
hi

i m having a page in which users may upload their own videos .

And i need to convert it into flv file to run the uploaded file in player..

is there any sources available ..

i tried ffmpeg., it works in localhost fine but when i upload it into my server no conversion occurs...

thanks

regards
vijay.
Apr 9 '10 #1
Share this Question
Share on Google+
6 Replies


chathura86
100+
P: 227
ffmpeg works for me fine.

what is the problem you got with it

Regards
Apr 9 '10 #2

100+
P: 134
i followed the steps provided in this link
http://worldtv.com/blog/guides_tutor..._converter.php

and downloaded the files and copied it into my local apache server and checked for the file conversion..

it works fine.,

but when i tried the same steps by uploading the files into the webserver no new flv files where generated...

this is the code present in the file..
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. exec("ffmpeg -i football.mpg football.flv");
  3. ?>
  4.  
is there anyother thing that i would need to do ?
Apr 9 '10 #3

Atli
Expert 5K+
P: 5,058
Hey.

What are the differences between the servers?
(Operating systems, version differences, configuration, etc...)

Note that that tutorial seems to deal with Windows executables. If you are using Windows on your test server, but your real server uses Linux (which is very common) then your Windows executable ffmpeg.exe file won't work. You will need to Linux equivalent.

Also, it's not uncommon that shared hosts disable exec, and other such functions, as they can pose a security threat. Are you using such a host? - If you are, you might want to inquire as to whether they allow this.
Apr 9 '10 #4

100+
P: 134
yes the file i downloaded deals with windows..

i searched through the net and downloaded the files for linux .,

but i have no idea of about how to deal with those linux files.,

can you suggest me a good way to complete this conversion..

thanks
Apr 9 '10 #5

Atli
Expert 5K+
P: 5,058
I've never worked with ffmpeg myself, so I don't really know how to set it up manually.

If you are working on a common Linux distribution, you can try to see if it exists in the distro's package manager.
For example, on Ubuntu (and most likely all Debian-based distros), you can issue this command to install ffmpeg:
Expand|Select|Wrap|Line Numbers
  1. $ sudo apt-get install ffmpeg
And I'm guessing RedHat/Fedora distributions can do something like this:
Expand|Select|Wrap|Line Numbers
  1. $ yum install ffmpeg
Try those and see if that works. If not you will probably have to compile it from source. Unless you can find a precompiled binary package compatible with your system.
Apr 9 '10 #6

100+
P: 134
thank you for your reply..

As i told i dont know linux so i m not quite right where to execute the code and bring out the output..

if you find anyother links that could help me please do send me..

thanks again..
Apr 9 '10 #7

Post your reply

Sign in to post your reply or Sign up for a free account.