'Twas brillig, and Rene Veerman at 10/12/08 23:03 did gyre and gimble:
Well, nowhere can i find the frame count being printed, but there _is_ a
duration: hh:mm:ss:ms field outputted, and the updating line displays a
time=seconds.ms (the time in the movie where the encoder is at).
The question remains how to get at that updating output, with exec() you
get the output after it's done completely.
And there's no way to do partial conversions with ffmpeg, it's all in
one or nothing..
IIRC you can use popen and just read the output into PHP.
http://uk.php.net/manual/en/function.popen.php
That said, if I were you I'd do this system slightly differently. I'd do
the submissions via the web, but then do the encoding as a kind of
daemon process/cron job that runs on the server. This cron job would do
the encoding and update a db table periodically with progress. That way
you can have a page the user goes to that sees their "job progress".
This way the user's browser will not time out and you wont use up apache
connections waiting for encodings and also you wont kill your server by
performing multiple encodes at the same time - with the cron job/daemon
approach you can control how many jobs are performed at the same time
and thus limit the load.
Just some thoughts.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php