Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : How to use TIdHTTP.Get to get just the first n bytes from a file?
| Subject: | How to use TIdHTTP.Get to get just the first n bytes from a file? |
| Posted by: | "Ricardo Villela Coppola" (coppo..@csp.com.br) |
| Date: | Fri, 1 Dec 2006 13:32:34 |
Hi folks,
We have an HTTP server that hosts ".asf" video files from a 24/7
surveillance system in 5 minutes chunks for playback.
We use a customized version of VLC to play them but from inside a
GUI front end develop in Delphi. Every thing works just fine but
recently our costumers asked for a better interface and one of the
aspects they required is the ability to see the files' actual
duration since they can be in the middle of a 5 minute chunk
recording or might be incomplete due to some hardware or software
fault. To do this I need to query each file's header that resides
in the first 134 bytes. I can get the header using the OnWork event
and issuing a Disconnect after at least 134 bytes are received.
My problem is the time it gets to fill the whole list that can easily
get to more than 1500 files. Each header fetch does not take really
much time but for 1500 files the extra bytes accumulate to a undesired
amount of time. I can very well wait to fetch each file's duration by
the moment the user selects it, actually this is the approach I'm taking
right now, but I'd like to be able to construct a time line of areas and
cameras so the user can have a more complete view of its surveillance
solution.
So, my question is: How can I get just 134 bytes form the start of each
file using TIdHTTP?
TIA,
--
Ricardo Villela Coppola (CSP Controle e Automação Ltda)