Raw stream viewer

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Raw stream viewer

Post by maciekc » Fri Jan 27, 2006 4:16 pm

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.

User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago » Mon Feb 06, 2006 8:17 pm

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

User avatar
zoneminder
Site Admin
Posts: 5220
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder » Mon Feb 06, 2006 11:58 pm

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.
Phil

User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago » Tue Feb 14, 2006 11:57 pm

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

maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc » Wed Feb 15, 2006 2:52 pm

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.

maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc » Wed Feb 15, 2006 7:52 pm

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

User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago » Thu Feb 16, 2006 1:35 pm

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

maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc » Thu Feb 16, 2006 3:35 pm

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.

User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle
Contact:

Post by cordel » Thu Feb 16, 2006 7:57 pm

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
Last edited by cordel on Mon Nov 06, 2006 9:45 am, edited 1 time in total.
Image
Image
3939663646337

It's better to keep your mouth shut and appear stupid than open it and remove all doubt.
-Mark Twain

maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc » Thu Feb 16, 2006 8:40 pm

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?

User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle
Contact:

Post by cordel » Thu Feb 16, 2006 11:41 pm

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

maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc » Fri Feb 17, 2006 1:37 pm

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.

User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle
Contact:

Post by cordel » Fri Feb 17, 2006 9:59 pm

Done. See PM

Regards,
Corey

maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc » Mon Feb 20, 2006 9:03 pm

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?

jameswilson
Posts: 5109
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK
Contact:

Post by jameswilson » Tue Feb 21, 2006 9:38 am

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests