2 2
Tom_Neverwinter

tutorial Motioneye (OPI)

Recommended Posts

There have been several disjointed tutorials on making a raspberrypi or orangepi into a surveillance camera. So I threw this together to maybe help someone out there with any issues.

I used the orangepipc+ but any orangepi board should work as long as it has the basics, internet connectivity, storage, and a camera. (I highly suggest heatsinks as well)

 

any feedback or enhancements to this tutorial are greatly appreciated.

 

------------------------------------------------------------------

ORANGEPI IPCAMERA

------------------------------------------------------------------

 
su root
 
apt-get update
apt-get upgrade
apt-get install

wget https://github.com/ccrisan/motioneye/wiki/precompiled/ffmpeg_3.1.1-1_armhf.deb
dpkg -i ffmpeg_3.1.1-1_armhf.deb
 
apt-get remove libavcodec-extra-56 libavformat56 libavresample2 libavutil54
 
apt-get install python-pip python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5
 
wget https://github.com/Motion-Project/motion/releases/download/release-4.0.1/pi_jessie_motion_4.0.1-1_armhf.deb
dpkg -i pi_jessie_motion_4.0.1-1_armhf.deb
 
pip install motioneye

mkdir -p /etc/motioneye
cp /usr/local/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf
 
mkdir -p /var/lib/motioneye
 
cp /usr/local/share/motioneye/extra/motioneye.systemd-unit-local /etc/systemd/system/motioneye.service
systemctl daemon-reload
systemctl enable motioneye
systemctl start motioneye
 
sudo modprobe gc2035
sudo modprobe vfe_v4l2
 
systemctl restart motioneye

Accessing The Frontend

After having successfully followed the installation instructions, the motionEye server should be running on your system and listening on port 8765. Fire up your favorite web browser and visit the following URL (replacing [your_ip] with... well, your system's IP address):

http://[your_ip]:8765/

Use admin with empty password when prompted for credentials. For further details on how to configure motionEye, see Configuration.

 

------------------------------------------------------------------

FOR UPDATES;

------------------------------------------------------------------

 

pip install motioneye --upgrade

systemctl restart motioneye

 

 

 sudo nano /etc/motioneye/motioneye.conf

ctrl+x then y (nano)

 

Modifiy the motion.config file to turnoff localhost;

stream_localhost off

 

change the port to 80 from 8765 if desired by; 

 

systemctl enable motion

systemctl start motion

 

 

Tutorial sources;

https://github.com/ccrisan/motioneye/wiki/Install-On-Raspbian

http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=941 

http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=1988  (some resources for motion)

http://www.cnx-software.com/2015/09/26/how-to-use-orange-pi-camera-in-linux-with-motion/(VERY OLD)

 

WIP tutorial, I want to add a version with facial recognition using openface and a version using ALPR (automatic license plate recognition, as the orangepi systems can have 2GB of ram)

 

Update 1 09/30/16;

seems there is a issue with motioneye and being unable to find the csi camera. I'm trying to find a work around, any help is appreciated.

Update 2 11/05/2016

Updated motioneye installation

added information on motion and basic setup (incomplete)

the editor seems to be breaking my wget addresses :(

I forgot to add the login information and frontend... *DOH*

Share this post


Link to post
Share on other sites

I get when adding a new camera An error occured. Refressing is recomanded. After refresh there appears a Cam without immage.

Tested it on Orange Pi One/PC/BananaPro with USB and OPiCam. The usb cam are autorecognised in MotionEYEOS so there is stil something broken in my install.

 

sudo nano /etc/modules  has alsow to be edited for gc2035 vfe_v4l2 ?

Share this post


Link to post
Share on other sites

Where do i get those Armbian Xenial 16.04? You arent meaning 15.10 xulong ... 

In the official Daily Beta Preview â–º http://image.armbian.com/betaimages/

Here you can find (at today) an image called → Armbian_5.24.161127_Orangepipc_Ubuntu_xenial_4.9.0.img 

 

You can use on Orange Pi One but remember: is beta and don't have HDMI support, you must config by SSH or Serial.

Share this post


Link to post
Share on other sites

Hi,

 

I am very keen on installing motioneye on my orangepi zero. followed your instructions but getting :

root@orangepizero:~# apt-get install python-pip python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libmysqlclient18 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
 
E: Unable to locate package libx264-142
E: Unable to locate package libavcodec56
E: Unable to locate package libavformat56
E: Package 'libmysqlclient18' has no installation candidate
E: Unable to locate package libswscale3
 
I am pretty new to this arm world so any help will be greatly appreciated!
 
 
Thanks,
Moshe

Share this post


Link to post
Share on other sites
21 hours ago, Marthinius said:

Please restore instructions for install motioneye with motion version 4.1.1.1

 

You don't need a new guide. Motion 4.1.1 isn't available on Armbian, Mr Dave's build is only for Raspbian.

 

On Armbian (i.e. Orange Pi Zero) download new Stretch build 5.38 next, mainline 4.14.14. Do not use Ubuntu.

 

Follow original installation guideline:

https://github.com/ccrisan/motioneye/wiki/Install-On-Debian

(For Debian Stretch)

 

BEFORE point 4 install pip dependencies:

sudo pip install wheel

sudo pip install setuptools

sudo apt-get install zlibc zlib-gst zlib1g-dev

 

Continue to point 4...

... at the end of installation point to [yourip]:8765 and configure it.

 

et voilà! :-)

 

Now Motioneye 0.38 run on motion 4.01.

New motion version is usefull for new cam h264/rtsp based.

 

Istantanea_2018-01-27_16-08-22.png

 

With little OPZ performance is quite respectable:

15fps (streaming) / 10 fps (analisys and capture) with a HD stream 1280x720px, H264 900 kbit/s

12fps (streaming) / 7 fps (analisys and capture) with a HD stream 1280x720px, mjpeg 2,5 mbit/s

Load:  1.94  1.24  0.53

Temp: 70 °C

(without hardware acceleration...)

 

 

Mk

Share this post


Link to post
Share on other sites

@Moklev thanks a lot for yours indications it has worked very fine for me

Important to know : CSI seems not be supported yet in mainline, so the orange pi camera will not work in armbian debian mainline

([edit] maybe it works now, and maybe this was because of a problem with the driver, please see the second reply below.)

Share this post


Link to post
Share on other sites
On 17.3.2018 at 2:56 PM, Ucino said:

Important to know : CSI seems not be supported yet in mainline, so the orange pi camera will not work in armbian debian mainline

http://linux-sunxi.org/Mainlining_Effort#Status_Matrix

As it can be seen here... :) 

 

There is progress in mainlining the camera interface see here (mostly for the V3s):

https://groups.google.com/forum/#!forum/linux-sunxi

 

It's not trivial and might need a lot of work before we see a mainlined CSI interface. 

 

On 17.3.2018 at 3:06 PM, Ucino said:

With USB cam it works very well :)

Do you get acceptable framerates with a USB webcam with motionEye? I only played a bit with it months ago and I had terrible slow framerates (6-7 fps).. To be honest, I used the cheapest usb cam from Aliexpress and never paid attention if this was a camera or settings related issue.

Share this post


Link to post
Share on other sites
15 hours ago, chwe said:

Do you get acceptable framerates with a USB webcam with motionEye? I only played a bit with it months ago and I had terrible slow framerates (6-7 fps).. To be honest, I used the cheapest usb cam from Aliexpress and never paid attention if this was a camera or settings related issue.

 

With an ELP 2mpx usb camera you can stream at 30+ fps, with streaming only and motion process disabled.

Motion's slow dog process is a problem, you require an i5 cpu for a reasonable performance. With a little OPZ @1GHz Motioneye (Motion 4.01) runs at 15fps/720p but drop below 6-7fps if an event starts saving an image sequence (ca. 10 jpeg images).

Share this post


Link to post
Share on other sites
On 3/18/2018 at 6:34 PM, chwe said:

http://linux-sunxi.org/Mainlining_Effort#Status_Matrix

As it can be seen here... :) 

 

There is progress in mainlining the camera interface see here (mostly for the V3s):

https://groups.google.com/forum/#!forum/linux-sunxi

 

It's not trivial and might need a lot of work before we see a mainlined CSI interface. 

Thanks for this information, that's good news that there is these progress.

 

On 3/18/2018 at 6:34 PM, chwe said:

Do you get acceptable framerates with a USB webcam with motionEye? I only played a bit with it months ago and I had terrible slow framerates (6-7 fps).. To be honest, I used the cheapest usb cam from Aliexpress and never paid attention if this was a camera or settings related issue.

Using CSI or USB the framerates are both identical and low (3 - 5fps) using only streaming , i have also no idea if it's because of motionEye default configuration, because I use OrangePiPC+, or other reasons :/ However it's enough for what I'm trying to do (a camera to put in birdhouse for the school project with orangepipc+). 

On 3/18/2018 at 9:44 PM, Moklev said:

