Re: [PHP] Re: converting a vid with ffmpeg - howto do progress bars?
- From: geek.de@xxxxxxxxx ("German Geek")
- Date: Thu, 11 Dec 2008 14:20:31 +1300
On Thu, Dec 11, 2008 at 1:53 PM, Rene Veerman <rene7705@xxxxxxxxx> wrote:
Colin Guthrie wrote:
'Twas brillig, and Rene Veerman at 10/12/08 23:03 did gyre and gimble:Yep, this is already how it works.. Cron calls a php controller daemon
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
script (if it aint runnin yet), which reads the various open tasks, and
executes one task step (convert & import a single media file) at a time for
each open task.
It terminates after no more tasks have steps to do.
The scripts executing the task update a status JSON file in the tasks'
working directory, which is the only thing being read by the browser after
it's kicked off the import process by calling the daemon server with the
list of files to import.
i've taken a look at popen() and think i can indeed get it to work with
that..
i'll let you all know in this thread where to view a demo, when it works :)
Cool, would like to see it in action.
In case you haven't thought of this and it's relevant:
If ffmpeg is writing out a file and you can estimate the final size, you
could check the file size, if it's growing that is, and compare it to the
estimated final size to show the progress. Maybe not the best solution but
if there is nothing else.
If you don't mind, i would like to know some good parameters for ffmpeg to
convert video files to flv format. Might use it in the future.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Tim-Hinnerk Heuer
http://www.ihostnz.com
- Follow-Ups:
- Re: [PHP] Re: converting a vid with ffmpeg - howto do progress bars?
- From: Rene Veerman
- Re: [PHP] Re: converting a vid with ffmpeg - howto do progress bars?
- References:
- converting a vid with ffmpeg - howto do progress bars?
- From: Rene Veerman
- Re: [PHP] converting a vid with ffmpeg - howto do progress bars?
- From: Ashley Sheridan
- Re: [PHP] converting a vid with ffmpeg - howto do progress bars?
- From: Rene Veerman
- RE: [PHP] converting a vid with ffmpeg - howto do progress bars?
- From: "Boyd, Todd M."
- Re: [PHP] converting a vid with ffmpeg - howto do progress bars?
- From: Rene Veerman
- Re: converting a vid with ffmpeg - howto do progress bars?
- From: Colin Guthrie
- Re: [PHP] Re: converting a vid with ffmpeg - howto do progress bars?
- From: Rene Veerman
- converting a vid with ffmpeg - howto do progress bars?
- Prev by Date: Re: [PHP] Can GD make a JPG thumbnail of a PDF?
- Next by Date: Re: [PHP] how to not show login info in the url ...what am I looking for?
- Previous by thread: Re: [PHP] Re: converting a vid with ffmpeg - howto do progress bars?
- Next by thread: Re: [PHP] Re: converting a vid with ffmpeg - howto do progress bars?
- Index(es):
Relevant Pages
|