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.
VF
Posts: 26
Joined: Wed Sep 23, 2009 7:41 am

Access denied using xlib_shm

Post by VF » Fri Dec 11, 2009 8:40 am

Hi, I'm experiencing this problem using this viewer.
When I try to run it with my user, or with root user, reports this error:

"Access denied for user 'myuser'@'localhost' (using password: NO)"
"Access denied for user 'root'@'localhost' (using password: NO)"

Could someone help me? Thanks a lot!

johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

external pc

Post by johnnytolengo » Fri Dec 11, 2009 10:22 pm

is it possible to run this streamer from an external linux pc?

thanks

craver84
Posts: 96
Joined: Sun Aug 31, 2008 7:35 am

Post by craver84 » Wed Dec 16, 2009 10:17 am

Hi everyone. I have just bought a new PC for my ZM

Gigabyte - GA-MA785GMT-UD2H Socket AM3
Processor AMD Phenomâ„¢ II X2

I installed zm following this guide: http://www.zoneminder.com/wiki/index.ph ... ola-0.7%29
and it works great but I still have problems with xlib_shm:

Code: Select all

paolo@videosorveglianza:~/xlib$ sudo ./xlib_shm -m2 -k 0x7a6d0000
xlib_shm viewer for zm 1.24.1 version 0.6.4
imgx=0 imgy=0
delay=10000
shmkey=7a6d0000
monitors:2 
Found 1 Xv adaptors
WARNING: Couldn't find free Xv adaptor with RGB XvImage support
Falling back to ximage - slow and ugly rescalling
shared_data_size=9217192
ERROR: Failed to shmget
ENOENT - segment doesn't exist
in other topics, people say that the shared memory must be checked.
How can I do this?
What shall I put here?
kernel.shmall = XXXXXXXXXXXXXX
kernel.shmmax = XXXXXXXXXXXXX

Please please please help me.......[/code]

nexusplay
Posts: 1
Joined: Thu Dec 17, 2009 2:49 pm

Raw stream viewer

Post by nexusplay » Thu Dec 17, 2009 2:58 pm

Hi, ive spent ages scowering the nets and zoneminder on a how to topic for geting this to work,

ive installed zoneminder 1.24.2 on ubuntu 9.10

works fantasictly

only issue is that when running the montarge screen from the linux box i get reported frames of 20fps but only a realistic frame rate of 1fps

when i log in via the network on a windows pc and view montage i get real time footage

thinking that a raw stream viewer would be the awnser i started looking onto this post. just cant seem to get it setup, noob fail


i followed the step by step guide on zoneminder wiki page for ubuntu and it works flawlessly

p.s
ive installed nvidia drivers and upgraded my gfx card from mx440 to a fx5600 still have low rates, i think its firefox

Thanks in advance

craver84
Posts: 96
Joined: Sun Aug 31, 2008 7:35 am

Post by craver84 » Fri Dec 18, 2009 10:10 am

Ok, now xlib_shm works!
I have just installed it from the karmik repository and after that it works great...
now the problem is that sometimes it crashes.


/var/log/messages

Code: Select all

Dec 18 07:09:38 videosorveglianza zmdc[12613]: INF ['zmc -m 2' starting at 09/12/18 07:09:38, pid = 32390]
Dec 18 07:09:38 videosorveglianza zmc_m2[32390]: INF [Debug Level = 0, Debug Log = <none>]
Dec 18 07:09:38 videosorveglianza zmc_m2[32390]: INF [Starting Capture]
Dec 18 07:09:38 videosorveglianza kernel: [73277.846429] xlib_shm[12688]: segfault at b773a000 ip 0804af1d sp bff731b0 error 4 in xlib_shm[8048000+4000]
Dec 18 07:10:00 videosorveglianza zma_m4[12645]: INF [axisM1031: 75196 - Closing event 1250, section end]
Dec 18 07:10:00 videosorveglianza zma_m4[12645]: INF [axisM1031: 75196 - Opening new event 1252, section start]
does anyone understand it?

VF
Posts: 26
Joined: Wed Sep 23, 2009 7:41 am

Xlib_shm

Post by VF » Sat Dec 19, 2009 11:23 am

