Raspbery Pi2 Camera Monitor w/Rpisurv

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
actually i just put it on dropbox for yeh, try this:
Code:
cd /tmp
wget 'https://www.dropbox.com/s/f3b4q60xjqzud1s/omxplayer-dist.tgz?dl=1' -O omxplayer-dist.tgz
tar -xzvf omxplayer-dist.tgz
sudo mv omxplayer-dist/* /
then restart that command.
 

ruppmeister

Getting the hang of it
Joined
Apr 15, 2015
Messages
668
Reaction score
98
I appreciate all the help. I am using your DB link to get the package now. I did install cyber duck and was able to SFTP the package over successfully too, so there is that. Just have to wait for the download to complete before I know if this thing plans to work or not.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
if you already transfered it with cyberduck just turn the last 2 commands w/Putty :)
 

ruppmeister

Getting the hang of it
Joined
Apr 15, 2015
Messages
668
Reaction score
98
Here is what I am seeing now. Still something wrong and I don't know what I am doing unfortunately.:(

Code:
pi@raspberrypi:/tmp $ tar -xzvf omxplayer-dist.tgz
usr/
usr/bin/
usr/bin/omxplayer
usr/bin/omxplayer.bin
usr/share/
usr/share/man/
usr/share/man/man1/
usr/share/man/man1/omxplayer.1
usr/share/doc/
usr/share/doc/omxplayer/
usr/share/doc/omxplayer/README
usr/share/doc/omxplayer/COPYING
usr/lib/
usr/lib/omxplayer/
usr/lib/omxplayer/libswresample.so
usr/lib/omxplayer/libswscale.so
usr/lib/omxplayer/libavutil.so.55
usr/lib/omxplayer/libavfilter.so
usr/lib/omxplayer/libavcodec.so
usr/lib/omxplayer/libavcodec.so.57.24.102
usr/lib/omxplayer/libavutil.so.55.17.103
usr/lib/omxplayer/libavdevice.so.57.0.101
usr/lib/omxplayer/libswresample.so.2.0.101
usr/lib/omxplayer/libavformat.so.57.25.100
usr/lib/omxplayer/libavutil.so
usr/lib/omxplayer/libavfilter.so.6
usr/lib/omxplayer/libavfilter.so.6.31.100
usr/lib/omxplayer/libavformat.so.57
usr/lib/omxplayer/libavdevice.so.57
usr/lib/omxplayer/libswresample.so.2
usr/lib/omxplayer/libavdevice.so
usr/lib/omxplayer/libavformat.so
usr/lib/omxplayer/libswscale.so.4
usr/lib/omxplayer/libswscale.so.4.0.100
usr/lib/omxplayer/libavcodec.so.57
pi@raspberrypi:/tmp $ sudo mv omxplayer-dist/* /
mv: cannot stat ‘omxplayer-dist/*’: No such file or directory
 

ruppmeister

Getting the hang of it
Joined
Apr 15, 2015
Messages
668
Reaction score
98
Sweet! It is working now without the tearing. I really appreciate all the help and back and forth on this.

Maybe tomorrow I will try again to get the script to work so I can add additional cameras. Thanks again @nayr!
 
Last edited by a moderator:

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
Excellent, great work for your first foray into linux!

I am working on my app now, just got the maths part down.. I am scoping it out so you'll be able to flash it to a SD card, connect to the IP address in a browser, configure the display and then start it up.. so no linux knowledge needed in the end.. but it'll take alot of work to get to that point from here.. the UI will be minimal, dont expect anything flashy.. with any luck I'll come with Domoticz on it ready to rock n roll if you want a nicer UI

I am planning on the following display modes:
  • 2x2 Grid (4 Cams)
  • 1x3 Ribbon (4 Cams)
  • 1x4 Ribbon (5 Cams)
  • 3x3 Grid (9 Cams)
  • 3x3 Grid w/2x2 Primary (6 Cams)
  • 4x4 Grid (16 Cams)
  • 4x4 Grid w/3x3 Primary (8 Cams)

should handle 4,5,6,8,9,16 pretty well I hope..

other features I want to implement:

  • Mute/Volume Buttons on WebUI & API
  • Fullscreen and auto restore on idle via WebUI & API
  • API/WebUI/Alarm Input to turn On/Off display externally w/Relay
  • MQTT/Domoticz Integration

just be patient, but it'll be worth the wait. :)
 
Last edited by a moderator:

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
ok ive got my first beta code up if anyone wants to give it a whirl: https://github.com/nayrnet/ipc-pi

this only does my ribbon display right now.. requires nodejs.

logged in as pi, in your home folder:
Code:
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
git clone https://github.com/nayrnet/ipc-pi.git
cd ipc-pi
mv config.example config.js
nano config.js
mv etc/systemd/ipc-pi.service /etc/systemd/system/
systemctl enable ipc-pi
as I fix bugs and add features you should be able to follow along on github and update with a:
Code:
cd ~/ipc-pi
git pull
features implemented:
  • Ribbon Calculations
  • 4-6 Camera Displays
  • Recover Dead feeds when possible.

todo:
  • Grid Display Calculations
  • Auto Pick Best Display
  • WebConfig & API
  • dbus control
 
Last edited by a moderator:

ruppmeister

Getting the hang of it
Joined
Apr 15, 2015
Messages
668
Reaction score
98
I will be trying this later today and let you know how it goes for the rookie like myself...hahaha


Sent from my iPhone using Tapatalk
 

ruppmeister

Getting the hang of it
Joined
Apr 15, 2015
Messages
668
Reaction score
98
Okay, had the chance to get through this and I am stumped on what to do next. I had to add a couple of extra things to your code to get it to work. I attached by complete CLI inputs for you to review and see if something went wrong with what I did.

I started with a fresh flash of Jessie before I attempted this. Only thing I did that is not included in the log is I:

  • changed keyboard layout to US
Code:
sudo raspi-config
  • Input my wifi info
Code:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
  • Installed git before I could clone the repo
Code:
sudo apt-get install git-core
  • Needed to use sudo on two commands for them to work
Code:
sudo mv etc/systemd/ipc-pi.service /etc/systemd/system/
sudo systemctl enable ipc-pi
Not sure how to make this display now is what I think I am missing. I appreciate all the help and your info last night made this sooooo much easier for me to get through this time around.
 

Attachments

ruppmeister

Getting the hang of it
Joined
Apr 15, 2015
Messages
668
Reaction score
98
what happens when you

Code:
cd ~/ipc-pi
./server.js
I had to run the second one as root (sudo) before it would take. Neither one gave any errors but nothing happened on screen either. Was I supposed to do all the things from post #29 in addition to what you had me do from post #46?
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
whats your config.js look like?

output should look something like:
Code:
# ./server.js 
resolution: 1680x1050

omxplayer --lavfdopts probesize:25000 --no-keys -p --live --timeout 30 --aspect-mode fill --layer 2 --win "0 0 1680 735" "rtsp://192.168.42.20:554/cam/realmonitor?channel=1&subtype=0"
omxplayer --lavfdopts probesize:25000 --no-keys -p --live --timeout 30 --aspect-mode fill --layer 2 --win "0 735 560 1050" "rtsp://192.168.42.21:554/cam/realmonitor?channel=1&subtype=1"
omxplayer --lavfdopts probesize:25000 --no-keys -p --live --timeout 30 --aspect-mode fill --layer 2 --win "560 735 1120 1050" "rtsp://192.168.42.22:554/cam/realmonitor?channel=1&subtype=1"
omxplayer --lavfdopts probesize:25000 --no-keys -p --live --timeout 30 --aspect-mode fill --layer 2 --win "1120 735 1680 1050" "rtsp://192.168.42.23:554/cam/realmonitor?channel=1&subtype=1"
Ive already started to work on the webUI, you guys might be in luck and get some damn fancy shit.. how about nice Ajax UI with Draggle elements to rearrange the display?
 

ruppmeister

Getting the hang of it
Joined
Apr 15, 2015
Messages
668
Reaction score
98
I must have done something wrong with your initial instructions in post #46. I ran nano config.js and get a new file with nothing in it. I will try running your instructions again from #46 using copy/paste later tonight and see if that helps. I could have sworn I ran the mv config command before but I must have missed it or something. I used PuTTy to copy/paste your commands in making it super simple.


Sent from my iPhone using Tapatalk
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
gotta copy config.example to config.js right now.. cp config.example config.js

attached teaser screenshot of the UI i am working on, all javascript. All the 'Camera' boxes are draggle and rearrange smartly, the plan is to double click on the camera to open configure dialog. There will be a bunch of predefined templates you can choose with support for 1/3/4/5/6/8/9/11/13/16 and new templates will be pretty simple to calculate.

I am going to fork my code at this point and move over to a database backend for the WebUI.. expect that fork to be all sorts of broken for a while until I get basic functionality restored.

no idea how long this project is going to take before I have something more suitable for public consumption, I am playing with and learning a whole lot of new tech with this gig.. its pretty fun stuff.. Ive been looking for a great project to get some experience with the MEAN stack, and here I have it.

My goal is to make it so you never have to touch the command line if you start off with a precooked image.. I am even testing ONVIF support so you dont even have to know the RSTP Stream, just input Hostname and Login, press a button and if the camera is compatible it'll auto-detect a working RSTP URI.
 

Attachments

Last edited by a moderator:

ruppmeister

Getting the hang of it
Joined
Apr 15, 2015
Messages
668
Reaction score
98
Very cool looking.

I'll try the cp when I get back to my machines.


Sent from my iPhone using Tapatalk
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
added/updated a few screenshots, I now have grid patterns figured out for 4-10 plus 13&16 cams.. I am not even sure if the RPi can handle 16cams but I think thats a good high point.. if you want 32 cams just get a 2nd monitor and pi :p

because of the way my math handles breaking out the display, grids retain the same aspect ratio as your display.. so a 16:10 display ends up with 16:10 cams, you'll be able to maintain aspect ratio, zoom to fit, or stretch so if you have corridor cameras then you'll likely have to live with zoom to fit and hope whatever in the middle of your frame is what you want to watch.

I have the webUI prototyped out and working pretty well, now I have to tie it into a database backend so its not just hardcoded samples.. once that is done I simply need to modify my omxplayer app to read the config from the same database, then do like its already doing to calculate coordinates and fire off streams.

each display mode will have its own config, so you can switch between say 4 cameras and 9 cameras without loosing your arrangements for each.. It'll simply activate each one and make it the default.. When your first connect it'll take you to an add camera UI, once you got them all in, then you simply select number of cameras to display, arrange them how you want then apply the settings.. When you come back it will take you to the display your on, those white boxes wont be populated with live streams sadly but hopefully in the future I can get some jpeg snapshots.

at some point when this actually gets usable I'll start a new thread, until then I'll keep it here.. I am expecting this to be a pretty popular project, ive been planing it in my head for far too long and its really nice seeing it come together so quickly.. I am sure I am making a bunch of noobish mistakes with some of this new stack I am working against, but who gives a fuck this is a gorgeous modern web app I cranked out with pretty minimal effort.. its all going to be open source so if anyone here knows there way around javascript i'd love some help :p
 
Last edited by a moderator:

cball

Young grasshopper
Joined
Jan 31, 2016
Messages
98
Reaction score
18
Location
North Germany
NAYR!!
I'm impressed, what you brougt up in such a short time.
Friday night, I wanted to ask, why my cams have 2-5 secs. latencies. Saturday morning, I found your post about TCP-IP instead of UDP. My two HIK-Cams are still little "lazy" but only about 2 secs. My Aliexpress tinycam which made trouble before because of the sound, doesn't show up anymore - nevermind - I wait, until you are ready and I 'm sure, this is going to be soon.
Thanks so far and keep up.
You are right, this is going to be a popular project.
cball
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
checked it all into github lastnight: https://github.com/nayrnet/raspipc



Ive named the project RasPipC, use the Mnemonic of Raspberry Pepsi and now you'll never forget it.. the WebUI is pretty much done at this point, now to dig into all the backend code.

Ive decided to cope with stream outages by having a priority list, if your camera feed goes down it will load the next highest priority camera that is not being displayed.. then it'll start a watchdog process that will periodically check to see if that camera feed returns.. then it'll take its spot back on the display when its back online.. if no unused cameras are avilable it'll drop down the number of cameras, assuming it can.
 
Last edited by a moderator:

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
Happy Pi Day!

Progress: LOTS, database backend is functional.. I can now add/remove cameras, re-arrange views and it saves all the data in persistent storage on the Pi.. that was a ton of work.

now I am polishing up the WebUI, input validating, adding the ability to upload screencaps for cameras without jpeg feeds (looking at you hunisun) so you can use it to arrange the views.. ONViF discovery of Feed/JPEG URL's etc.

I have to refactor the code at this point and clean it up so there is not so much redundant lines.. my goal for Pi day is to toss up an online demo for you guys to proof/bugtest so I can fix any typos or display issues.. I do not have access to IE or Edge so I need a few of you guys to test that for me.

I would say right now am ~70% along to the first release.. if I keep focused and dont try to add too many features, its getting easer as I go along so its getting harder to resist :)

Mission Impossible: I dont have time to look and evaluate, so I task the community here to do the research for me.. see if there are any simple open source webUI's for any open source VPN servers out there, scour github/sourceforge/google.. if you guys manage to find anything that works I'll include it with the image... from quick research the Pi2 can handle about ~30Mbit of VPN Traffic, thats plenty for most residential use.
 
Last edited by a moderator:
Top