LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-26-2005, 01:52 AM   #1
dtra
Member
 
Registered: Nov 2004
Distribution: fc4
Posts: 104

Rep: Reputation: 15
[php] accessing command line


hi all

i am writing a script for video uploads with conversion
just want to see if this is possible

PHP Code:
$flags ' -i /home/httpd/vhosts/example.com/httpdocs/temp/' $tempOrigVideo ' -ar 22050 /home/httpd/vhosts/example.com/httpdocs/videos/' $uploadedVideo;

$execVideo '/usr/local/bin/ffmpeg ' $flags;
exec($execVideo); 
the script ends up looking like
"/usr/local/bin/ffmpeg -i /temp/video.avi -b 100 -vcodec mpeg4 -ar 22050 /final/video.mp4"

i can't seem to get that to work, i can run that command from the command line
i can run the php script from the command line and the file is output correctly
but when trying to run the command from a browser nothing happens

i can run a simple command like "ls" from the browser

i have tried chmodding everything to 777 but that didn't do anything
any ideas?
i've also tried chown, chgrp to apache for ffmpeg, but still nothing

safe_mode is off

[update]
nm, it was cos the original video file didn't have the permissions

thanks
dave

Last edited by dtra; 04-26-2005 at 03:33 AM.
 
Old 04-26-2005, 08:19 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Re: [php] accessing command line

Quote:
Originally posted by dtra
[update]
nm, it was cos the original video file didn't have the permissions
That's actually what I was going to suggest first while reading until I saw your update.

I think another way of doing this or running the command would be something like this so its all in one line and you wouldn't need to have the separate exec line:

Code:
$execVideo = system(''/usr/local/bin/ffmpeg ' . '$flags'');
Or something along those lines.. might even make your code look cleaner if you setup a variable for the path of the command or so on..

Cheers.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing command line arguments from a library function? tojo2 Programming 3 05-25-2005 04:56 PM
Command Line PHP in Slack 10 Trano Slackware 4 02-12-2005 06:16 PM
Command Line PHP on Mandrake Dilireus Linux - Software 2 08-04-2004 06:46 PM
php from command line odious1 Linux - Software 4 05-03-2004 01:31 AM
Accessing samba shares from command line paul.nel Linux - Software 4 01-24-2004 09:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration