FFMPEG related, anyone has used this ?

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
sobuj
Forum Newbie
Posts: 4
Joined: Wed Oct 10, 2007 7:35 pm

FFMPEG related, anyone has used this ?

Post by sobuj »

Hi guys

I wanted to use ffmpeg, but unable to figure out how to go about it ... I will greatly appreciate if someone can help me out.

So, when user uploads a file using a form, at one point of stage we have something like

Code: Select all

$movie=$_FILES['movie'];
When uploading a file directly, ie, without any flv conversion, we use simply something like

Code: Select all

ftp_put($conn_id, 'public_html/folder/'.basename('myMovie.mpg'), $movie['tmp_name'], FTP_BINARY);
However, I understand that here things are different, and between these two lines somewhere the ffmpeg will come into play, and convert the mpg or avi file to flv file. And this is where I am lost.

Can anyone help ? Thanks a lot for your time.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What, exactly, are you lost on?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

sobuj
Forum Newbie
Posts: 4
Joined: Wed Oct 10, 2007 7:35 pm

Post by sobuj »

Thanks guys

well, this is exactly where I'm lost, the basic codes ... :)

I tried the code Kieran Huggins gave, but it seems that I am having a problem for

Code: Select all

$srcFile = "/path/to/clock.avi";
I tried both

Code: Select all

$srcFile = $_FILES['movie']['name']; 
//and 
$srcFile = $_FILES['movie']['tmp_name'];
but it seems that neither is correct.

On using

Code: Select all

$srcFile = $_FILES['movie']['name'];
I am getting an error saying

Code: Select all

Warning: Can't open movie file dc3.avi in /home/usr/public_html/post.php on line XX
and on using

Code: Select all

$srcFile = $_FILES['movie']['tmp_name'];
I'm getting an error

Code: Select all

Warning: Can't open movie file /tmp/phpCoeQKQ in /home/usr/public_html/post.php on line XX
Later, I tried -

Code: Select all

$upl = "ffmpeg -i $_FILES['movie']['name'] -ar 22050 -ab 32 -f flv -s 320x240 /home/usr/public_html/movie/1192122954.flv";
exec($upl);


Result => no error messages, neither any .flv in the movie/ directory.

Hmmm ... what's the right way !!! :roll: :roll: :roll:
Post Reply