Git Product home page Git Product logo

rpisurv's People

Contributors

dptec avatar hubner avatar kuuchuu avatar rickerd avatar sanakess avatar si458 avatar svenvd avatar tubalainen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpisurv's Issues

wont start

I just installed (first time, pi3) today and I can't get this to start.

No log directory exists in /usr/local/bin/rpisurv

I've tried to run the surveillance.py directly but it fails.

error:


root@raspberrypi:/usr/local/bin/rpisurv# python surveillance.py
Traceback (most recent call last):
  File "surveillance.py", line 10, in <module>
    from config import cfg
  File "/usr/local/bin/rpisurv/config.py", line 4, in <module>
    cfg = yaml.load(ymlfile)
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/lib/python2.7/dist-packages/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 111, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 428, in parse_block_mapping_key
    if self.check_token(KeyToken):
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 257, in fetch_more_tokens
    % ch.encode('utf-8'), self.get_mark())
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in "conf/surveillance.yml", line 15, column 1

root@raspberrypi:/usr/local/bin/rpisurv# systemctl status rpisurv
● rpisurv.service - Rpisurv Raspberry Pi Surveillance
Loaded: loaded (/etc/systemd/system/rpisurv.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-09-10 11:59:52 MDT; 5min ago
Process: 629 ExecStart=/usr/bin/rpisurv (code=exited, status=1/FAILURE)
Main PID: 629 (code=exited, status=1/FAILURE)

Sep 10 11:59:51 raspberrypi systemd[1]: rpisurv.service: Unit entered failed state.
Sep 10 11:59:51 raspberrypi systemd[1]: rpisurv.service: Failed with result 'exit-code'.
Sep 10 11:59:52 raspberrypi systemd[1]: rpisurv.service: Service hold-off time over, scheduling restart.
Sep 10 11:59:52 raspberrypi systemd[1]: Stopped Rpisurv Raspberry Pi Surveillance.
Sep 10 11:59:52 raspberrypi systemd[1]: rpisurv.service: Start request repeated too quickly.
Sep 10 11:59:52 raspberrypi systemd[1]: Failed to start Rpisurv Raspberry Pi Surveillance.
Sep 10 11:59:52 raspberrypi systemd[1]: rpisurv.service: Unit entered failed state.
Sep 10 11:59:52 raspberrypi systemd[1]: rpisurv.service: Failed with result 'exit-code'.

I ran the install script to get this far.

only changes to /etc/rpisurv are rtsp:

essentials:
    #These are the rtsp streams you want the program to display
    #The streams will be displayed in the order you present them here
    camera_streams:
        #Dlink dcs-5222l example
#        - rtsp_url: "rtsp://<user>:<password>@<ip or dnsname>:<port>/play1.sdp"
          #Enable this option if you want the rtsp stream to stream over tcp instead of udp, this may solve a "smearing" effect on some setups. Defaults to false
          #Note that you need a version of omxplayer older then 14 March 2016 for this option to work
#          rtsp_over_tcp: true
        #Foscam-fi9821w example
#        - rtsp_url: "rtsp://<user>:<password>@<ip or dnsname>:<port>/videoMain"
        #Dahua IPC-HDW4200S example or IPC-HDW4300S
#        - rtsp_url: "rtsp://<user>:<password>@<ip or dnsname>:<port>/cam/realmonitor?channel=1&subtype=1"
         - rtsp_url: "rtsp://nvr:7447/59b1c01b90084a188c8a3951_2"
         - rtsp_url: "rtsp://nvr:7447/59b1c01b90084a188c8a3952_2"
         - rtsp_url: "rtsp://nvr:7447/575b2a5b45ce363182a9ec08_2"
         - rtsp_url: "rtsp://nvr:7447/569d46c645ce0ec31ff6f846_2"

Those rtsp urls work in omxplayer directly.

Thanks

fuzzy images on 3 of 4 cams

First of all thanks for your great script which runs (nearly) charming after a few pitfalls.
My current problem is that 3 of my 4 cams only show a "fuzzy" picture - as well as if streaming "by default" oder "over tcp".
rpisurv
All in all my RasPi uses currently 50-60% CPU

Although this is not a specific problem with rpisurv maybe you have the crucial hint

get_free_gpumem crashing

Traceback (most recent call last):
  File "surveillance.py", line 329, in <module>
    check_free_gpumem()
  File "surveillance.py", line 223, in check_free_gpumem
    free_gpumem = get_free_gpumem()
  File "surveillance.py", line 227, in get_free_gpumem
    free_gpumem=str(regex_result.group(1))
AttributeError: 'NoneType' object has no attribute 'group'

logger.debug(gpumemresult) gave me the following output:

Relocatable heap version 4 found at 0x14000000
total space allocated is 172M, with 170M relocatable, 2.3M legacy and 0 offline
1 legacy blocks of size 2359296

free list at 0x1e401ba0

invalid space 0x0 in free list at 0x1e3fc920
993 free memory in 2 free block(s)
largest free block is 961 bytes
0x14000000: legacy block 2.3M
0x14240000: free 143M
[ 108] 0x1d0d6e40: used 1.0M (refcount 1 lock count 0, size  1048576, align   32, data 0x1d0d6e60, d3ruAl) 'khdispatch_workspace'
0x1d1d6e80: free 14M
[ 109] 0x1dfeb5a0: used   64 (refcount 1 lock count 0, size        0, align   32, data 0x1dfeb5c0, d3ruAl) 'khdispatch_readahead'
[ 107] 0x1dfeb5e0: used   96 (refcount 1 lock count 0, size       22, align    1, data 0x1dfeb600, d1rual) 'khrn_hw_null_render'
[ 106] 0x1dfeb640: used  160 (refcount 1 lock count 0, size       96, align    4, data 0x1dfeb660, d0rual) 'KHRN_MAP_64_T.storage'
[ 105] 0x1dfeb6e0: used  576 (refcount 1 lock count 0, size      512, align    4, data 0x1dfeb700, d0rual) 'KHRN_MAP_T.storage'
[ 104] 0x1dfeb920: used 1.1K (refcount 1 lock count 0, size     1024, align    4, data 0x1dfeb940, d0rual) 'KHRN_PID_MAP_T.storage'
[ 103] 0x1dfebd60: used  576 (refcount 1 lock count 0, size      512, align    4, data 0x1dfebd80, d0rual) 'KHRN_MAP_T.storage'
[ 102] 0x1dfebfa0: used  576 (refcount 1 lock count 0, size      512, align    4, data 0x1dfebfc0, d0rual) 'KHRN_MAP_T.storage'
[ 101] 0x1dfec1e0: used  576 (refcount 1 lock count 0, size      512, align    4, data 0x1dfec200, d0rual) 'KHRN_MAP_T.storage'
0x1dfec420: free 69K
[ 524] 0x1dffd720: used  960 (refcount 1 lock count 0, size      884, align   32, data 0x1dffd740, d0rual) 'audio_server'

0x1dffd720: corrupt trailer (space 993 != 961)
[  74] 0x1dffdae0: used  960 (refcount 1 lock count 0, size      880, align   32, data 0x1dffdb00, d0rual) 'audio_server'
[ 537] 0x1dffdea0: used  960 (refcount 1 lock count 0, size      884, align   32, data 0x1dffdec0, d0rual) 'audio_server'
0x1dffe260: corrupt entry (space 0x0)
resynced at 0x1dffe240 (skipped -32 bytes)
[1515890087] 0x1dffe240: used  960 (refcount 1515890088 lock count 7743, size 503307904, align    1, data 0x1dffe260, d3rUAL) '0x5a5aa5a5'
[  85] 0x1dffe600: used  960 (refcount 1 lock count 0, size      884, align   32, data 0x1dffe620, d0rual) 'audio_server'
[ 142] 0x1dffe9c0: used  960 (refcount 1 lock count 0, size      884, align   32, data 0x1dffe9e0, d0rual) 'audio_server'
[ 492] 0x1dffed80: used 4.0M (refcount 1 lock count 0, size  4177920, align   32, data 0x1dffeda0, d1rual) 'dispmanx_resource'
0x1e3fadc0: free 448
0x1e3faf80: corrupt entry (space 0x0)
resynced at 0x1e3fb140 (skipped 448 bytes)
[ 505] 0x1e3fb140: used  960 (refcount 1 lock count 0, size      880, align   32, data 0x1e3fb160, d0rual) 'audio_server'
[ 579] 0x1e3fb500: used  960 (refcount 1 lock count 0, size      884, align   32, data 0x1e3fb520, d0rual) 'audio_server'
[  20] 0x1e3fb8c0: used  960 (refcount 1 lock count 0, size      880, align   32, data 0x1e3fb8e0, d0rual) 'audio_server'
0x1e3fbc80: free 384
0x1e3fbe00: corrupt entry (space 0x0)
resynced at 0x1e3fbe00 (skipped 0 bytes)
[ 507] 0x1e3fbe00: used  960 (refcount 1 lock count 0, size      884, align   32, data 0x1e3fbe20, d0rual) 'audio_server'
[  89] 0x1e3fc1c0: used  960 (refcount 1 lock count 0, size      880, align   32, data 0x1e3fc1e0, d0rual) 'audio_server'
0x1e3fc1c0: corrupt trailer (space 0 != 961)
0x1e3fc1c0: corrupt trailer (guards[0] = 0x00000000)
0x1e3fc1c0: corrupt trailer (guards[1] = 0x00000000)
0x1e3fc1c0: corrupt trailer (guards[2] = 0x00000000)
0x1e3fc1c0: corrupt trailer (guards[3] = 0x00000000)
0x1e3fc1c0: corrupt trailer (guards[4] = 0x00000000)
0x1e3fc580: corrupt entry (space 0x0)
resynced at 0x1e3fc400 (skipped -384 bytes)
[ 297] 0x1e3fc400: used  960 (refcount 1 lock count 0, size      880, align   32, data 0x1e3fc420, d0rual) 'audio_server'
[ 522] 0x1e3fc7c0: used  960 (refcount 1 lock count 0, size      880, align   32, data 0x1e3fc7e0, d0rual) 'audio_server'
[ 450] 0x1e3fcb80: used  576 (refcount 1 lock count 0, size      512, align    4, data 0x1e3fcba0, d0rual) 'ILCS VC buffer pool'
[ 348] 0x1e3fcdc0: used  960 (refcount 1 lock count 0, size      884, align   32, data 0x1e3fcde0, d0rual) 'audio_server'
[  98] 0x1e3fd180: used  960 (refcount 1 lock count 0, size      884, align   32, data 0x1e3fd1a0, d0rual) 'audio_server'
[ 513] 0x1e3fd540: used  960 (refcount 1 lock count 0, size      880, align   32, data 0x1e3fd560, d0rual) 'audio_server'
[ 525] 0x1e3fd900: used 1.1K (refcount 1 lock count 0, size     1024, align    4, data 0x1e3fd920, d0rual) 'resample coeff table data'
[ 147] 0x1e3fdd40: used   96 (refcount 1 lock count 0, size       12, align    4, data 0x1e3fdd60, d0rual) 'resample coeff table'
[ 243] 0x1e3fdda0: used  416 (refcount 1 lock count 0, size      340, align    4, data 0x1e3fddc0, d0rual) 'resample context'
0x1e3fdf40: free 32
[ 420] 0x1e3fdf60: used  960 (refcount 1 lock count 0, size      884, align   32, data 0x1e3fdf80, d0rual) 'audio_server'
0x1e3fe320: free 96
0x1e3fe380: corrupt entry (space 0x0)
resynced at 0x1e3feb00 (skipped 1920 bytes)
[ 527] 0x1e3feb00: used  960 (refcount 1 lock count 0, size      884, align   32, data 0x1e3feb20, d0rual) 'audio_server'

0x1e3feec0: corrupt entry (space 0x0)
resynced at 0x1e3ff260 (skipped 928 bytes)
[1515890087] 0x1e3ff260: used  960 (refcount 1515890088 lock count 7914, size 507506336, align 4096, data 0x1e400000, d2rUAl) '0x5a5aa5a5'
[ 476] 0x1e3ff620: used  960 (refcount 1 lock count 0, size      880, align   32, data 0x1e3ff640, d0rual) 'audio_server'
0x1e3ff620: corrupt trailer (space 0 != 961)
0x1e3ff620: corrupt trailer (guards[0] = 0x00000000)
[1515890087] 0x1e3ff9e0: used  960 (refcount 1515890088 lock count 7914, size 507508256, align 4096, data 0x1e400000, d2rUAl) '0x5a5aa5a5'
0x1e3ff9e0: corrupt trailer (space 0 != 961)
0x1e3ff9e0: corrupt trailer (guards[0] = 0x00000000)
0x1e3ff9e0: corrupt trailer (guards[1] = 0x00000000)
[1515890087] 0x1e3ffda0: used  960 (refcount 1515890088 lock count 7914, size 507509216, align 4096, data 0x1e400000, d2rUAl) '0x5a5aa5a5'
0x1e3ffda0: corrupt trailer (space 0 != 961)
0x1e3ffda0: corrupt trailer (guards[0] = 0x00000000)
[1515890087] 0x1e400160: used  960 (refcount 1515890088 lock count 7914, size 507510176, align 4096, data 0x1e401000, d2rUAl) '0x5a5aa5a5'
0x1e400160: corrupt trailer (space 0 != 961)
0x1e400160: corrupt trailer (guards[0] = 0x00000000)
0x1e400160: corrupt trailer (guards[1] = 0x00000000)
[1515890087] 0x1e400520: used  960 (refcount 1515890088 lock count 7914, size 507511136, align 4096, data 0x1e401000, d2rUAl) '0x5a5aa5a5'
0x1e400520: corrupt trailer (space 0 != 961)
0x1e400520: corrupt trailer (guards[0] = 0x00000000)
0x1e400520: corrupt trailer (guards[1] = 0x00000000)
0x1e400520: corrupt trailer (guards[2] = 0x00000000)
0x1e400520: corrupt trailer (guards[3] = 0x00000000)
0x1e400520: corrupt trailer (guards[4] = 0x00000000)
[1515890087] 0x1e4008e0: used  960 (refcount 1515890088 lock count 7914, size 507512096, align 4096, data 0x1e401000, d2rUAl) '0x5a5aa5a5'
0x1e4008e0: corrupt trailer (space 0 != 961)
0x1e4008e0: corrupt trailer (guards[0] = 0x00000000)
0x1e4008e0: corrupt trailer (guards[1] = 0x00000000)
[1515890087] 0x1e400ca0: used  960 (refcount 1515890088 lock count 7914, size 507502400, align 4096, data 0x1e401000, d2rUAl) '0x5a5aa5a5'
0x1e400ca0: corrupt trailer (space 0 != 961)
0x1e400ca0: corrupt trailer (guards[0] = 0x00000000)
0x1e400ca0: corrupt trailer (guards[1] = 0x00000000)
0x1e400ca0: corrupt trailer (guards[2] = 0x00000000)
0x1e400ca0: corrupt trailer (guards[3] = 0x00000000)
0x1e400ca0: corrupt trailer (guards[4] = 0x00000000)
[1515890087] 0x1e401060: used  960 (refcount 1515890088 lock count 7914, size 507514016, align 4096, data 0x1e402000, d2rUAl) '0x5a5aa5a5'
0x1e401060: corrupt trailer (space 0 != 961)
0x1e401060: corrupt trailer (guards[0] = 0x00000000)
0x1e401060: corrupt trailer (guards[1] = 0x00000000)
0x1e401060: corrupt trailer (guards[2] = 0x00000000)
0x1e401060: corrupt trailer (guards[3] = 0x00000000)
[1515890087] 0x1e401420: used  960 (refcount 1515890088 lock count 7914, size 507502400, align 4096, data 0x1e402000, d2rUAl) '0x5a5aa5a5'

0x1e401420: corrupt trailer (space 0 != 961)
0x1e401420: corrupt trailer (guards[0] = 0x00000000)
0x1e401420: corrupt trailer (guards[1] = 0x00000000)
[1515890087] 0x1e4017e0: used  960 (refcount 1515890088 lock count 7914, size 507502400, align 4096, data 0x1e402000, d2rUAl) '0x5a5aa5a5'
0x1e4017e0: corrupt trailer (space 0 != 961)
0x1e4017e0: corrupt trailer (guards[0] = 0x00000000)
0x1e4017e0: corrupt trailer (guards[1] = 0x00000000)
0x1e4017e0: corrupt trailer (guards[2] = 0x00000000)
0x1e4017e0: corrupt trailer (guards[3] = 0x00000000)
[1515890087] 0x1e401ba0: used  960 (refcount 1515890088 lock count 7914, size 507502400, align 4096, data 0x1e402000, d2rUAl) '0x5a5aa5a5'
0x1e401ba0: corrupt trailer (space 0 != 961)
0x1e401ba0: corrupt trailer (guards[0] = 0x00000000)
0x1e401ba0: corrupt trailer (guards[1] = 0x00000000)
0x1e401ba0: corrupt trailer (guards[2] = 0x00000000)
0x1e401ba0: corrupt trailer (guards[3] = 0x00000000)
0x1e401ba0: corrupt trailer (guards[4] = 0x00000000)
[1515890087] 0x1e401f60: used  960 (refcount 1515890088 lock count 7914, size 507502400, align 4096, data 0x1e402000, d2rUAl) '0x5a5aa5a5'
0x1e401f60: corrupt trailer (space 0 != 961)
0x1e401f60: corrupt trailer (guards[0] = 0x00000000)
0x1e401f60: corrupt trailer (guards[1] = 0x00000000)
0x1e401f60: corrupt trailer (guards[2] = 0x00000000)
0x1e401f60: corrupt trailer (guards[3] = 0x00000000)
0x1e401f60: corrupt trailer (guards[4] = 0x00000000)
0x1e402320: corrupt entry (space 0x0)
could not resync
heap corruption detected
small allocs not requested

Delays in display

Hi,

I usage five china camera 2Mpx. In day mode all works wery well.
After change to night mode within an hour the image is delayed by a few minutes.
Do you have a solution?
I use substream 640x480px 15fps.

Wersion of my cameras:
camera_version

best regards
Krzysztof

req: extend rpisurv to use mplayer/other

I use a ton of raspberry pi's for video playback, but I'd like to occasionally use more powerful hardware without changing underlying software.

For example, an Intel NUC6CAYH supports 4k output and should be able to decode a 4x4 grid of h.264 streams with mplayer using -vo vaapi or ffmpeg using vaapi or opencl.

This would be an incredibly useful modification.

I would be willing to fork out some cash to make this happen, and I'm assuming a few others would pitch in because of how great this would be. I can only get a 3x3 grid of 640x360 streams at 1080p output decoding on a pi3 before it runs out of power. I'm also stuck at an effect 1080p output with the Pi3. I can technically push out 4k15fps which would be fine but I can't decode enough streams to make use of that.

Ultimately I want to stick with rpisurv but have a higher end device that can decode 16x 640x360 stream or maybe even 16x 1024x576 streams, and sometimes just 4x 1080p streams. Those are by resolution options from the Unifi-video cameras I use most of and the occasional axis camera resolutions are pretty close.

None Not Connectable ?

Hi,

I've to try install this service on a new RPI and I got Strange error (i take a screen from console)

bug_rpi

And It never start.

I've check the rtsp url with VLC on the desktop mode and it works.
When I was in console I've check the network with an apt-get install htop for example and it works too..

So I don't know what to do next if u get a trick or Something to fix this issue :)


Hardware:
Camera IP Axis P1405-LE
RPI 3 Model B with a fresh 2016-03-18-raspbian-jessie


Thanks for your help :)

display / order of screens

If it is possible to order screens like
1 screen
2 screen
1 screen

I not find any description about that.

Video Stretched

Great script!

I've managed to get two IP cameras connected at the moment (need to figure out the stream IDs for the other two I have, however the image is looking very stretched out of proportions

Any ideas how to fix this?

error updating

This is what I get when updating:

pi@RpiConserjeria ~/rpisurv $ sudo git pull
remote: Counting objects: 124, done.
remote: Total 124 (delta 15), reused 15 (delta 15), pack-reused 109
Receiving objects: 100% (124/124), 140.06 KiB | 0 bytes/s, done.
Resolving deltas: 100% (72/72), completed with 6 local objects.
From https://github.com/SvenVD/rpisurv
1528dd0..759e784 master -> origin/master
Updating 1528dd0..759e784
error: Your local changes to the following files would be overwritten by merge:
surveillance/conf/surveillance.yml
Please, commit your changes or stash them before you can merge.
Aborting

Is actually updated or is there something wrong?

What can I do to update it?

Failing to start Rpisurv

I'm unsure where we are going wrong here, I've checked /etc/rpisurv for tabs and all indentation is spaces per the example file, yet on reboot I get the following

[FAILED] Failed to start Rpisurv Raspberry Pi Surveillance.
See 'systemctl status status rpisurv.service' for details.

Running sudo journalctl -u rpisurv gives me these logs.

-- Logs begin at Mon 2018-04-16 15:51:40 NZST, end at Mon 2018-04-16 15:52:50 NZST. --
Apr 16 15:51:42 aae-rtsp01 systemd[1]: Started Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]: 2018/04/16 15:51:45 - l_default - DEBUG - autodetected resolution of['1824', '984']
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]: 2018/04/16 15:51:45 - l_default - DEBUG - nr_of_columns = 1
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]: 2018/04/16 15:51:45 - l_default - DEBUG - interval_check_status = 25
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]: 2018/04/16 15:51:45 - l_default - DEBUG - camera_streams config option exist, using this one
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]: Traceback (most recent call last):
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]:   File "surveillance.py", line 372, in <module>
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]:     all_camera_streams=setup_camera_streams(camera_streams)
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]:   File "surveillance.py", line 247, in setup_camera_streams
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]:     cam_stream=CameraStream(cam_stream_name,camera_stream)
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]:   File "surveillance.py", line 29, in __init__
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]:     self.rtsp_url = camera_stream["rtsp_url"]
Apr 16 15:51:45 aae-rtsp01 rpisurv[347]: KeyError: 'rtsp_url'
Apr 16 15:51:45 aae-rtsp01 systemd[1]: rpisurv.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 15:51:45 aae-rtsp01 systemd[1]: rpisurv.service: Unit entered failed state.
Apr 16 15:51:45 aae-rtsp01 systemd[1]: rpisurv.service: Failed with result 'exit-code'.
Apr 16 15:51:46 aae-rtsp01 systemd[1]: rpisurv.service: Service hold-off time over, scheduling restart.
Apr 16 15:51:46 aae-rtsp01 systemd[1]: Stopped Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:46 aae-rtsp01 systemd[1]: Started Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]: 2018/04/16 15:51:47 - l_default - DEBUG - autodetected resolution of['1824', '984']
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]: 2018/04/16 15:51:47 - l_default - DEBUG - nr_of_columns = 1
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]: 2018/04/16 15:51:47 - l_default - DEBUG - interval_check_status = 25
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]: 2018/04/16 15:51:47 - l_default - DEBUG - camera_streams config option exist, using this one
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]: Traceback (most recent call last):
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]:   File "surveillance.py", line 372, in <module>
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]:     all_camera_streams=setup_camera_streams(camera_streams)
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]:   File "surveillance.py", line 247, in setup_camera_streams
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]:     cam_stream=CameraStream(cam_stream_name,camera_stream)
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]:   File "surveillance.py", line 29, in __init__
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]:     self.rtsp_url = camera_stream["rtsp_url"]
Apr 16 15:51:47 aae-rtsp01 rpisurv[410]: KeyError: 'rtsp_url'
Apr 16 15:51:47 aae-rtsp01 systemd[1]: rpisurv.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 15:51:47 aae-rtsp01 systemd[1]: rpisurv.service: Unit entered failed state.
Apr 16 15:51:47 aae-rtsp01 systemd[1]: rpisurv.service: Failed with result 'exit-code'.
Apr 16 15:51:47 aae-rtsp01 systemd[1]: rpisurv.service: Service hold-off time over, scheduling restart.
Apr 16 15:51:47 aae-rtsp01 systemd[1]: Stopped Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:47 aae-rtsp01 systemd[1]: Started Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]: 2018/04/16 15:51:48 - l_default - DEBUG - autodetected resolution of['1824', '984']
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]: 2018/04/16 15:51:48 - l_default - DEBUG - nr_of_columns = 1
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]: 2018/04/16 15:51:48 - l_default - DEBUG - interval_check_status = 25
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]: 2018/04/16 15:51:48 - l_default - DEBUG - camera_streams config option exist, using this one
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]: Traceback (most recent call last):
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]:   File "surveillance.py", line 372, in <module>
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]:     all_camera_streams=setup_camera_streams(camera_streams)
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]:   File "surveillance.py", line 247, in setup_camera_streams
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]:     cam_stream=CameraStream(cam_stream_name,camera_stream)
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]:   File "surveillance.py", line 29, in __init__
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]:     self.rtsp_url = camera_stream["rtsp_url"]
Apr 16 15:51:48 aae-rtsp01 rpisurv[436]: KeyError: 'rtsp_url'
Apr 16 15:51:48 aae-rtsp01 systemd[1]: rpisurv.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 15:51:48 aae-rtsp01 systemd[1]: rpisurv.service: Unit entered failed state.
Apr 16 15:51:48 aae-rtsp01 systemd[1]: rpisurv.service: Failed with result 'exit-code'.
Apr 16 15:51:48 aae-rtsp01 systemd[1]: rpisurv.service: Service hold-off time over, scheduling restart.
Apr 16 15:51:48 aae-rtsp01 systemd[1]: Stopped Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:48 aae-rtsp01 systemd[1]: Started Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]: 2018/04/16 15:51:49 - l_default - DEBUG - autodetected resolution of['1824', '984']
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]: 2018/04/16 15:51:49 - l_default - DEBUG - nr_of_columns = 1
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]: 2018/04/16 15:51:49 - l_default - DEBUG - interval_check_status = 25
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]: 2018/04/16 15:51:49 - l_default - DEBUG - camera_streams config option exist, using this one
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]: Traceback (most recent call last):
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]:   File "surveillance.py", line 372, in <module>
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]:     all_camera_streams=setup_camera_streams(camera_streams)
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]:   File "surveillance.py", line 247, in setup_camera_streams
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]:     cam_stream=CameraStream(cam_stream_name,camera_stream)
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]:   File "surveillance.py", line 29, in __init__
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]:     self.rtsp_url = camera_stream["rtsp_url"]
Apr 16 15:51:49 aae-rtsp01 rpisurv[441]: KeyError: 'rtsp_url'
Apr 16 15:51:49 aae-rtsp01 systemd[1]: rpisurv.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 15:51:49 aae-rtsp01 systemd[1]: rpisurv.service: Unit entered failed state.
Apr 16 15:51:49 aae-rtsp01 systemd[1]: rpisurv.service: Failed with result 'exit-code'.
Apr 16 15:51:50 aae-rtsp01 systemd[1]: rpisurv.service: Service hold-off time over, scheduling restart.
Apr 16 15:51:50 aae-rtsp01 systemd[1]: Stopped Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:50 aae-rtsp01 systemd[1]: Started Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]: 2018/04/16 15:51:51 - l_default - DEBUG - autodetected resolution of['1824', '984']
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]: 2018/04/16 15:51:51 - l_default - DEBUG - nr_of_columns = 1
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]: 2018/04/16 15:51:51 - l_default - DEBUG - interval_check_status = 25
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]: 2018/04/16 15:51:51 - l_default - DEBUG - camera_streams config option exist, using this one
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]: Traceback (most recent call last):
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]:   File "surveillance.py", line 372, in <module>
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]:     all_camera_streams=setup_camera_streams(camera_streams)
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]:   File "surveillance.py", line 247, in setup_camera_streams
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]:     cam_stream=CameraStream(cam_stream_name,camera_stream)
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]:   File "surveillance.py", line 29, in __init__
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]:     self.rtsp_url = camera_stream["rtsp_url"]
Apr 16 15:51:51 aae-rtsp01 rpisurv[446]: KeyError: 'rtsp_url'
Apr 16 15:51:51 aae-rtsp01 systemd[1]: rpisurv.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 15:51:51 aae-rtsp01 systemd[1]: rpisurv.service: Unit entered failed state.
Apr 16 15:51:51 aae-rtsp01 systemd[1]: rpisurv.service: Failed with result 'exit-code'.
Apr 16 15:51:51 aae-rtsp01 systemd[1]: rpisurv.service: Service hold-off time over, scheduling restart.
Apr 16 15:51:51 aae-rtsp01 systemd[1]: Stopped Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:51 aae-rtsp01 systemd[1]: rpisurv.service: Start request repeated too quickly.
Apr 16 15:51:51 aae-rtsp01 systemd[1]: Failed to start Rpisurv Raspberry Pi Surveillance.
Apr 16 15:51:51 aae-rtsp01 systemd[1]: rpisurv.service: Unit entered failed state.
Apr 16 15:51:51 aae-rtsp01 systemd[1]: rpisurv.service: Failed with result 'exit-code'.

I'm not sure where to look next. If I run omxplayer directly I get

$ omxplayer rtsp://192.168.1.10:8228/h264 --live --hw --blank
* failed to open vchiq instance
$ sudo chmod a+rw /dev/vchiq
$ omxplayer rtsp://192.168.1.10:8228/h264 --live --hw --blank

I then get a full screen stream as expected.. I'm not sure where to look now to translate this into a working instance of the rpisurv service.

Looking for way to add mix of h264 and mjpeg cameras

Using omxplayer on raspbian, i can get mjpeg streams to play from command line with a http cgi address:

http://192.168.1.45:2080/videostream.cgi

Is there a way to add this to /etc/ripsurv config to add it to my existing (currently 3) h264 streams? When i enter rtsp_url: "http://192.168.1.45:2080/videostream.cgi" rpisurv starts, but the mjpeg stream never starts.

2018/01/16 20:10:44 - l_default - ERROR - 192.168.1.45 : 2080 Not Connectable (failed socket connect)

Obviously it's trying to use RTSP protocol instead of http. How to override?

2.0 Beta - yaml.parser.ParserError

yaml.parser.ParserError: while parsing a block collection
in "conf/surveillance.yml", line 74, column 11
expected , but found '?'
in "conf/surveillance.yml", line 78, column 11

