[FONT="Arial"]
After an exhaustive search I found a hosting company that has ffmpeg as part of its shared hosting package. Just as importantly they allow PHP's system() call. What I couldn't get an answer to is whether or not the ffmpeg.so module is available, which is how I create thumbnails on my dev box. I first thought working without ffmpeg.so was no big deal and I can work around it. But...
First I tried creating a thumbnail from a video:
system("ffmpeg -i /var/www/video/513.wmv -vcodec png -vframes 1 -an -f rawvideo -s 320x240 -y /var/www/uploads/testit.png", $what);
Sure enough I had an image, how cool is that.
Next to get the runtime from that video:
$filename = '/var/www/video/513.wmv';
$ffmpegcmd = 'ffmpeg -i '.$filename.' |grep -i duration';
$ret = system($ffmpegcmd, $err);
Hmm, nothing appeared but a 1 (error) from the shell, no big deal and a quick edit will fix that:
$filename = '/var/www/video/513.wmv';
$ffmpegcmd = 'ffmpeg -i '.$filename.' 2>&1|grep -i duration';
$ret = system($ffmpegcmd, $err);
echo '<br />command returned: '.$err.'<br />';
echo 'Returned string was: '.$ret;
I was dismayed to see printed in the test web page:
Duration: 00:04:08.9, start: 3.100000, bitrate: 281 kb/s
command returned: 0
Returned string was: Duration: 00:04:08.9, start: 3.100000, bitrate: 281 kb/s
Notice that; Duration: 00:04:08.9, start: 3.100000, bitrate: 281 kb/s is printed twice.
Is there a way to keep the unwanted text from printing or will I have to write the output to a file and then read the value from the file?
Thanks
[/FONT]