RasPipC - Cameras on your TV made Easy.

Tiger Tony

n3wb
Joined
Apr 12, 2017
Messages
6
Reaction score
0
Location
Oxford , UK
It sounds like mono did not install correctly. Did you specifically install the "mono-complete" package?
Hey thanks for getting back quickly.

Well, it looks like you're right. I've just downloaded "Mono complete" again, and it all appears to be working so far.
I've now got the "ugly web page" I can view from my pc.

How much of the web page do I need to configure ? I've currently only got 1 camera on my test network so I've only edited the address to suit it --- "rtsp://192.168.etc, etc "

Tony
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,677
Reaction score
14,029
Location
USA
Well you need one omxplayer command for each camera (one line for each camera).

Here is my own configuration that puts 3 cameras on a 1920x1080 monitor, leaving the upper-left area empty (I put a clock and weather information there)

Code:
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --layer 4 --nohdmiclocksync --avdict rtsp_transport:tcp --win "1440 0 1920 360" "rtsp://user:pass@192.168.0.39/cam/realmonitor?channel=1&subtype=1"
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --layer 3 --nohdmiclocksync --avdict rtsp_transport:tcp --win "0 540 960 1080" "rtsp://user:pass@192.168.0.40/cam/realmonitor?channel=1&subtype=2"
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --layer 2 --nohdmiclocksync --avdict rtsp_transport:tcp --win "960 360 1920 1080" "rtsp://192.168.0.52/Streaming/Channels/2"
For basic usage all you need to do is change the URL to point at your camera, and change the --win "xxx xxx xxx xxx" option to specify which portions of the screen you want the video to appear on. It is up to you to figure out the best coordinates for your cameras. I always prefer to preserve the original aspect ratio, so this tool comes in handy: Aspect Ratio Calculator (ARC)

Changes are applied when you click Save.

For more advanced usage, like if you want to use audio or something, open up a terminal on the pi and type

Code:
omxplayer -h
and it will output a full listing of all the command line options you can use.
 

Tiger Tony

n3wb
Joined
Apr 12, 2017
Messages
6
Reaction score
0
Location
Oxford , UK
I've changed the url to point at my camera, and altered the screen ratio to suit my monitor - "0 0 800 600" on the web page. I get the LXTerminal window auto boot up on the screen ok, and it shows when any changes are made to the web page, but no camera images are shown. It's as if the omxplayer is not running ?

If I 'exit' the program and just open a new terminal window and type in "omxplayer rtsp://192.168.1.120:554/av0.0" this shows my camera on the screen ok. So I know omxplayer is working and I've got the correct address of my camera.

Any ideas ?
 

JFire

Getting the hang of it
Joined
Aug 26, 2015
Messages
407
Reaction score
40
Location
Pittsburgh, PA
I read the first couple of pages and am interested. I have a wifi extender upstairs with ethernet ports. Could i just run the cable from the extender to the pi?

Sent from my SM-G928T using Tapatalk
 

DarkHelmet

Getting the hang of it
Joined
Feb 26, 2017
Messages
167
Reaction score
66
I read the first couple of pages and am interested. I have a wifi extender upstairs with ethernet ports. Could i just run the cable from the extender to the pi?
im sure you can setup your network however you feel comfortable. nayr just points out that wifi isnt rock solid. but if you think your extender is solid enough for your needs, go for it.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,677
Reaction score
14,029
Location
USA
I've changed the url to point at my camera, and altered the screen ratio to suit my monitor - "0 0 800 600" on the web page. I get the LXTerminal window auto boot up on the screen ok, and it shows when any changes are made to the web page, but no camera images are shown. It's as if the omxplayer is not running ?

If I 'exit' the program and just open a new terminal window and type in "omxplayer rtsp://192.168.1.120:554/av0.0" this shows my camera on the screen ok. So I know omxplayer is working and I've got the correct address of my camera.

Any ideas ?
I would try copy/pasting the entire omxplayer command (one line from the web interface) into a terminal and seeing what happens. Chances are, some other part of the command (maybe a typo in it) is causing the problem
 

Tiger Tony

n3wb
Joined
Apr 12, 2017
Messages
6
Reaction score
0
Location
Oxford , UK
I would try copy/pasting the entire omxplayer command (one line from the web interface) into a terminal and seeing what happens. Chances are, some other part of the command (maybe a typo in it) is causing the problem
I copied and pasted one line from the web page into a terminal and got a perfect picture from my camera with a size of 800 x 600 on my screen. So this part is correct.

But I had to exit/close the LXTerminal first ( which auto starts on boot up) to enable me to view my camera or it automatically terminated omxplayer !

I've completely rewritten the program as well by copying and pasting your instructions so hopefully no typo error there. But still no picture !

The message I get on the LXTerminal after boot up is:-

OmxPlayerAuto will listen on port 80, configurable in OPA_Settings.cfg
15/04/2017 17:17:31
Starting Service.
Type "exit" to close
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,677
Reaction score
14,029
Location
USA
Does the app indicate it is trying to start omxplayer processes? It should output (to the terminal it is running in) something like "X items will be started": and then list out each of your omxplayer commands. It should also be announcing when it restarts any omxplayer processes. And I believe you'll see omxplayer's text output as well (which would include any error messages). If you get none of that, then you've probably not even checked the Streaming Enabled box. Got to turn on the streaming before the streaming will happen.
 

Tiger Tony

n3wb
Joined
Apr 12, 2017
Messages
6
Reaction score
0
Location
Oxford , UK
Argh. Well I don't know what to tell you because it behaves fine for me.
Its very strange. What I cant understand is why omxplayer is being killed when I try to run the copy of the web line in a new terminal. The camera image is displayed ok on the screen for 1/2 second by omxplayer, then closes.
The LXTerminal displays a message saying " killing 1 omxplayer.bin process"
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,677
Reaction score
14,029
Location
USA
Its very strange. What I cant understand is why omxplayer is being killed when I try to run the copy of the web line in a new terminal. The camera image is displayed ok on the screen for 1/2 second by omxplayer, then closes.
The LXTerminal displays a message saying " killing 1 omxplayer.bin process"
The OmxPlayerAuto app works as a basic loop, following this procedure:

1) Kill any existing omxplayer processes.
2) If streaming is enabled ... (the Streaming Enabled checkbox in the configuration page).
A) Run all processes defined in the configuration text (one process per line)
B) Monitor the processes, and if any of them close, restart them.
C) Repeat Step 2B indefinitely until the Save button is clicked in the configuration page.​
3) If streaming is disabled ...
A) Wait 2.5 seconds, then go to Step 1.​

So when you have disabled streaming, or if you have not configured any processes to run, all this program will do is close all omxplayer processes every 2.5 seconds.
 

Tiger Tony

n3wb
Joined
Apr 12, 2017
Messages
6
Reaction score
0
Location
Oxford , UK
Sorted !

On the configuration webpage, that little checkbox that says "Streaming Enabled" , has to be ticked. Something I completely overlooked yesterday.

I've now added my Pi3 to my home network and have 2 cameras all running nicely and displaying perfectly on my screen. I'll probably add a third camera when I get it installed.
The latency is less than a second which is excellent for my purposes.

Many thanks for your persistence in helping me - told you I was a real novice when it comes to Linux :) !

Tony
 

Jmtyra

Young grasshopper
Joined
Nov 10, 2016
Messages
47
Reaction score
10
Location
Texas
(Modifying earlier post)

Anyone else seeing really odd latency issues with the video? No tearing or pixelation but a very strange latency issue where certain objects in a video stream are out of sync.

Example: A person walking by the camera shows up normally, and then a vehicle will drive by...however the vehicle doesn't show up in the video stream for 30 or more seconds but the person walking is still shown. Then maybe 30 seconds later the vehicle will show up in the stream long after it has actually driven by. It's the strangest thing I've seen, almost as if it's two different video sources being combined or something. This is all in the same video stream, same camera. :wtf:

This is on a Raspberry Pi 2 running 2017-04-10-raspbian-jessie; load stays under/around 20% or less. GPU is set to 256.

Webconfig is as follows:
Code:
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --layer 2 --nohdmiclocksync --avdict rtsp_transport:tcp --win "0 0 640 360" "rtsp://<URL>"
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --layer 2 --nohdmiclocksync --avdict rtsp_transport:tcp --win "640 0 1280 360" "rtsp://<URL>"
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --layer 2 --nohdmiclocksync --avdict rtsp_transport:tcp --win "1280 0 1920 360" "rtsp://<URL>"
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --layer 2 --nohdmiclocksync --avdict rtsp_transport:tcp --win "0 360 640 720" "rtsp://<URL>"
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --layer 2 --nohdmiclocksync --avdict rtsp_transport:tcp --win "640 360 1280 720" "rtsp://<URL>"
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --layer 2 --nohdmiclocksync --avdict rtsp_transport:tcp --win "1280 360 1920 720" "rtsp://<URL>"
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --layer 2 --nohdmiclocksync --avdict rtsp_transport:tcp --win "0 720 640 1080" "rtsp://<URL>"
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,677
Reaction score
14,029
Location
USA
Example: A person walking by the camera shows up normally, and then a vehicle will drive by...however the vehicle doesn't show up in the video stream for 30 or more seconds but the person walking is still shown. Then maybe 30 seconds later the vehicle will show up in the stream long after it has actually driven by. It's the strangest thing I've seen, almost as if it's two different video sources being combined or something. This is all in the same video stream, same camera. :wtf:
And the person / vehicle stays in motion the whole time? That would be super strange.

If you aren't running sub streams, you should be. Possibly the hardware decoder can't keep up with main streams? Or maybe you need to allocate more memory to the GPU.

The pi is plugged in to ethernet, not using wifi?
 

Jmtyra

Young grasshopper
Joined
Nov 10, 2016
Messages
47
Reaction score
10
Location
Texas
And the person / vehicle stays in motion the whole time? That would be super strange.
RIGHT!!! It's very weird and very strange.

If you aren't running sub streams, you should be. Possibly the hardware decoder can't keep up with main streams? Or maybe you need to allocate more memory to the GPU.
Yup using sub-streams, details below. That's what I was thinking too, maybe I should try with fewer streams. I wish there was a way to see the utilization of the GPU to know how well it is/isn't handling the load.
I'm going to bump it up to 384 and see if that helps. Also, I forgot about one of my streams is a fisheye/360 cam and I wasn't using a sub stream on that one. Might be part/all of the issue, so removing it for now.

Bitrate.jpg

The pi is plugged in to ethernet, not using wifi?
Correct, wired only. :)
 

Jmtyra

Young grasshopper
Joined
Nov 10, 2016
Messages
47
Reaction score
10
Location
Texas
SUCCESS! :) It was fisheye/360 cam. Removed it and all is well. Also tested with 256 and 384 for the GPU, no difference there.
The video is now very close to real time, less than a second. Maybe 250ms ~ 500ms slower than my PC-NVR which is much beefier.

I'm very VERY *VERY* excited about this solution now that it has proven to be successful. The RPi is cheap, small, easy to deploy/hook-up and uses almost no energy ($3/year).
This opens up a lot of possibilities for displaying security video around the house in key areas. Previously I didn't think that was possible or economical but now it's almost easy.

To all of those who have worked on this and similar projects:
thank you.jpg

Side-note, @bp2008 you mentioned displaying weather/time/etc on part of the screen. Could you elaborate on how you were doing this? Was that manually or were you integrating it into this configuration another way? It's storm season here in Texas so having the weather radar showing at all times is a good idea. :)
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,677
Reaction score
14,029
Location
USA
What I did is full screen a web page and make sure the info I wanted is in a spot not occupied by any video streams (because the streams overlap everything). The web page is scripted to keep the time and weather info up to date.
 

Ford

Getting the hang of it
Joined
Feb 14, 2015
Messages
167
Reaction score
97
Location
BC
There is 9 pages on this thread... Anyone willing to recap it into a 'RasPipC for dummies'?
 

Jmtyra

Young grasshopper
Joined
Nov 10, 2016
Messages
47
Reaction score
10
Location
Texas
Last edited:
Top