Page 1 of 1

FFMPEG related, anyone has used this ?

Posted: Wed Oct 10, 2007 7:51 pm
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.

Posted: Wed Oct 10, 2007 9:01 pm
by feyd
What, exactly, are you lost on?

Posted: Wed Oct 10, 2007 10:58 pm
by Kieran Huggins

Posted: Thu Oct 11, 2007 7:49 am
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: