Page 4 of 4
Posted: Thu Dec 08, 2005 1:43 pm
by zoneminder
I'm about 99% certain it's not something in zms. The streaming daemon only has access to the normal ring buffer of images which only goes back a few seconds.
I suspect that the buffering occurs either in the httpd of the server or in the client player. The only reason I can think that the server would buffer it would be if the streaming daemon was squirting out video faster than it could put it on the network. However I've done some tests here and over a low bandwidth connection streaming jpegs for one minute produces about 1360Kb of content and does not lag at all, whereas one minute of asf or swf produces less than a third (~400Kb). So I think it must be buffering it in the client somewhere as I get lags with Gb network in between.
I'm not really sure of a way to absolutely prove this short of sniffing the network traffic at both ends and comparing the timings.
Phil
Posted: Thu Dec 08, 2005 9:19 pm
by victor_diago
Hi hil.
You mean that if i set image buffer ring to 1 i should have no lag ?
I thoght that is a problem with zms because this only happens when you are using ffmpeg with zoneminder. if you only use native jpeg streaming, there is no problem. if its server related should happen in jpeg streaming too, but it doesnt and if it is a client buffering, should it occur the same way in Internet explorer and firefox both with asf or swf streaming ?
Thanks a lot from now.
Victor Diago
Posted: Thu Dec 08, 2005 9:43 pm
by caseystone
I think he meant that ZMS can't get behind by more than the size of the ring buffer.
So, if the ring buffer holds say 20 frames at 5 fps, it could only possibly serve 4 seconds late.
-Casey
Posted: Thu Dec 08, 2005 9:56 pm
by victor_diago
Hmmmm
Ive got it.
But even i dont understand how jpeg streaming that also use httpd server and firefox client works well (except for the extreme cpu usage and memory consumption, also high bandwidth waste)
Victor Diago
Posted: Fri Dec 09, 2005 12:04 am
by zoneminder
The main difference is that with swf and asf etc and native jpegs is there is a plugin handling the content. Effectively this takes the browser out of the picture and what the plugins do buffering-wise is very hard to determine.
Phil
Posted: Fri Dec 09, 2005 12:13 am
by victor_diago
Hmmm.
im sorry, ive run asf directly by mplayer acessing the
http://path to zms/ with all the options set to no buffer. and also ive got the delay.
So if we change to a realplayer stream or something else that is exactly to live video we should be ok ?
Any clue about what could be good ? i will keep searching this night.
Should VLC ->
www.videolan.org be the solution ?
Thanks For all
Victor Diago
Posted: Fri Dec 09, 2005 12:17 am
by zoneminder
Ultimately I have no idea where the delay might be happening but I would be very surprised if it is with zms. One way to find out might to monitor the memory usage of all the various elements to see what keeps growing forever (half an hour of buffered video has to live somewhere) but the other way is to run ethereal or something at the server and client ends and try to match up some individual packets to figure out what the time in transit is.
Phil
Posted: Fri Dec 09, 2005 12:19 am
by jameswilson
my 3 pence again
i think as there seperate streams and using 3rd party players we may well always have this problem maybe due to each mplayer getting a little more or less proc time than the others, would it be possible on the client side just to restart the stream every say 30 mins. i dont suppose anydody thought we would use the players in this way
Posted: Fri Dec 09, 2005 12:27 am
by zoneminder
I don't think you can just restart an open stream, though you could skip frames to bring them up to date, but this is what zms already does if it gets stuck any time.
The stream frames are supposed to be tagged with timestamp information which lets the players determine the chronology of them but I don't know how to work out if this is being correctly applied or not. This tagging is optional, via ZM_VIDEO_TIMED_FRAMES, but it is on by default.
This may be an area that needs more investigation.
Phil
Posted: Fri Dec 09, 2005 12:41 am
by victor_diago
Surely is !
Restart open stream is just bad idea , ive tried and it doesnt work well... event because you can get delay after a few minutes of streaming.
Well, this is freak area... how might the surveillance we already know threat that ? ive seen many of them running in not so good computers very well...
I know that a lot of people wants to get this working, so let see if we reach any point... this thread is new created and we can see for the quantity of people that are here that this would be lovely !
Thanks for now, i will keep searching
Victor Diago
Posted: Fri Dec 09, 2005 12:47 am
by jameswilson
well im gonna want to sort it when i have an mpeg module for zm4ms, but as im not very good with linux i havnt got mpeg streaming working on any of my boxes, when i do and i have something to test against ill knock up a little viewer that will do say 4 stream,s just for testing so we can see whats going on at the client end (windows only im afraid victor)
JAmes
Posted: Tue Jan 03, 2006 11:05 am
by SyRenity
Hi.
I don't think you can just restart an open stream, though you could skip frames to bring them up to date, but this is what zms already does if it gets stuck any time.
The stream frames are supposed to be tagged with timestamp information which lets the players determine the chronology of them but I don't know how to work out if this is being correctly applied or not. This tagging is optional, via ZM_VIDEO_TIMED_FRAMES, but it is on by default.
This may be an area that needs more investigation.
Phil
Could you please more elaborate on the zms frame skipping? Is it a feature, or it's simply to the nature of the ring buffer (which limits the zms side number of frames)?
Also, can you point me to the source code where the tagging occurs? I would like to give it some look.
Posted: Tue Jan 03, 2006 11:09 am
by SyRenity
Hi.
well im gonna want to sort it when i have an mpeg module for zm4ms, but as im not very good with linux i havnt got mpeg streaming working on any of my boxes, when i do and i have something to test against ill knock up a little viewer that will do say 4 stream,s just for testing so we can see whats going on at the client end (windows only im afraid victor)
Do you plan to have a browser plug in version of the mpeg module? That could solve the lagging issue (if you won't do any buffering, that is).
Posted: Tue Jan 03, 2006 1:52 pm
by jameswilson
i dont think im caperble of writing browser plugins but i will see if i can port it once its written. I would have to write an activex module and i think this would be ie only. I doubt it but i will see. Dont hold your breath though as all the work im ccurrently doing is on jpeg viewing. I do want mpeg but i will only be in a position to start that once i have an rpm for 1.22 that will be a while yet.
Sorry
James