Quote:
|
Originally Posted by j-ray
maybe a permission problem unless /usr/bin/tcprobe is executable for everybody including apache user
|
hmm.. I thought I put that in my original post, but I guess I edited it out. Yes, tcprobe is executable by all.
I've made a bit of progress, however, but it has uncovered more mysteries -
if I make stderr go to stdout, I get the expected results even through the browser:
PHP Code:
if (!exec('/usr/bin/tcprobe 2>&1',$output,$error)){
echo "bad exec<br>\n";
echo "error: $error<br>\n";
}else{
echo "good exec<br>\n";
$count = 0;
echo "<br>";
foreach ($output as $i){
echo "$count - $i<br>\n";
$count++;
}
}
which returns this:
Code:
good exec
0 - tcprobe (transcode v1.0.2) (C) 2001-2003 Thomas Oestreich
1 -
2 - Usage: tcprobe [options] [-]
3 - -i name input file/directory/device/host name [stdin]
4 - -B binary output to stdout (used by transcode) [off]
5 - -H n probe n MB of stream [1]
6 - -s n skip first n bytes of stream [0]
7 - -T title probe for DVD title [off]
8 - -b bitrate audio encoder bitrate kBits/s [128]
9 - -f seekfile seek/index file [off]
10 - -d verbosity verbosity mode [1]
11 - -v print version
However, if I pass a real arg to tcprobe, I only get the first line of output. The following code outputs the next bit:
PHP Code:
if (!exec("/usr/bin/tcprobe -i $vid 2>&1",$output,$error)){
echo "bad exec<br>\n";
$count = 0;
echo "error: $error<br>\n";
}else{
echo "good exec<br>\n";
$count = 0;
echo "<br>";
foreach ($output as $i){
echo "$count - $i<br>\n";
$count++;
}
Code:
good exec
0 - [tcprobe] Apple QuickTime movie file
... but it *should* output this:
Code:
[tcprobe] Apple QuickTime movie file
[probe_mov.c] video codec=jpeg
[tcprobe] summary for Hummer.mov, (*) = not default, 0 = not detected
import frame size: -g 720x486 [720x576] (*)
frame rate: -f 30.000 [25.000] frc=5 (*)
no audio track: use "null" import module for audio
length: 901 frames, frame_time=33 msec, duration=0:00:30.033
... which is what it does output if I run the php from the command line.
Any ideas?