FFmpeg


#1

OK, I was reading the wiki, FFmpeg and it says that FFmpeg is already installed on dreamhost. Is that true?

if so, I would like to know why this doesn’t work… any one know?

[quote]<?php
$loca = ‘…/…/tzfiles.com/users/ryan/file.mpg’;
$new = ‘…/…/tzfiles.com/users/ryan/file.flv’;
if(exec("/home/ryannaddy/bin/ffmpeg -i $loca -ar 22050 -ab 32 -f flv -s 320x240 $new"))
echo ‘SUCCESS!!!’;
else
echo ‘FAILED :(’;
?>[/quote]
the output says FAILED :frowning:


TzFiles.com


#2

Does the ffmpeg binary actually exist in “/home/ryannaddy/bin/ffmpeg”?

Perhaps you should run a which ffmpeg (from the shell) to discover the exact location of ffmpeg on your dreamhost server, and use that instead :wink:


Chips N Cheese - Custom PHP installs and the like!


#3

it is “/usr/bin/ffmpeg”

so I switched it, and it still doesn’t work.

Any ideas why now?

[quote]<?php
$loca = ‘…/…/tzfiles.com/users/ryan/file.mpg’;
$new = ‘…/…/tzfiles.com/users/ryan/file.flv’;
if(file_exists($loca)){
if(exec("/usr/bin/ffmpeg -i “.$loca.” -ar 22050 -ab 32 -f flv -s 320x240 ".$new))
echo ‘SUCCESS!!!’;
else
echo ‘FAILED :(’;
}else{
echo ‘File Doesn’t exist’;
}
?>[/quote]


TzFiles.com


#4

Browsing to http://tzfiles.com/users/ryan/ shows that /home/yourusername/tzfiles.com/users/ryan/file.mpg does not exist, so it should fail (even if your path to that file was correctly stated). :wink:

–rlparker


#5

OK, the file file.mpg is now there.

http://tzfiles.com/users/ryan/file.mpg

The file I was using had spaces in the file name.

If I remove the spaces it works.

What do I need to do to allow for the spaces? doesn’t work, I have tried it.


TzFiles.com


#6

Linux commandline tools do not like spaces…you should rename the file to eliminate spaces before processing it with ffmpeg.

–rlparker


#7

That is what I thought I had to do, thanks!

I was thinking:

  • rename the file to temp name
  • process
  • rename new file to old name

TzFiles.com


#8

You could always just add quotes… Then you don’t have to muck with filenames.

Wholly - Use promo code WhollyMindless for full 97$ credit. Let me know if you want something else!


#9

Yeah, that is what I just found out, thanks guys for all the help!


TzFiles.com