you require an i5 cpu for a reasonable performance

oh ok, thanks for your feedback.

Share this post


Link to post
Share on other sites
On 18.3.2018 at 9:44 PM, Moklev said:

Motion's slow dog process is a problem, you require an i5 cpu for a reasonable performance. With a little OPZ @1GHz Motioneye (Motion 4.01) runs at 15fps/720p but drop below 6-7fps if an event starts saving an image sequence (ca. 10 jpeg images).

I think this is mostly related to this stuff here...

http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegVideoCodec

 

There's a lot of enhancement for the cameradriver and I think @@lex did some stuff there and maybe you get better performance with the cedrus ffmpeg stuff..

 

I never paid that much attention to see if this can help for motion... 

Share this post


Link to post
Share on other sites
9 hours ago, chwe said:

I think this is mostly related to this stuff here...

http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegVideoCodec

 

There's a lot of enhancement for the cameradriver and I think @@lex did some stuff there and maybe you get better performance with the cedrus ffmpeg stuff..

 

I never paid that much attention to see if this can help for motion... 

 

Motion has a complex workflow and an accelerated ffmpeg can help only partly. See the Raspberry/OpenMax version... which performs similarly despite is fully gpu accelerated (he's only more rapid to generate mp4 by events). Motion's analysis is frame-by-frame: you need to demux input stream, convert to raw single frames, processing and remux final stream.

Share this post


Link to post
Share on other sites
On 18/03/2018 at 6:34 PM, chwe said:

Do you get acceptable framerates with a USB webcam with motionEye? I only played a bit with it months ago and I had terrible slow framerates (6-7 fps).. To be honest, I used the cheapest usb cam from Aliexpress and never paid attention if this was a camera or settings related issue.

 

I have made some tests. It's not with USB but with CSI camera of orange pi, on orange pipc+ + armbian ubuntu desktop (but used without screen) & using a debian laptop to connect to the opipc+

If I do :

General settings > advanced settings > on

Video device > Frame rate > 20

Resolution > 640 x 480 (was by default)

I have a better framerate : 10 / 12 fps.

Share this post


Link to post
Share on other sites
20 hours ago, Ucino said:

 

I have made some tests. It's not with USB but with CSI camera of orange pi, on orange pipc+ + armbian ubuntu desktop (but used without screen) & using a debian laptop to connect to the opipc+

If I do :

General settings > advanced settings > on

Video device > Frame rate > 20

Resolution > 640 x 480 (was by default)

I have a better framerate : 10 / 12 fps.

 

Very bad performance.
I got ca. 15/20 fps in 1280x720 and 30+ fps in 640x480 (limited...).
With a Orange Pi Zero (slower than your PC Plus) and a system load of 1.30 ca.
Motion trigger, light trigger and smart area mask.

 

Schermata del 2018-03-22 20-55-33.png

Share this post


Link to post
Share on other sites
28 minutes ago, Moklev said:

 

Very bad performance.
I got ca. 15/20 fps in 1280x720 and 30+ fps in 640x480 (limited...).
With a Orange Pi Zero (slower than your PC Plus) and a system load of 1.30 ca.
Motion trigger, light trigger and smart area mask

.

Very nice ! Have you made some special setup of motioneye ?

I'm using armbian ubuntu desktop (but without screen), maybe you use a headless version ?

Or maybe it's because of I'm using wifi with an important distance ?

Share this post


Link to post
Share on other sites
53 minutes ago, Ucino said:

Very nice ! Have you made some special setup of motioneye ?

I'm using armbian ubuntu desktop (but without screen), maybe you use a headless version ?

Or maybe it's because of I'm using wifi with an important distance ?

 

With Motioneye use ONLY Debian server/headless, best with cabled ethernet. With wifi the performance is reduced.
My setup is: Orange Pi Zero (512MB) with Armbian 5.41/Debian Stretch 4.14.18 (next), MotionEye 0.38.1 and Motion 4.01.
Use H264 for maximum performance and MJPEG for maximum quality.

Share this post


Link to post
Share on other sites

Yes, for CSI camera you must stay on legacy (Jessie dafault).

CSI on mainline is on WIP stage.

Main difference is Motion 3.2.12 (instead of 4.01). Next kernel 4.14.18 is more stable than 3.x (uptime: weeks vs few days). On Jessie may need "deb multimedia" packages for a recent ffmpeg version.
I recommend you a good USB camera H264/MJPEG capable.

Share this post


Link to post
Share on other sites
2 2