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
https://forums.phpfreaks.com/topic/62042-exec/
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
https://forums.phpfreaks.com/topic/62042-exec/#findComment-308913
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
https://forums.phpfreaks.com/topic/62042-exec/#findComment-309666
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.