Raw stream viewer
Raw stream viewer
I wrote simple application that can show the new raw format. It reads the stream from standard input. It is fully functional and can display one camera at time. If you run few instances of it you can get more cameras.
To run it you need to set QUERY_STRING variable.
To do this: write export QUERY_STRING="mode=raw&monitor=1&scale=100" in your terminal.
Then run the application zms with passing its output to xlib_raw.
To do this write:/usr/cgi-bin/zms | xlib_raw -x 100 -y 100 -w 352 -h 288 -s 100 -c 6 -l 305
Now explanation of command line options
-x window x postion
-y window y postion
-w width of monitor
-h height of monitor
-s scale - at start use 100
-c number of bytes used to display frame lenght - you can count it by multiplying monitorwidth*monitorheight*3. THe number of digits is your -c
-l lenght of zms header on start
That's all I think. Please test it and post your comments. Probably it has some bugs:)
Here you can download it and see a screenshot:
http://dig.hopto.org/xlib_raw/
It works only on display with 24bit color depth, and maybe on 32bit, but I'm not sure.
@James you can use my part of code in your viewer.
To run it you need to set QUERY_STRING variable.
To do this: write export QUERY_STRING="mode=raw&monitor=1&scale=100" in your terminal.
Then run the application zms with passing its output to xlib_raw.
To do this write:/usr/cgi-bin/zms | xlib_raw -x 100 -y 100 -w 352 -h 288 -s 100 -c 6 -l 305
Now explanation of command line options
-x window x postion
-y window y postion
-w width of monitor
-h height of monitor
-s scale - at start use 100
-c number of bytes used to display frame lenght - you can count it by multiplying monitorwidth*monitorheight*3. THe number of digits is your -c
-l lenght of zms header on start
That's all I think. Please test it and post your comments. Probably it has some bugs:)
Here you can download it and see a screenshot:
http://dig.hopto.org/xlib_raw/
It works only on display with 24bit color depth, and maybe on 32bit, but I'm not sure.
@James you can use my part of code in your viewer.
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
Just in time to reply :
that works perfectly. i could transform a system from a P4 3.2 Ghz 1G memory showing 16 cameras at 3 fps each on the screen to a Sempron 2.4 512 Mb memory showing the same 16 monitors in a live montage with raw streaming and it is much faster than a p4 3.2 with firefox.
At this time 95 % processor idle.
Thanks
Victor Diago
that works perfectly. i could transform a system from a P4 3.2 Ghz 1G memory showing 16 cameras at 3 fps each on the screen to a Sempron 2.4 512 Mb memory showing the same 16 monitors in a live montage with raw streaming and it is much faster than a p4 3.2 with firefox.
At this time 95 % processor idle.
Thanks
Victor Diago
Thanks for testing. I didn't test it in big system. Good to see that it works with 16 cameras at time.
I also make a viewer that reads directly from shm. It is somehow better than the current one, because it doesn't use zms to read images.
But I have one problem maybe someone can help.
The problem is that zm sets permissions to shm to user what is running apache. I would like to run viewer as normal user(not root, not www-data).
Can this be simply achieved without changing the creation permissions of shm data? Maybe someone knows?
The problem also occurs when using current viewer(with zms) - it must be run from root or www-data.
I also make a viewer that reads directly from shm. It is somehow better than the current one, because it doesn't use zms to read images.
But I have one problem maybe someone can help.
The problem is that zm sets permissions to shm to user what is running apache. I would like to run viewer as normal user(not root, not www-data).
Can this be simply achieved without changing the creation permissions of shm data? Maybe someone knows?
The problem also occurs when using current viewer(with zms) - it must be run from root or www-data.
Here is viewer that reads directly from shm.
http://dig.hopto.org/xlib_shm/
@Victor please test it if you can.
ps. It can't have any lags
http://dig.hopto.org/xlib_shm/
@Victor please test it if you can.
ps. It can't have any lags
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
Thank you for your time into this, as it has been on every ones wish list for a while. Have you chosen a license to put it under yet, and if so which one?
Regards,
Corey
Regards,
Corey
Last edited by cordel on Mon Nov 06, 2006 9:45 am, edited 1 time in total.
3939663646337
It's better to keep your mouth shut and appear stupid than open it and remove all doubt.
-Mark Twain
I'm not a familiar with all the license stuff.cordel wrote: Thank you for your time into this, as it has been on every ones wish list for a while. Have you chosen a license to put it under yet, and if so which one?
You can do what you want with the code and use it commercial. I will be glad if you make a patch or something and make it public as I done.
If you want I can include some license info, but please tell me what exactly.
Do you have any wish list for this prg?
I'll have to take a look at how to implement it. If you would like it open source like ZM Phil uses the GNU GPL.
If you would like I can also take care of it for you, Just email the source over and I can add the license into it and get it posted
Just make sure I have your Full name in the email so I can make the proper Copyright.
Again, Thank you for the time you put into this.
Corey
If you would like I can also take care of it for you, Just email the source over and I can add the license into it and get it posted
Just make sure I have your Full name in the email so I can make the proper Copyright.
Again, Thank you for the time you put into this.
Corey
OK the source code is in the url of program. Please add the license info if you can. In two words GNU GPL means that you can do anything with the code but if you used it you have to make your program GNU GPL?cordel wrote:I'll have to take a look at how to implement it. If you would like it open source like ZM Phil uses the GNU GPL.
If you would like I can also take care of it for you, Just email the source over and I can add the license into it and get it posted
Just make sure I have your Full name in the email so I can make the proper Copyright.
Again, Thank you for the time you put into this.
Corey
Probably today I'll make some improvments.
I think of config file, cycle view, multiple monitors in one program. If someone have some fast and simple rescalling algorythm I will be thankful.
Thanks I added license info and fixed some problems with xlib_shm. Xlib_raw still the same.cordel wrote:Done. See PM
@Victor
Have you tested the xlib_shm? Is it working for you? If not please tell me what is happening.
@everyone
Can you post some ideas for program? What options would you like to have in it?
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
Maciekc, i havnt tried your viewer, but if development with you is progressing i could drop working on the linux one i have as you seem to know more about what your doing than me.
If your making an app for linux, obviously viewing is important, you need various split screen types ie quad, 9 way 16 way etc. Also playback.
A problem that i have had for a while now is multicam playback (i was thinking of limiting it to 4 way playback max.
I also think the interface should be mouse only (or keyboard not needed but usefull) as a keyboard gets in the way, plus if you felt flash a touchscreen would be great.
I dont think it needs to be to amazing as its the software on the machine and the more it does is less power is available to zm. (Plus its a damn site harder to work on, on the development side lol )
Just my 2 pence mate.
PS whats it written in?
If your making an app for linux, obviously viewing is important, you need various split screen types ie quad, 9 way 16 way etc. Also playback.
A problem that i have had for a while now is multicam playback (i was thinking of limiting it to 4 way playback max.
I also think the interface should be mouse only (or keyboard not needed but usefull) as a keyboard gets in the way, plus if you felt flash a touchscreen would be great.
I dont think it needs to be to amazing as its the software on the machine and the more it does is less power is available to zm. (Plus its a damn site harder to work on, on the development side lol )
Just my 2 pence mate.
PS whats it written in?
James Wilson
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk