SOLVED: [new idea] autologin for simple montage wit firefox

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

SOLVED: [new idea] autologin for simple montage wit firefox

Post by krzys31337 »

I'm setting up really simple "DEMO" box.

It has 15" 1024x768 LCD display for seciurity officer.

I'm running firefox like that:

=montage&group=0&mymagic=xxx&luser=u&lpass=p'

Changing top of file zm_html.php:

And got as far as "username:" filled with "u" (of course without ZM_OPT_USE_AUTH it works OK -- montage seems good for 4 cameras 2 fps each).

Maybe some advices how to do it better ? (another idea will be modify zm*html*php when it has "_GET[password]" and copy it to _SESSION but it's a crude way).

But this solution works for me and allows to convice some manager to find additional Euros/USDs for ZM.

Code: Select all

//ini_set( "magic_quotes_gpc", "Off" );

require_once( 'zm_config.php' );
require_once( 'zm_lang.php' );
require_once( 'zm_funcs.php' );
require_once( 'zm_actions.php' );

if ( ZM_OPT_USE_AUTH )
{
        session_start();
        if ( isset( $_SESSION['user'] ) )
        {
                $user = $_SESSION['user'];
        }
        elseif ( isset( $_GET['mymagic']) )
        {
                userLogin($_GET['luser'],$_GET['lpass']);
        }
        else
        {
                unset( $user );
        }
btw: find /usr/lib/mozilla-firefox/greprefs/all.js and set:

Code: Select all

// limit the absolute number of http connections that can be established per
pref("network.http.max-connections-per-server", 16);
pref("network.http.max-persistent-connections-per-server", 16);
pref("network.http.max-persistent-connections-per-proxy", 16);
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Good. I'm glad you got it working. I think you _should_ be able to just use an url to log in and display but I've not tried and if your solution works then so much the better and I'm sure other people will be interested.

Phil
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

Post by krzys31337 »

Some other thougts:

It's good to do:

Code: Select all

xset dpms 0 0 0
The patch against 1.21.3 (works with 1.21.X) is here:

http://cvs.pld-linux.org/cgi-bin/cvsweb ... _get.patch

And/or have this in X11.conf:

Code: Select all

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "void"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "void"
EndSection
Option          "DPMS" "False"
And run firefox in some watchdog loop (kill it every 1..24 hours?)
Some screenshot (1'st try) (images were taken by "xvidcap",
mpeg/avi files were done using ffmpeg, load average while capturing was somwhere 3.5~3.8).

[/code]

Image

and after some clickety-clicking...

Image
--
Best Regards and sorry for my poor english...
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

Post by krzys31337 »

Here you will find pictures and some mpg file.
http://pancake.sggw.waw.pl/~hunter24/bttv/

Should I put this thread in Contrib forum?
--
Best Regards and sorry for my poor english...
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

Post by krzys31337 »

Phill,

Please some advice and your voice on subject:

i'm in some strategic point:

Yes, it's a blank X11, w/o even simplest window manager and fetching:

/cgi-bin/zms?mode=single&monitor=5&user=r&pass=r&maxfps=5

Are you interested in that stuff, maybe it would be better to skip X11 and use DirectFB or SDL?
Are they images in shm in jpeg-encoded format or they are some how "raw" ?

Image

The app takes pics and checks response code (304 in http-lang means "not modified"):

Code: Select all

Got 200 from http_headers() - 26331 bytes of content
Got 304 from http_headers()
Got 200 from http_headers() - 26436 bytes of content
Got 200 from http_headers() - 26351 bytes of content
Got 304 from http_headers()
Got 200 from http_headers() - 26420 bytes of content
Got 200 from http_headers() - 26420 bytes of content
Got 304 from http_headers()
Got 200 from http_headers() - 26369 bytes of content
Got 200 from http_headers() - 26426 bytes of content
Got 200 from http_headers() - 26329 bytes of content
Note:
some "1 + 5" shema (known from hardware video spliter) is also possible:


Image


Overhead on using mozilla-firefox on my box is not that big:

Image
--
Best Regards and sorry for my poor english...
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

I emailed Roy Souther as a courtesy asking him about eLViS. He said basically he has no problem with us adapting eLViS to work with ZoneMinder. I'll take a look at the code as I know there have been many requests for such an interface. Thank you for pointing this project out.
Regards,
Cordel
Image
Image
3939663646337

It's better to keep your mouth shut and appear stupid than open it and remove all doubt.
-Mark Twain
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

Post by krzys31337 »

Yeap it will look like the good thing, some unification with motion (other monitoring software).

Note: elvis looks into jpg files, but ZM already has streaming part (zms as a cgi...) and shm interface which should be more then faster from file acces.

Right now I'm collecting some data (2xbttv on 2.4 Ghz celeron with 512 MB ram) and running "firefox" with montage of 4 cameras (PAL 380x240, RGB565 each one). I'm collecting only system load every 60s. It stays beetwen 0.15 to 0.30.

After some search on the net I've found some project (namely here: http://cvs.sourceforge.net/viewcvs.py/s ... talkercam/) and hope it could help me in droping load.
Using zms in "single" mode and quering second by second looks good -- not having firedup firefox gives me extra 90MB of ram!

Also i'm not using any thing exept libjpeg and X11 (not even a QT3).

If someone will explain/dropme a line about content/multipart I will replace executing CGI every minute for every frame with just having 4 CGI runnig.
It should also drop system load.

For simple montage on localhost we don't need any more then 1 FPS per each monitor, right?
--
Best Regards and sorry for my poor english...
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

Post by krzys31337 »

ok i've found that:

zm_image.cpp

bool Image::initialised = false;
unsigned char *Image::abs_table;
unsigned char *Image::y_r_table;
unsigned char *Image::y_g_table;
unsigned char *Image::y_b_table;

It looks like raw image, so taking data from here and writing to X11/DirectFB would be the most efficent way, right?
--
Best Regards and sorry for my poor english...
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

I think the best idea would be to work on having the app pull strait from the memory (shm) to keep the overhead down. another possiblity is to use loopback but I don't know if all the distros have that compiled into the kernel so some research is in order before going the later direction. One fps should be suitable and easy to accomplish but I think it might be fesable to see 5 fps or better with out to much load or overhead.
Regards,
Cordel
Image
Image
3939663646337

It's better to keep your mouth shut and appear stupid than open it and remove all doubt.
-Mark Twain
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

Post by krzys31337 »

.a
Last edited by krzys31337 on Sun Jul 17, 2005 9:10 am, edited 1 time in total.
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

Post by krzys31337 »

Ok, got some stats (might be very inacurate).

The method is:

every miniute do:
/usr/bin/rrdtool update load.rrd N:$(cut -d " " -f 1 /proc/loadavg)

At "10:00" i've shut down firefox, and run 4 processes "leeching" jpgs with 1 fps and rendering to X11.

After 10:40 i've add montage (2 fps) from antother host by net.

As we can see, it's obvious. Local montage is worth implementing without browser or java.

Image
--
Best Regards and sorry for my poor english...
Locked