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.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

maciekc, you know you mentioned i could use the code in my viewer, can i look at the code so as to see how you have achived shared mem access. I assume there is a jpeg in ram is there or does it work in a different way, ie this raw thing?
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
maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc »

jameswilson wrote:maciekc, you know you mentioned i could use the code in my viewer, can i look at the code so as to see how you have achived shared mem access. I assume there is a jpeg in ram is there or does it work in a different way, ie this raw thing?
Yes no problem - the source is in the package.

Shared mem access is functions shmget shmat.
The images in the memory are raw - not jpeg maybe there are also jpegs, but I didn't looked for them. The rgb images are simpler to use than jpegs and you don't have to decompress them.
If you have any questions please write to me.
GOOD LUCK with shm!

I have now some rescalling not yet included in the source, but I will try to use xvideo extension for this work - should be better because the rescallling, converting, and displaying will be done by graphics card not by main CPU.
I downloaded some testxv source that is example for xvideo I can mail it for you if you want.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

im not that far along with it yet, i was just wondering about changing the linux viewer i have to work with shared mem. It looks like a mine field lol. I was only curious so i caould mull it over in my head for a while, while i thought about the end game for the linux viewer. Am i right in thinking this raw viewer opens indivual windows per monitor
?
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
maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc »

jameswilson wrote:It looks like a mine field lol. I was only curious so i caould mull it over in my head for a while, while i thought about the end game for the linux viewer.
Could you explain what you mean? I'm not an englishmen...
jameswilson wrote:Am i right in thinking this raw viewer opens indivual windows per monitor
?
The version 0.3 - xlib_shm opens one window and up to 32(this could be simply changed by editing src). The monitors are positioned automatically(not resized - only scale=100%). My next goal is to use xvideo to display the pictures that would eat less CPU time, and probably will do also all the rescalling stuff.

xlib_raw is the other game:) - I probably won't make any updates of it - maybe only if someone wants.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

jameswilson wrote:
It looks like a mine field lol. I was only curious so i caould mull it over in my head for a while, while i thought about the end game for the linux viewer.


Could you explain what you mean? I'm not an englishmen...
I like to think about the problem for a while before starting to write code
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
semotta
Posts: 20
Joined: Wed Jun 29, 2005 11:39 pm
Location: Sao Paulo, Brazil

Post by semotta »

maciekc wrote:
semotta wrote: # ./xlib_shm -m 1
xlib_shm viewer for zm 1.22.0 version 0.3
imgx=0 imgy=0
delay=10000
shmkey=7a6d2000

monitors:1
ERROR: Failed to shmget

Any other hint?

Sergio
Probably not running zm. Start it with zmpkg.pl start
ZM is running. I can access through http.
Or you are trying to run xlib_shm on other user than zm(you should run it from the same user as www and zm - in debian www-data in other distros nobody, wwwuser and so on), you can also run it as root - for cheching if that was the fault.
I was already trying to run xlib_shm as root.

What else could I try?


EDIT: After posting I tried again and it worked! Sorry for I was doing something wrong. Thanks for your patience.
Sergio
maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc »

semotta wrote:
maciekc wrote:
semotta wrote: EDIT: After posting I tried again and it worked! Sorry for I was doing something wrong. Thanks for your patience.
Sergio
No problem...
Did you test it with diffrent monitor sizes? Does it work? I'm really curious and couldn't check it by myself.
jameswilson wrote: I like to think about the problem for a while before starting to write code
So you are opposite of me. I'm first trying to write. Of course it doesn't work, or work badly, next I'm googling and thinking...
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

Code: Select all

So you are opposite of me. I'm first trying to write. Of course it doesn't work, or work badly, next I'm googling and thinking...
lol no i do that too, but i need to have a clue where to start and at the moment i have none.

PS of course i dont plan my code that would be just plain organised, professional and daft...lol

JAmes
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
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

Hi macieck


Ive run your software until now. it works VERY WELL. dont stops and maintain all sync.


but as we know zm 1.22.0 is a bit buggy. can you make a port to 1.21.4 ?

ive tried to change shm structure but no success.

Please, could you help us ?

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

Post by maciekc »

victor_diago wrote:Hi macieck
Ive run your software until now. it works VERY WELL. dont stops and maintain all sync.
but as we know zm 1.22.0 is a bit buggy. can you make a port to 1.21.4 ?
ive tried to change shm structure but no success.
Please, could you help us ?
Victor Diago
I will take a look at this.
Which version of xlib_shm do you want to have ported?
I will then try to explain you how to do this - what you have to change.

ps. The version using xvideo is almost done - now you will be able to rescale image with beautiful antialiasing and without any cpu usage - everything is done inside graphics card.

---ADDED:
I have looked at this.
You have to change struct shareddata. That should be all. Simply find it in zm_monitor.h - lines 126-142 and copy to the source of xlib_shm. I don't want to install zm-1.21.4 because I have already installed 1.22.0 on my machine.
maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc »

new version - 0.4
Now I'm using xvideo extension to display images - it should be compatible with every new graphics card - I have RIVA TNT, and it works without any problems.
Now you are able to display up to 32 monitors they are automatically adjusted, positioned, and resized to perfectly fit the screen or window size.
Usage is the same as in 0.3 except options -w -h - they specify window width and height. If they are not specified - window size is your resolution(fullscreen). When you change window size monitors are also resized.

Please test it, and tell if there are any bugs.
My next goal is to make simple GUI with buttons.
http://dig.hopto.org/xlib_shm/

If you want a screenshot please write. I will make one for you.

ps. maybe I should change the name and start new topic zm_gui? What do you think?
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

Hi.


Thanks, Congratulations for the perfect work.


We all in the zoneminder community has to thanks you.


Is this able to run in 1.21.4 ?


Thanks for now

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

Post by maciekc »

victor_diago wrote: Is this able to run in 1.21.4 ?
After a little modification it should work.
Maybe I'will check this out this weekend.
Did you tried to change shm structure what I wrote few days ago?
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

Hi maciekc

Man all works like a charm.

Im wondering if there is a way to, view remotelly with your viewer. i mean, is there a way to write your system output to a file with ffmpeg´s help, encode it with divx and view remotely with ffplay or something like ?


Your software sure is a important step for zoneminder.


Thanks you and much congratulations.

Victor Diago
krattai
Posts: 3
Joined: Thu Apr 13, 2006 3:28 pm

Post by krattai »

I'm trying to get a copy of this to try, but looks like you've run into a problem on your server, maciekc.

Any idea when it'll be available again?

Cheers...
Post Reply