Page 1 of 14

Raw stream viewer

Posted: Fri Jan 27, 2006 4:16 pm
by maciekc
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.

Posted: Mon Feb 06, 2006 8:17 pm
by victor_diago
Man,

Really thanks, that is just fantastic.

Thanks for that.


Just a question, have you experienced any delay or lag in a long run, for example 1 hour or some like that ?

The other viewers that used the ffmpeg always had a increase lag.

Victor Diago

Posted: Mon Feb 06, 2006 11:58 pm
by zoneminder
Thanks for coming up with the viewer, it sounds like it will be very useful.

Victor, the raw format does not use ffmpeg, in the same way that streaming jpegs don't so it should not suffer from lags in the same way that mp-jpegs don't.

Posted: Tue Feb 14, 2006 11:57 pm
by victor_diago
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

Posted: Wed Feb 15, 2006 2:52 pm
by maciekc
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.

Posted: Wed Feb 15, 2006 7:52 pm
by maciekc
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

Posted: Thu Feb 16, 2006 1:35 pm
by victor_diago
I will try it just today.


only a question, does it work with all versions of ZM since it reads directly from Shm ?


Thanks for now

Victor Diago

Posted: Thu Feb 16, 2006 3:35 pm
by maciekc
I've tested only with 1.22.0. If the shm structure is the same it will work. Give it a try. You can simply change the shm structure - copy it from zm_monitor.h to my source and recompile.

ps.
This viewer cannot rescale images - the previous one could by using zms scale option.

Posted: Thu Feb 16, 2006 7:57 pm
by cordel
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

Posted: Thu Feb 16, 2006 8:40 pm
by maciekc
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?
I'm not a familiar with all the license stuff.
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?

Posted: Thu Feb 16, 2006 11:41 pm
by cordel
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 :wink:
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

Posted: Fri Feb 17, 2006 1:37 pm
by maciekc
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 :wink:
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?

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.

Posted: Fri Feb 17, 2006 9:59 pm
by cordel
Done. See PM

Regards,
Corey

Posted: Mon Feb 20, 2006 9:03 pm
by maciekc
cordel wrote:Done. See PM
Thanks I added license info and fixed some problems with xlib_shm. Xlib_raw still the same.

@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?

Posted: Tue Feb 21, 2006 9:38 am
by jameswilson
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?