Error in the original surveillance.yml?

): did not find expected '-' indicator while parsing a block collection at line 74 column 11

Custom images

Hi,
Firstly, a big thanks for such an awesome app. Ive just started benchtesting and so far so good.
Just wanted to know about the custom images to replace the stock 'connecting', 'no connection' and 'placeholder' images.
Are there any image or file size constraints for these to work?
I tried some basic 1920x1080 pngs in the /images folder, but after a restart the rpi still shows the stock images.

Secondly, would there be any possibility to add a custom watermark or overlay a static image in a corner of the screen?

Any help would be appreciated.

Thanks.

help installing rpisurv

i followed the steps but cant get it to work, can you help me?

pi@rpisurv:/usr/local/bin/rpisurv/logs $ sudo systemctl status rpisurv
● rpisurv.service - Rpisurv Raspberry Pi Surveillance
Loaded: loaded (/etc/systemd/system/rpisurv.service; enabled; vendor preset:
Active: failed (Result: exit-code) since Wed 2017-09-13 23:32:42 MST; 1min 21
Process: 561 ExecStart=/usr/bin/rpisurv (code=exited, status=1/FAILURE)
Main PID: 561 (code=exited, status=1/FAILURE)

Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Failed with result 'exit-co
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Service hold-off time over,
Sep 13 23:32:42 rpisurv systemd[1]: Stopped Rpisurv Raspberry Pi Surveillance.
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Start request repeated too
Sep 13 23:32:42 rpisurv systemd[1]: Failed to start Rpisurv Raspberry Pi Surveil
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Unit entered failed state.
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Failed with result 'exit-co
lines 1-13/13 (END)
● rpisurv.service - Rpisurv Raspberry Pi Surveillance
Loaded: loaded (/etc/systemd/system/rpisurv.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2017-09-13 23:32:42 MST; 1min 21s ago
Process: 561 ExecStart=/usr/bin/rpisurv (code=exited, status=1/FAILURE)
Main PID: 561 (code=exited, status=1/FAILURE)

Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Failed with result 'exit-code'.
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Service hold-off time over, scheduling restart.
Sep 13 23:32:42 rpisurv systemd[1]: Stopped Rpisurv Raspberry Pi Surveillance.
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Start request repeated too quickly.
Sep 13 23:32:42 rpisurv systemd[1]: Failed to start Rpisurv Raspberry Pi Surveillance.
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Unit entered failed state.
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Failed with result 'exit-code'.
~
~
~
~
~
~
~
~
~
~
lines 1-13/13 (END)
● rpisurv.service - Rpisurv Raspberry Pi Surveillance
Loaded: loaded (/etc/systemd/system/rpisurv.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2017-09-13 23:32:42 MST; 1min 21s ago
Process: 561 ExecStart=/usr/bin/rpisurv (code=exited, status=1/FAILURE)
Main PID: 561 (code=exited, status=1/FAILURE)

Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Failed with result 'exit-code'.
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Service hold-off time over, scheduling restart.
Sep 13 23:32:42 rpisurv systemd[1]: Stopped Rpisurv Raspberry Pi Surveillance.
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Start request repeated too quickly.
Sep 13 23:32:42 rpisurv systemd[1]: Failed to start Rpisurv Raspberry Pi Surveillance.
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Unit entered failed state.
Sep 13 23:32:42 rpisurv systemd[1]: rpisurv.service: Failed with result 'exit-code'.
~
~
~
~
~
~
~
~
~

pi3 and unifi-video losing streams

I'm having an issue where a pi 3 w/ 6 videos pulling rtsp from a unifi-video server (low quality ie '2' streams) is occasionally dropping a display off.

I'm rebooting the unit at 4am every day to keep this to a minimum, but it's still happening about once a week and is down until the reboot. A reboot always cures it.

Any suggestions to resolve this?

Thanks.

Invalid framerate 90000

Just got things setup and manually starting rpisurv with cd /usr/local/bin/rpisurv; python surveillance.py and it comes up with - Invalid framerate 90000, using forced 25fps and just trust timestamps have a nice day ;) and just keeps trying to connect to the stream. The stream works in VLC and QT. Says its connectable. Not sure what the issue is? Logs basically repeat the same.

not working

This is what the command line says after configure and launch it:

pi@pi2recepcion /usr/local/bin/rpisurv $ python surveillance.py
Traceback (most recent call last):
File "surveillance.py", line 12, in
from config import cfg
File "/usr/local/bin/rpisurv/config.py", line 4, in
cfg = yaml.load(ymlfile)
File "/usr/lib/python2.7/dist-packages/yaml/init.py", line 71, in load
return loader.get_single_data()
File "/usr/lib/python2.7/dist-packages/yaml/constructor.py", line 37, in get_single_data
node = self.get_single_node()
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 36, in get_single_node
document = self.compose_document()
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 55, in compose_document
node = self.compose_node(None, None)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 64, in compose_node
if self.check_event(AliasEvent):
File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 98, in check_event
self.current_event = self.state()
File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 449, in parse_block_mapping_value
if not self.check_token(KeyToken, ValueToken, BlockEndToken):
File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 116, in check_token
self.fetch_more_tokens()
File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 257, in fetch_more_tokens
% ch.encode('utf-8'), self.get_mark())
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
in "conf/surveillance.yml", line 8, column 1

Please, tell me what to do.

Thanks

Feature: Cycle through streams

I have more than 4 cameras I'd like to display, but I'm happy to have them cycle. Any thoughts on adding support for cycling through streams?

display / fit to the screen

I can not adjust the picture to the resolution of the screen, image from the cameras is shifted to the upper left corner of the screen FOTO

feature

Hi, I registered to request a feature if it's possible.

I am running your script on my rPI B+. Works like a charm. So my request:
When a rtsp stream goes down for example on a 2x2 matrix (with 4 urls defined in the config file) I do not want to recalculate , but leave the 4 windows and just display a black screen or a message "disconnected" or something. Because for example with 2 streams only the image looks weird , verticaly stretched on 4:3 and 16:10 also. 3 streams is quite ok but , the 2x2 would be the best for window size ratio.
Could you add an option into the config file to turn on/off this recalculation+resizing.

Thanks

Works!

Great stuff here @SvenVD - got it going eventually but ran into some funny issues along the way, namely permissions on running install.sh. /usr/local/bin/rpisurv never got created, neither did /home/pi/surveillance

Ended up copying the contents of surveillance/conf into /usr/local/bin/rpisurv & everything fell into place.

Curious if you know of a way to stream an mjpeg stream in this way(autonomous, service-monitoring, stable fps). I'm using https://github.com/ccrisan/motioneyeos for the camera side but am looking to setup a chromeless/fullscreen monitor to stream the images to.

5x5 Grid to show 25 cameras

Hi,
I just installed rpisurv and got it working fine with a 4x4 grid showing 16 cameras from 2 different hikivision stand alones.
Now I need to show 25 cameras in a 5x5 grid, but only 16 cameras are shown.
I already increase gpu memory up to 640mb, but still don't work.
I also already tried all 25 rtsp links with vlc and all of them are working.
Can you help me fix this issue?

Smearing Effect (How to downgrade omxplayer)

I am experiencing the smearing effect on all four of my cameras. I see that I need to downgrade my omxplayer to before 03142016 to enable rtsp_over_tcp: true. How do I go about downgrading? I am on RPi 3 B+ Stretch 04192018.

My current omxplayer version is:
Build date: Wed, 05 Jul 2017 16:40:39 +0100
Version : 5a25a57 [debian]
Repository: [email protected]:XECDesign/omxplayer.git

"If you have a "smearing" effect this option may resolve it. Note that you need a version of omxplayer older then 14 March 2016 (popcornmix/omxplayer#433) to do this."

cannot clone

When I go through the instructions and get to this part , this happens

sudo git clone [email protected]:SvenVD/rpisurv.git
Cloning into 'rpisurv'...
The authenticity of host 'github.com (192.30.252.121)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.121' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Any idea of what I am doing wrong? New to Pi and Linux

Audio for One Camera Stream on a 4 Camera Matrix

I have rpisurv v1.0 installed and am trying to play the audio from one RTSP stream all of the time while keeping the other 3 windows just video feeds. Is there a way to route the audio from 1 RTSP stream to the HDMI?

Can't get it to start

not sure what I'm missing but when I try to start it I get this:

Traceback (most recent call last):
  File "surveillance.py", line 10, in <module>
    from config import cfg
  File "/usr/local/bin/rpisurv/config.py", line 4, in <module>
    cfg = yaml.load(ymlfile)
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/lib/python2.7/dist-packages/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 64, in compose_node
    if self.check_event(AliasEvent):
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 449, in parse_block_mapping_value
    if not self.check_token(KeyToken, ValueToken, BlockEndToken):
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/usr/lib/python2.7/dist-packages/yaml/scanner.py", line 257, in fetch_more_tokens
    % ch.encode('utf-8'), self.get_mark())
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in "conf/surveillance.yml", line 5, column 1

Automatic cycle through list of cameras?

Is there a method of cycling through a number of grids of cameras. e.g. 2x2 grid every 5 seconds for 12 cameras total, then cycle back?

If not, what would be the best way to go about doing this?

error

So I got it installed and I only put in the url for one camera so far.

I get this error when trying to run it

2016/04/14 05:48:07 - l_default - DEBUG - autodetected resolution of['1824', '984']
2016/04/14 05:48:07 - l_default - DEBUG - nr_of_columns = 2
Traceback (most recent call last):
File "surveillance.py", line 237, in
all_camera_streams=setup_camera_streams(rtsp_urls)
File "surveillance.py", line 185, in setup_camera_streams
cam_stream=CameraStream(cam_stream_name,rtsp_url)
File "surveillance.py", line 24, in init
self.port = self.parsed.port
File "/usr/lib/python2.7/urlparse.py", line 113, in port
port = int(port, 10)
ValueError: invalid literal for int() with base 10: ''

not all RTSP are equal?

First, thanks so much for your work on this. Everything about it seemed to work just as expected. I had no problem getting 3 cameras showing on my TV via Pi2 hdmi with rpisurv 👍 +1:

I ran upon an issue, and I'm unsure how diagnose it any further. I decided to add a 4th feed to my system, by using VLC RTSP server to stream the screen of a PC. The idea being that, I would then have my cameras plus an information stream flowing as a 4th source. The use of VLC to stream the screen via RTSP seems to work fine, I can access the stream from other clients, and even from my pi2 bu using the following command: sudo omxplayer --live -o hdmi rtsp://xx.xx.xx.xx:8554/scr.sdp
If I change one of my already tested and functioning stream sources to use this new one, it causes an error in surveillance.py

Traceback (most recent call last):
File "surveillance.py", line 10, in
from config import cfg
File "/usr/local/bin/rpisurv/config.py", line 4, in
cfg = yaml.load(ymlfile)
File "/usr/lib/python2.7/dist-packages/yaml/init.py", line 71, in load
return loader.get_single_data()
File "/usr/lib/python2.7/dist-packages/yaml/constructor.py", line 37, in get_single_data
node = self.get_single_node()
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 36, in get_single_node
document = self.compose_document()
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 55, in compose_document
node = self.compose_node(None, None)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 82, in compose_node
node = self.compose_sequence_node(anchor)
File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 110, in compose_sequence_node
while not self.check_event(SequenceEndEvent):
File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 98, in check_event
self.current_event = self.state()
File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 393, in parse_block_sequence_entry
"expected , but found %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a block collection
in "conf/surveillance.yml", line 6, column 9
expected , but found ''
in "conf/surveillance.yml", line 19, column 10

Any thoughts?

Kenik Cam can't connect via RSTP

`Mar 19 13:44:06 raspberrypi systemd[1]: rpisurv.service start request repeated too quickly, refusing to start.
Mar 19 13:44:06 raspberrypi systemd[1]: Failed to start Rpisurv Raspberry Pi Surveillance.
Mar 19 13:44:06 raspberrypi systemd[1]: Unit rpisurv.service entered failed state.
pi@raspberrypi:~/rpisurv $ mc
GNU nano 2.2.6 File: /var/log/syslog Modified

Mar 19 14:31:03 raspberrypi rpisurv[4147]: while not self.check_event(MappingEndEvent):
Mar 19 14:31:03 raspberrypi rpisurv[4147]: File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 98, in check_event
Mar 19 14:31:03 raspberrypi rpisurv[4147]: self.current_event = self.state()
Mar 19 14:31:03 raspberrypi rpisurv[4147]: File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 439, in parse_block_mapping_key
Mar 19 14:31:03 raspberrypi rpisurv[4147]: "expected , but found %r" % token.id, token.start_mark)
Mar 19 14:31:03 raspberrypi rpisurv[4147]: yaml.parser.ParserError: while parsing a block mapping
Mar 19 14:31:03 raspberrypi rpisurv[4147]: in "conf/surveillance.yml", line 1, column 1
Mar 19 14:31:03 raspberrypi rpisurv[4147]: expected , but found '-'
Mar 19 14:31:03 raspberrypi rpisurv[4147]: in "conf/surveillance.yml", line 14, column 1
Mar 19 14:31:03 raspberrypi systemd[1]: rpisurv.service: main process exited, code=exited, status=1/FAILURE
Mar 19 14:31:03 raspberrypi systemd[1]: Unit rpisurv.service entered failed state.
Mar 19 14:31:04 raspberrypi systemd[1]: rpisurv.service holdoff time over, scheduling restart.
Mar 19 14:31:04 raspberrypi systemd[1]: Stopping Rpisurv Raspberry Pi Surveillance...
Mar 19 14:31:04 raspberrypi systemd[1]: Starting Rpisurv Raspberry Pi Surveillance...
Mar 19 14:31:04 raspberrypi systemd[1]: rpisurv.service start request repeated too quickly, refusing to start.
Mar 19 14:31:04 raspberrypi systemd[1]: Failed to start Rpisurv Raspberry Pi Surveillance.
Mar 19 14:31:04 raspberrypi systemd[1]: Unit rpisurv.service entered failed state.
Mar 19 14:31:08 raspberrypi vncserver-x11[658]: AgentInitCheck: no response from agent
if i use omxplayer
omxplayer --live --win "0 100 1824 642" rtsp://10.20.2.210/user=admin_password=_channel=0_stream=1.sdp
it works

When i put the same adres to rpirurv it wont start

[REQ] Ability to switch between fullscreen views

Is there a possibility to add the option to "dial" into a specific stream fullscreen?

In other words, I want to have, for example, 4 camera feeds on my screen. If I hit "1", "Enter" - the first camera feed would become the only one on screen, and take up the entirety of the screen.
To get back to the quad view, I would dial "0", "Enter"

This would be a live saver, as this doesn't seem to be available in any other "basic" software of this sort.
Everything I've looked at so far is very feature bloated, and wouldn't work on a small system like the Pi or similar dev boards.

Thanks in advance!

sad errors

trying to get this working with no luck keep getting the following. the feeds do work in vlc.

unknown
sorry if the photo is not clear enough I can type out the error

the logs show:

2016/08/03 10:54:17 - l_default - DEBUG - autodetected resolution of['1824', '984']
2016/08/03 10:54:17 - l_default - DEBUG - nr_of_columns = 2
2016/08/03 10:54:17 - l_default - DEBUG - camera_streams config option exist, using this one

and my rpisurv is:

essentials:
    #These are the rtsp streams you want the program to display
    #The streams will be displayed in the order you present them here
    camera_streams:
        rtsp_url: "rtsp://**unifiserver**:7447/url"
        rtsp_url: "rtsp://**unifiserver**:7447/url"

    #How many columns you want the program to use, it will autocalculate the amount of row needed based on the resolution of your screen
    nr_of_columns: "2"

    #rpisurv detects the connectable streams on startup, 
    #if this option is enabled it will keep the first calculated layout for the lifetime of the rpisurv running even if some cameras go down and come up, instead of redrawing the screen
    #When this option is set to True, rpisurv ignores all cameras configured that were not connectable when rpisurv was started
    keep_first_screen_layout: False

#!!!Normal users do not need to edit this section!!!
advanced:
    ##Enable this option if you want to have a fixed width of all your camera streams, 
    ##By default rpisurv autocalculates this value, this can cause streams to get "stretched", 
    ##if this value exceeds the available height, rpisurv will fallback to autocalculation   
    #fixed_width: 500

    ##Enable this option if you want to have a fixed height for all your camera streams, 
    ##By default rpisurv autocalculates this value, this can cause streams to get "stretched",
    ##if this value exceeds the available height, rpisurv will fallback to autocalculation  
    #fixed_height: 500

#These are fallbacks if autodection fails;
#Normally you do not need to configure these
fallbacks:
    resolution:
        width: "1920"
        height: "1080"

multiple streams and blanking hdmi

I'm struggling with an issue displaying 3 or more 1080p rtsp streams to an HDMI 1080p display.
A single RTSP works flawlessly and I've tested with "Automatic" display detection on an HDMI and DVI monitors discretely.
I've set gpu_mem=512 and I'm running an RPi 3 with updated raspbian pixel.

If I configure RPiSurv for 4 RTSP streams, I have to force HDMI to 1280x720p with:

hdmi_ignore_edid=0xa5000080
hdmi_group=2
# explicit 720P
hdmi_mode=85

Otherwise, if I comment these settings out and just run with automatic display detection, which is connected to a 1080P Asus display, the screen blanks after the first of the 4 streams is drawn and the monitor reports "power save mode"

I've tried the same on an older Dell via DVI and I get the same result.

UPDATE:
I've tested both with and without overscan disabled.
I am testing with 4 OpenEye cameras, set to H264 1920x1080 at 15fps as sources and nr_of_columns: "2"

Any ideas?

Config must be edited in /usr/local/bin/rpisurv/conf/surveillance.yml

Thanks @SvenVD for the great work you have done for rpisurv 2.0

Other than in the documentation, the changes of configuration for the cams must be done in:
/usr/local/bin/rpisurv/conf/surveillance.yml
and not in:
/etc/rpisurv/surveillance/conf/surveillance.yml

I installed from a plan Rasbian and followed exactly all instructions.

Updates to this tool

Wondering how you would recommend safely updating existing instances of this. Any suggestions?

Streams work in VLC. "Connecting..." in Rpisurv

Hello,

All 3 of my streams work correctly in VLC, but Rpisurv shows them as connecting...

Status shows:

Jan 15 20:00:28 raspberrypi rpisurv[1369]: 2018/01/15 20:00:28 - worker - DEBUG - Starting stream cam_stream3 with commandline ['/usr/bin/omxplayer', '--live', '--timeout', '60', '--aidx', '
Jan 15 20:00:28 raspberrypi rpisurv[1369]: have a nice day ;)
Jan 15 20:00:28 raspberrypi rpisurv[1369]: have a nice day ;)
Jan 15 20:00:29 raspberrypi rpisurv[1369]: have a nice day ;)
Jan 15 20:00:33 raspberrypi rpisurv[1369]: 2018/01/15 20:00:33 - worker - DEBUG - Starting stream cam_stream1 with commandline ['/usr/bin/omxplayer', '--live', '--timeout', '60', '--aidx', '
Jan 15 20:00:33 raspberrypi rpisurv[1369]: 2018/01/15 20:00:33 - worker - DEBUG - Starting stream cam_stream2 with commandline ['/usr/bin/omxplayer', '--live', '--timeout', '60', '--aidx', '
Jan 15 20:00:33 raspberrypi rpisurv[1369]: have a nice day ;)
Jan 15 20:00:33 raspberrypi rpisurv[1369]: 2018/01/15 20:00:33 - worker - DEBUG - Starting stream cam_stream3 with commandline ['/usr/bin/omxplayer', '--live', '--timeout', '60', '--aidx', '
Jan 15 20:00:33 raspberrypi rpisurv[1369]: have a nice day ;)
Jan 15 20:00:34 raspberrypi rpisurv[1369]: have a nice day ;)

Problem running rpisurv under Sept 2017 version of Raspbian

Hi,

I've just tried installing rpisurv under the latest version of raspbian (2.1, sept 2017), both with and without GUI to no avail.

When I reboot the device I am at a prompt logged in as pi, drawn over top of the "Welcome to the Raspberry Pi Desktop" loading screen, with "systemd-user-sessions-service" displayed in the lower left corner.

I have set max GPU memory to 256 (max for rpi 3 B), and I have not added any tabs to /etc/rpisurv.

Issue with RTSP validation "Not Connectable (failed rtsp validation, no response from rtsp server)"

Hi!

First of all thanks for that great piece of software. I'm currently testing serveral setups for potential commercial use.

Yesterday I tried to connect Intellinet IP-Dome cameras - those come with RTSP support and quite good RTSP-configuration possibilities.
All cameras worked perfect on the first try through VLC.
But it seems like rpisurv couldn't validate the existance of a RTSP-Server.

I worked arround the issue by changing the code in surveillance.py - to evaluate the failed test for RTSP-validation to true.

#If we come to this point it means we have some data received, before we return True we need to check if are connected to an RTSP server if not rtsp_response: logger.error(self.hostname + " : " + str(self.port) +" Not Connectable (failed rtsp validation, no response from rtsp server)") return True

All streams connected immediately.

Of course I'm not very happy with that - I don't fully understand the code though (not a programmer).
Is there anything else I could do to fix that validation? Is it a configuration problem on server (camera) side?

Request: Date and Time

First of all, just wanted to say thanks for coming up with this RPISURV, it's great!

I looked a little bit to try and see if this was even possible for a date and time display and wasn't successful but how difficult would this project be to add a date and time along the bottom?

I have two reasons for the date and time usage:

  1. To be able to look up and see the date and time with seconds.
  2. We have had the Pi freeze up about 10 times or so but we don't even realize it has frozen until our motion alert goes off on the screen. I setup the watchdog so I hope the freezing issue is fixed with the watchdog. As far as motion alert I just have our camera server send a ssh motion alert sound to the rpi on alert.

Crashing

I'm unable to get streams to work. service crashing...

sudo systemctl status rpisurv
● rpisurv.service - Rpisurv Raspberry Pi Surveillance
Loaded: loaded (/etc/systemd/system/rpisurv.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2018-03-24 16:01:11 UTC; 201ms ago
Process: 1484 ExecStart=/usr/bin/rpisurv (code=exited, status=1/FAILURE)
Main PID: 1484 (code=exited, status=1/FAILURE)

Mar 24 16:01:11 PaulMarinePi1 systemd[1]: rpisurv.service: Failed with result 'exit-code'.
Mar 24 16:01:12 PaulMarinePi1 systemd[1]: rpisurv.service: Service hold-off time over, scheduling restart.
Mar 24 16:01:12 PaulMarinePi1 systemd[1]: Stopped Rpisurv Raspberry Pi Surveillance.
Mar 24 16:01:12 PaulMarinePi1 systemd[1]: Started Rpisurv Raspberry Pi Surveillance.

Also found this:

Mar 24 16:32:49 PaulMarinePi1 rpisurv[4425]: Traceback (most recent call last):
Mar 24 16:32:49 PaulMarinePi1 rpisurv[4425]: File "surveillance.py", line 372, in
Mar 24 16:32:49 PaulMarinePi1 rpisurv[4425]: all_camera_streams=setup_camera_streams(camera_streams)
Mar 24 16:32:49 PaulMarinePi1 rpisurv[4425]: File "surveillance.py", line 247, in setup_camera_streams
Mar 24 16:32:49 PaulMarinePi1 rpisurv[4425]: cam_stream=CameraStream(cam_stream_name,camera_stream)
Mar 24 16:32:49 PaulMarinePi1 rpisurv[4425]: File "surveillance.py", line 45, in init
Mar 24 16:32:49 PaulMarinePi1 rpisurv[4425]: self.port = self.parsed.port
Mar 24 16:32:49 PaulMarinePi1 rpisurv[4425]: File "/usr/lib/python2.7/urlparse.py", line 113, in port
Mar 24 16:32:49 PaulMarinePi1 rpisurv[4425]: port = int(port, 10)
Mar 24 16:32:49 PaulMarinePi1 rpisurv[4425]: ValueError: invalid literal for int() with base 10: ''

Warn if gpu_mem is too low?

I found I wasn't able to start more than 2 streams with the default gpu_mem setting. Perhaps having some logic that warns with a suitable warning if you fail to spawn additional streams? I only thought this might be an issue after looking at the README file.

Just a question about the grid

Hello,
Thanks for your efforts
I'm about to install this version on a fresh install RPi 3B+
I actually would like to project 7 camera streams. Is there a way to have 1 camera bigger than the rest and all the others around it (right and bottom)?

Like this one: https://www.google.com/search?q=camera+surveillance+monitor&client=firefox-b-ab&source=lnms&tbm=isch&sa=X&ved=0ahUKEwit6d3ToIPdAhWOmbQKHTqOAT4Q_AUICigB&biw=1920&bih=943#imgrc=fCBkln6gUWc2cM:

Many Thanks
Marnik

rtsp_over_tcp: true and omxplayer older than Feb. 2016

I have several cams which will not run over UDP and need TCP!
Why don't you change the installer and install the with TCP working version instead of
apt-get install omxplayer...

I got everything running tonight exept for my tcp-cams.

Thanks for rpisurv2.0
With more cams I can test the new features ;-)

can it do multi page screens

basically i have a DVR with 16 cams and i want to show 9 cams first then after a timeout period show the next 7 and keep rotating this,i believe this is not possible

Issue with 6 cameras (or more)

Hi,

This is a really great application, really like it. I'm having an issue with displaying 6 cameras though and I wonder if it's just a limitation of the hardware?

Here is a video of what happens when configured for 3 columns and autosizing enabled.
https://sendvid.com/ojrf3td2

For some reason it seems to be confused as to where to place the cameras. 5 works fine with the last image stretch, but as soon as a 6th is added this happens. When I add a 7th, the display cuts out completely when drawing the 3rd row. Very odd.

Using an RPi 3 with gpu_mem=512 connected to a 1920x1080 monitor (tested on 2 monitors just in case). Debug output showed 342MB of free memory with 6 cameras displayed.

Ideally, if the hardware allows for it I would like to get it working with more than 6 cameras eventually.

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.