Page 6 of 49
Posted: Mon Nov 21, 2005 11:03 pm
by jameswilson
i am playing around with this recording function and thought you might like to take a look. Its nowhere near finished and not fully tested by any means. But if you want to have a look ive put it up on my server as zm4msbeta.zip. Its got the newest main parts but has additional bits available from map view live viewer.
Its only on the live viewer (mapview) currently but if i decide to continue with this then ill make it available from the main window.
Basically it records the current view (if you change view it keeps recording) at a rate of 2 fps (bandwith allowing) to the local hard disk as successive jpegs. I have put a limit of 20000 in for the moment but i though 10000 seconds would do. It creates events as zm would do ie 1 then2 then 3 etc etc. App remebers your last event so on pressing record will create a new event. Pressing play will open another experimental window allowing you to playback a previous event, just enter the event number in the box and press play. You can use the slider to vary the playback speed or slowly go backwards if you overshot what you were looking for. Pressing pause or moving the speed slider all the way left pause the current view.
Let me know if this is liked??

Posted: Mon Nov 21, 2005 11:23 pm
by jameswilson
BTW i dont want to go to massive lengths with this as its not designed to be a recorder, thats what your using zm for, its supposed to be a front end for zm.
All i plan on making the local recorder do is record what you have viewed for audit or other purposes, plus to give me a starting point to get the playback module sorted for when i can playback zm footage.
James
Posted: Tue Nov 22, 2005 12:43 am
by jameswilson
oops sorry that one didnt even deserve to be called an alpha.
Check zm4msbeta again for half usable playback lol
Sorry
James
Posted: Tue Nov 22, 2005 12:51 am
by wa4bro
Hey James, Pretty neat from the map page. Looks like a handy feature to have to grab a seq of images while watching live.
Thanks for the changes in the main screen.
I am still having some issues with the url gets on ImageSalsa. I still don't quite understand the refeshing and why it will not stream the fixed .jpgs.
It starts up the image and runs for a few seconds then stops. Later it looks like a complete refesh starts it again for a few seconds and stops.
A standard browser grabs the images as fast as you can refesh, so this is where I am lost. For grins plug in this url in one of your boxes and take a look.
http://roswellweather.net:18080/480x390.jpg
Any ideas why it stops refeshing in the viewer. ZM works great on that end. It just seems to be the grabs from the jpg. that stalls out.
Dan
Posted: Tue Nov 22, 2005 12:58 am
by jameswilson
i have an image that refreshes about every 3 seconds and doesnt bomb out from that url, my gues is to increase your refresh rate and see if that helps as i cant achive 1 second rates here. I assume your accessing over lan. What im wondering (and ive seen this on some ip cams) is requesting images too quick causes problems, just for testing put your default refresh rate to say 5000 and dont maximise the camera view it it will try and update every 500 ms
just a thought
Changing refresh helped Some.
Posted: Tue Nov 22, 2005 6:58 pm
by wa4bro
James,
I played with refresh on many different extremes on the lan.
I was able to get it to play on the url grabs but only with much longer refresh rates than needed. I tried many different settings and eventually they all would freeze after a certain period of time.
Are you refeshing at fixed intervals or only after successful image download? Seems to be based on the universal refresh rate as far as I can see. You are right, I have seen that requesting before fully loading causes some problems. Especially with some of the java based scripts I have used in the past.
I am using a flash script on my Weather Website written by Dr. tim West
http://www.meteorologica.co.uk/downloads/CamStream.zip I worked with Tim on testing and adding many of the optional functions in the flash script. One thing that impresed me about the flash script was that it adjusted the download speed on the fly. It requests the image and tests the amount of time it takes to download then adjusts the stream refesh rates based on this. If the image gets out of sync, it locks for a moment, re-tests the refresh rate and resumes. This allows full usage on Fast or slow links and auto adjusts without the user having to set the params manually. It actually works quite well. Much bettter than any of the java based scripts I have ever tried.
I run three and have run 4 instances of the same script on this page
http://roswellweather.net/quad.html This runs from a rather slower DSL link on my SME Linux server at home. It slows pretty badly with higher traffic and the site is pretty popular. The thing I noticed is that while watching the seconds on each image sometimes the refresh is 1 second from remote to 3 seconds from remote depending on traffic, it keeps on ticking.
Your map view and capture looks good for a start. I did not get a chance to download your next update last night, but will try tonight. I noticed in the 1st. version that record/playback worked but was incomplete. Course I realized it was 1st attempt, but I think it will be a good feature.
Dan
Posted: Tue Nov 22, 2005 7:09 pm
by jameswilson
the update has the frce image update that will request a new image regardless of current load state.
The way the code works
Each camera view has a timer event on it (default is default refresh rate (1 sec))
this runs every x seconds dependant upon how many windows currently open and what the setting are in settings.
Every time it requests a new image it changes the value of a varaible from 0 to 1
when the image successfully loads the variable is changed to 0
at the next rtefresh time the image is only refreshed again if the variable is 0 so if you had a default refresh rate of 100 ms and a slow link the image would only be refreshed as fast as the link could handle.
Now if the image never loaded my code would never request a new image
Hence forced update.
Now the only thing i do differnet (and i may make a custom version to test this for you) is the old version requested an iamge url then refreshed the image, This version requestes a full url everytime (for various reasons) The old version requested a new image every x seconds regardless of wether the previous had loaded.
What id like you to do in the mean time is download the newer beta and change the force refresh to say 1000 and see if that fixes it. That way if that fixes you then it appears that the camera view window doesnt think it has got a full image even though the server may have finished sending (like a reg_net_exp zm issue).
Let me know
Posted: Tue Nov 22, 2005 7:14 pm
by jameswilson
ps i thought about timing download speed and keeping this value for future use but i dont always want to downlaod images as fast as possible (stange you may wonder). The main reason for me writing my app was for my use, and when 10 people connect to a server with 25 cams on it and make it refresh as fast as it can, strangly it struggles (at 1 fps that 250 ips never mind what its recording) so i made the option that its only fast when on smaller views.
I think from what you have said the force refresh will fix it on the particular images your having issues with. Am i right in thinking that zm works fine and some other servers but you have a problem with another one?
Posted: Tue Nov 22, 2005 9:52 pm
by jameswilson
oh and bad news on the create video code. Looks like i need to use windows media encoder. Before i add this to live viewer i will check it can be disabled otherwise this is gonna become a huge project
Posted: Wed Nov 23, 2005 12:40 am
by jameswilson
scratch previous post im gonna leave video creation for a while now as its taxing me way to much (its took me 2 days of searching and all i can find is info on how to do it in c#) so im gonna leave this for a while
Phil i have a question
I have finally worked out how to talk to mysql from .net
I can query the monitor table and the events table
I am going to create a wizard type thing that populates the settings page to enable easy instant view setup.
Playback wise i am planning (to start with anyway) to query mysql directly, and request the images via zms.
I am thinking of (will sleep on this) using a goto time/date sort of idea.
I assume once i work out the select query that mysql will return a list of matching events.
As the table gives me number of images etc can i assume that an event always starts with image 1 and ends with image <number of captured images>
Am i miles off here or on the right track?
Posted: Wed Nov 23, 2005 10:16 am
by zoneminder
Hi James,
That is correct. If you let me know what you want to get from the DB I can give you a suitable query as they can sometimes get a bit complex.
Phil
Posted: Wed Nov 23, 2005 11:43 am
by jameswilson
cheers mate,
I have done a bit more thinking on this and think im going o mke a single playback view with 4 screens ie like the instant review only smaller.
That way i can query the db to only show events from the relevant ip and monitor number so it should playback events from multiple machines.
Are the image names requested via zms alaways the same or do they change their name dependant upon what caused them
Posted: Wed Nov 23, 2005 6:42 pm
by wa4bro
jameswilson wrote:ps i thought about timing download speed and keeping this value for future use but i dont always want to downlaod images as fast as possible (stange you may wonder). The main reason for me writing my app was for my use, and when 10 people connect to a server with 25 cams on it and make it refresh as fast as it can, strangly it struggles (at 1 fps that 250 ips never mind what its recording) so i made the option that its only fast when on smaller views.
I think from what you have said the force refresh will fix it on the particular images your having issues with. Am i right in thinking that zm works fine and some other servers but you have a problem with another one?
OK James , No problems. Please don't spend too much time on this for me. I downloaded the latest beta and tried it out. I still had problems with the one cam program over the lan. Yes ZM works fine with it and that is the main goal. The url grab was a freebie <G> I did find one way to crash the program beyond repair and Had to reinstall it. You might want to set a param that will not allow you to enter a (0) ZERO for refresh rate ... I found out it will crash it and it will never reload without crashing after login <G> Leave it to me to really break it <G>
I just could not get the timing to ever work on that one program over the lan. I was trying many different rates but it still stalled. I still have not had the chance to load it here at work, but I did test it on another weather station user that is using Image Salsa and it did work and refershed fine for that one. So I suppose it still is a timing issue just over the lan. I did notice in the viewer the progress bar above the images. It stays full tilt on all my other images including zm images. When I did a remote grab from the other station's image I noticed the image progress bar starting from the left and moving to right as the image loaded and then did an immediate refresh and started over again from the left. No matter the timing I set, Mine over the lan stays full tilt to the right all the time. ( For whatever this is worth.)
I think for me it will work from remote, so please do not spend any more time on it on the url grab my behalf. I plan to eventually move all the cams in to ZM on SME 7.0 Server when it is released. I will then use Image Salsa to grab the images from ZM, which works like a champ and Image Salsa will overlay the images with the weather data.
On the Movie generation, yea it can be a pain with media encoder.
I use another Salsa program that generates an avi from a directory of .jpg images then call a dos batch file with media encoder 8 to make the wmv and delete old avi and actually the same batch file sends it by ftp off site after the generation.
I find the command line of media encoder 8 to work much better then the encoder 9 series, especially in scripting or batch file usage. It is still a pain and I know you are not trying to reproduce zm.
Take care and thanks for all your work!
Dan
Posted: Wed Nov 23, 2005 9:51 pm
by jameswilson
out of interest you are using a value in ms for the refresh settings?
I agree with the 0 comment i will alter it to allow 100 ms as the lowest value
Id like to get to the bottom of this issue even if its a bit main purpose if only for the curiosity value. If you set the force update to 1000 what happens then?
If you set al the refreshes to 20000 (20) seconds you shouldnt see the progress bar move on remote views
the reason they stay full tilt on lan is cos the image loads so fast you dont see it go down as it pulls the image in so quick, try using a huge jpg (like a couple of meg) that should slow the refresh rates down.
If force refresh dont work ill make a modified version that loads the images in the same way as version 1 did. I thought version 2 way w
s an improvement but in this case obviously not. let me know how it went
James
Posted: Wed Nov 23, 2005 11:45 pm
by wa4bro
jameswilson wrote:out of interest you are using a value in ms for the refresh settings?
I agree with the 0 comment i will alter it to allow 100 ms as the lowest value
Id like to get to the bottom of this issue even if its a bit main purpose if only for the curiosity value. If you set the force update to 1000 what happens then?
If you set al the refreshes to 20000 (20) seconds you shouldnt see the progress bar move on remote views
the reason they stay full tilt on lan is cos the image loads so fast you dont see it go down as it pulls the image in so quick, try using a huge jpg (like a couple of meg) that should slow the refresh rates down.
If force refresh dont work ill make a modified version that loads the images in the same way as version 1 did. I thought version 2 way w
s an improvement but in this case obviously not. let me know how it went
James
The timings all seem to work by looking at the seconds on the image overlay on the images I am grabbing. The behavior still all seems to be the same James. They all start working and at some point either seconds or maybe up to 3 mins with long frame grabs the image freezes on all the url grabs for me. Including the off lan image I was grabbing and though was working pretty good last night.
After some mins of it being frozen, I think your kick start timer kicks in and the image that was froze goes to a Blank X image for a second or so and then the image starts working again until it freezes again. Then the cycle starts over. It will stay frozen for a period. Go blank then restart.
I am wondering if on the url selcted boxes if you could request the frame, then when it has fully loaded, request at again? Maybe that would solve the problem or will the overall timing also apply to zm, which might casue your overload problem you mentioned earlier with several users.
Dan
PS: I lowered and upped both the forced and standard refreshes. It does change the timing correctly but with the eventual same overall results, afreeze and sometime later a restart.
Hope this might help.
Dan