Please could you report us the exact procedure to install this from Karmic, and make it works?
I mean the procedure you used to make it works.

I still have the same problems (and I could not locate that package in karmic reps )
Thanks a lot!

alecano23
Posts: 22
Joined: Thu Oct 23, 2008 1:47 pm

Post by alecano23 » Sat May 01, 2010 2:45 am

Please post the way you install on Ubuntu Karmic please !!!!!

alecano23
Posts: 22
Joined: Thu Oct 23, 2008 1:47 pm

Post by alecano23 » Sun May 09, 2010 8:55 am

I have discovered that my problem getting work xlib_shm under karmich 9.10 and zm 1.24.2 was because I have it compiled with mmap shared memory, and xlib_shm only works with IPC shared memory. I tried recompiling zm but I keeps on writting data on /dev/shm, and nothing I try seems to switch from mmap memory to IPC shared memory.

So when I have enough time Iam going to make a clean install from zero of a zm 1.24.2 with IPC shared memory, Iam sure with this config Xlib_shm should work well !!!!!

VM: perhaps this is your problem too!!! check it out !!!!

gsupp
Posts: 4
Joined: Tue Jun 22, 2010 9:44 pm

Color/split problem with xlib_shm-0.6.4 (gl and non-gl)

Post by gsupp » Thu Jul 08, 2010 7:44 pm

I'm running CentOS 5.5, ZM 1.24.2 compiled from source, the proprietary nvidia video driver, screen resolution is 1280x1024 (have also tried 1024x768) and set to 24bpp (have also tried 32bpp, X will not start). All cameras are set to 24-bit color in ZM. I have tried xlib_shm-0.6.4 and xlib_shm-0.6.4-gl with the same results. The exact command I am using is "./xlib_shm -m15 -m25 -m18 -m20 -m14 -m16 -m21 -m12 -m4 -m13 -m1 -m11 -m2 -m3 -m23 -m24 -m17 -m22 -m26 -m19 -c4". I have two main problems:

