Jump to content

exec()


chiprivers

Recommended Posts

Further to my previous post, I have made some headway with my video script.  If I run the 'Video Encoder for Adoble Flash' through the command line, I have a prompt like this:

 

C:\Program Files\SourceTec\fvec>

 

And I can do a basic video encode with default settings like this:

 

C:\Program Files\SourceTec\fvec> fvec C:\xampp\htdocs\video\inputFile\input01.wmw C:\xampp\htdocs\video\outputFile\output01.wmv.flv

 

where "C:\xampp\htdocs\video\inputFile\input01.wmw" is the input video file and "C:\xampp\htdocs\video\outputFile\output01.wmv.flv" is the resulting output file.

 

The above works but I can not get this same operation to work using the exec() command in PHP.

 

I am using the following:

 

<?php

$systemDrive = "C:\Program Files\SourceTec\fvec\fvec.exe"; // location of programme to run
$inputFile = "C:\xampp\htdocs\video\inputVideo\input01.wmv"; // location of input file
$outputFile = "C:\xampp\htdocs\video\outputVideo\output01.wmv.flv"; // location of output file

$command = $systemDrive." fvc ".$inputFile." ".$outputFile;

$result = exec($command);

?>

 

However this is not working, Can anybody help with this? I have googled and googled and I cannot find any help on the net with integrating these two interfaces!

Link to comment
Share on other sites

I think the problem may possibly be something to do with first calling the program to run the command.

 

From what I undestand, when you use the exec() function it will run the command from the c:\> prompt, do I need to do something first so that I am have changed to C:\Program Files\SourceTec\fvec> before executing the command?

Link to comment
Share on other sites

Cmd doesn't handle spaces and some other things all that well.... Try something like

 

exec('"c:\program files\your\program\thingy.exe" "c:\some\input\file.wmv" "c:\some\output\file.flv"');

 

This may be the problem cos if I run this straight on the command prompt it only reads the line as far as c:\program and fails, I guess because of the space. HOw would I get around this?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.