Exec('ffmpeg...'): "no such file or directory"

software development

#1

I’m working on a project where I email a video to a special email address, and the attached video is saved in a web-accessible folder and re-encoded as Flash video.

The script works great up until the re-encoding. Essentially I have a procmail recipe that sends the email to a PHP script in ~/email. The video is saved, and then a command-line call to /usr/bin/ffmpeg is made using exec(), but I get this:

sh: line 1: /usr/bin/ffmpeg: No such file or directory

Now, the exec(‘ffmpeg…’) call works perfectly when I run it from mydomain.com/script.php, so the difference must be that it’s being called by the procmail recipe? Is it for some reason being run on a different server that doesn’t have ffmpeg installed? If so, how can I point it back to the server that does have ffmpeg?

Thanks for your help!


#2

Could it be that you’re not running with a path so you can find /usr/bin/ffmpeg?

This is a common issue when working with cron.

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


#3

Nah, I’ve tried running both with and without “/usr/bin/”.

When an email is received, is the procmail recipe invoked by cron, though? This is the area where I’m fuzzy.


#4

I dunno… Let’s see what the wiki.dreamhost.com has to say:

This is the only link I found:
http://wiki.dreamhost.com/Procmail

Maybe it’ll help you - I didn’t see anything obvious there. (I’ve not done procmail scripts)

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