First, the colors on the video streams are incorrect and the video image is split vertically, with the right 1/3 of the video is displayed on the left (please see https://www.n1gallery.com/g2/d/46329-2/ ... _issue.png). EDIT: This happens with xlib_raw as well. I've tried the nvidia driver, the nv driver, 1280x1024 (24 and 16 bit color depth) and 1024x768 (24 and 16 bit color depth). I'm not sure what else could be causing this or what to check next.

Second, we have 20 cameras on our system and typically display the video streams in a 5 column, 4 row layout (on a widescreen LCD monitor--1360x768). I notice xlib_shm only supports a 16 camera layout (4 columns, 4 rows). Would it be possible to add additional camera layout options? Perhaps accepting any number for the "-c" parameter and displaying as many rows as needed to show all the monitors would be more flexible. EDIT: I can use xlib_raw which allows 1 monitor per window, window positioning and scaling to accomplish this.

m1001101
Posts: 5
Joined: Tue May 18, 2010 12:42 pm

Re: gutsy and switching between DAY and NIGHT

Post by m1001101 » Fri Aug 20, 2010 11:05 am

Thinh wrote:i have two state , DAY = record and Night = Modect
i have created a script that runs in crontab
Here is the script



Day.sh
#!/bin/sh
#
#
#
if zmpkg.pl DAY $1
then
echo "$(date) PHASE 1 SWITCHING ZONEMINDER TO DAY MODE: SUCCESFULL" >> /var/log/mysqlcheck.log
status=1
else
echo "$(date) PHASE 1 SWITCHING ZONEMINDER TO DAY MODE: FAIL" >> /var/log/mysqlcheck.log
fi

if [ $status -eq 1 ] && xlib_shm-gl -m11 -m6 -m5 -m3 -m4 -m14 -c3 -k 0x7a6d0000 $1
then
echo "$(date) PHASE 2 STARTING XLIB_SHM-GL: SUCCESFULL" >> /var/log/mysqlcheck.log
else
echo "$(date) PHASE 2 STARTING XLIB_SHM-GL: FAIL" >> /var/log/mysqlcheck.log
fi
You can put xlib_shm start command in loop, and when cron switch state, after this kill xlib_by cron, so the loop script relauch automatically xlib in correct display.

I made this dirty solution for my ZM and work! :D

m1001101
Posts: 5
Joined: Tue May 18, 2010 12:42 pm

Re: gutsy and switching between DAY and NIGHT

Post by m1001101 » Fri Aug 20, 2010 12:33 pm

m1001101 wrote:
Thinh wrote:i have two state , DAY = record and Night = Modect
i have created a script that runs in crontab
Here is the script



Day.sh
#!/bin/sh
#
#
#
if zmpkg.pl DAY $1
then
echo "$(date) PHASE 1 SWITCHING ZONEMINDER TO DAY MODE: SUCCESFULL" >> /var/log/mysqlcheck.log
status=1
else
echo "$(date) PHASE 1 SWITCHING ZONEMINDER TO DAY MODE: FAIL" >> /var/log/mysqlcheck.log
fi

if [ $status -eq 1 ] && xlib_shm-gl -m11 -m6 -m5 -m3 -m4 -m14 -c3 -k 0x7a6d0000 $1
then
echo "$(date) PHASE 2 STARTING XLIB_SHM-GL: SUCCESFULL" >> /var/log/mysqlcheck.log
else
echo "$(date) PHASE 2 STARTING XLIB_SHM-GL: FAIL" >> /var/log/mysqlcheck.log
fi
You can put xlib_shm start command in loop, and when cron switch state, after this kill xlib_by cron, so the loop script relauch automatically xlib in correct display.

I made this dirty solution for my ZM and work! :D
Another solution that I have tested this morning using xterm.
Put in your cron this command:

Code: Select all

xterm -display :0 -iconic -e "/usr/sbin/xlib_shm [...your options...]" &
ICONIC: I use this option to prevent visualization of xterm over xlib window.

When you want to kill xlib by cron after ZM switch state use a command like:

Code: Select all

killall xterm
in your cron script.

Pada
Posts: 69
Joined: Fri Jul 30, 2010 12:29 am

Post by Pada » Fri Oct 15, 2010 3:06 am

Here is my latest version of xlib_shm, where I've done the following modifications:
1) getting shm_key from database, instead of letting the user specify it as a parameter
2) mmap support (basically just copy/paste from zm_monitor.cpp IIRC)
3) not crashing when config file not found

I've also modified the zms to take command-line arguments and output to the stdout.
This way I can pipe its output to like cvlc for streaming and I've managed to pipe it to mplayer,
however I can't get mplayer to work with it any more. Here is my latest copy of my source code. * To compile it you'll have to compile it with the ZM 1.24.2 source code.

I still have to implement something to detect when zmc goes offline, because this currently causes errors that aren't trivial to connect to the ZM's offline state :(

If you guys have more requests / fixes that you would like, I can see what I can implement in two weeks' time, because I'm currently busy with a big project.

Pada
Posts: 69
Joined: Fri Jul 30, 2010 12:29 am

Post by Pada » Thu Oct 21, 2010 3:20 pm

OK, I've quickly applied the changes that I've made to xlib_shm-0.6.4 to xlib_shm-0.6.4-gl too.
Here's my copy of the OpenGL version: http://www.mediafire.com/file/no6c53cvi ... ada.tar.gz

I've done a few quick tests with a single 640x480 @ 15fps mpeg stream test on my i7 940:
xlib_shm-0.6.5-gl: 1-2% CPU
zms: 5-6% CPU
xlib_shm-0.6.5: 11-14% CPU

So the OpenGL viewer is quite impressive :)

Ratax22
Posts: 2
Joined: Sat Nov 06, 2010 8:44 am

Post by Ratax22 » Sat Nov 06, 2010 8:46 am

Where I can download the source code for 32 bits?
The all links are broken.
Thanks...

Pada
Posts: 69
Joined: Fri Jul 30, 2010 12:29 am

Post by Pada » Sat Nov 06, 2010 9:27 am

Ratax22: you have to recompile it from source.

The links that I've given in my previous 2 posts are working.
Alternatively you could download the old versions here: http://www.zoneminder.com/wiki/index.php/Xlib_shm

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests