Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Executing Linux files from PHP

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

JustinWI

Established Member
Impact
0
I have installed ffmpeg on my VPS so I can encode movies to FLV on the fly. It runs fine from the command line, but not when calling from php. I have set the permissions on the file and folder to 777 but it still doesnt work. I have also tried setting the ffmpeg to 777 and that didnt change anything. The only output I can get from php about an error is "1". I am current using system() but tried exec() as well. Here is my code :
PHP:
$vid2flv = system('ffmpeg -i /home/mctv/www/files/video/$uploadfile -acodec mp3 -ar $samprate -ab $bitrate -f flv -s 320x240 -aspect 4:3 -y /home/mctv/www/files/video/$flvFile', $err_msg);

I have copied that whole command line to my SSH and replaced it with the actual numbers passed through and the command will run.
Thanks
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Do you have PHP Safe on?

Try shell_exec

iNod.
 
1
Close
I actually just messed with it a little more and got it to work. I had to add '/usr/local/bin/' before 'ffmpeg...'.

Do any of you guys know a workaround to get ffmpeg to read WMV9 and above?

Thanks
(rep added)
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back