NameSilo

Executing Linux files from PHP

Spacemail by SpaceshipSpacemail by Spaceship
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
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
Do you have PHP Safe on?

Try shell_exec

iNod.
 
1
•••
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
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back