whocares_ido
Posts: 59
Joined: Wed Sep 26, 2012 5:47 pm

Re: Motion - MMAL camera

Thu Jan 15, 2015 6:33 pm

Hello!

I am trying to compile motion-mmal myself (to learn something).

I have tried to follow the instructions but I do get an error message:

Code: Select all

[email protected] ~ $ git clone https://github.com/dozencrows/motion.git
Cloning into 'motion'...
remote: Counting objects: 2904, done.
remote: Compressing objects: 100% (793/793), done.
remote: Total 2904 (delta 2103), reused 2904 (delta 2103)
Receiving objects: 100% (2904/2904), 2.64 MiB | 646 KiB/s, done.
Resolving deltas: 100% (2103/2103), done.
[email protected] ~ $ cd motion/
[email protected] ~/motion $ USERLANDPATH=/home/pi/userland cmake .
CMake Error: The source directory "/home/pi/motion" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
The file CMakeLists.txt is missing. I do see it though in the github listing. Why is the file not there after using git clone?

Thank you for your help!

Best regards,
Alex

User avatar
dozencrows
Posts: 172
Joined: Sat Aug 04, 2012 6:02 pm

Re: Motion - MMAL camera

Fri Jan 16, 2015 12:04 pm

I think you are on the master branch, not the mmal branch. If when you type 'git status' it say "On branch master", then that will be the problem.

You can switch to the mmal branch by typing 'git checkout mmal-test'.

whocares_ido
Posts: 59
Joined: Wed Sep 26, 2012 5:47 pm

Re: Motion - MMAL camera

Fri Jan 16, 2015 4:59 pm

Thank you for the quick reply.

Now the next hurdle:
What do I need to do to install the binaries?

"sudo make install" does not do the trick...

cweub
Posts: 12
Joined: Wed Mar 26, 2014 2:46 am

Re: Motion - MMAL camera

Fri Jan 16, 2015 6:18 pm

Almost got the camera working with the mmal version of motion... I can access the regular Apache http page and I can even get the camera controls when I expose that via the conf file. However, for whatever reason am unable to get the camera exposed to stream.

I have confirmed I am using the mmal version and conf files and that is indeed what is running. The camera light is on when I run the startup script as provided (thanks for all this by the way).

the conf has the port line below (but nothing comes up when I try it although the controls page will come up at :8082 as defined):
# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 8089

However two things happening which look strange based on the posts here (not sure if this is normal):
1) tcp 0 0 0.0.0.0:8089 0.0.0.0:* LISTEN 5017/motion-mmal
there is no ip assigned oddly although it does appear correct for controls:
tcp 0 0 127.0.0.1:8082 0.0.0.0:* LISTEN 5017/motion-mmal


2) log startup log says: http_bindsock: motion-stream bind() failed, retrying:
motion_init: Problem enabling motion-stream server in port 80:

any help is appreciated!

cweub
Posts: 12
Joined: Wed Mar 26, 2014 2:46 am

Re: Motion - MMAL camera

Sat Jan 17, 2015 3:32 am

Although this is still not working- i.e. I cannot see any http stream on Chrome within my network at the ip/port... I did figure out the #2 issue. Apparently I had added the original motion to the startup scripts so I think that was already running when I launched the mmal version- I'm guessing that's where the port conflict was happening because now it's gone.

However, the camera LED is lit and the software seems to be running and I get no response from the page. Note I can see the apache home page fine at port 80. Stuck on where else to look at the moment.

thanks!

User avatar
dozencrows
Posts: 172
Joined: Sat Aug 04, 2012 6:02 pm

Re: Motion - MMAL camera

Sat Jan 17, 2015 10:10 am

@whocares_ido - the mmal binaries are experimental, and are not configured to be installable. You don't need to install to run; just type the following when in the motion source directory:

Code: Select all

./motion -n -c configs/motion-mmalcam.conf
Note that the preceding dot-slash ./ is critical, as this ensures motion is run from the current directory.

You can copy the motion binary to wherever you need to run it from.

@cweub - have you tried Firefox? motion's stream is MJPEG format, which Chrome no longer supports.

cweub
Posts: 12
Joined: Wed Mar 26, 2014 2:46 am

Re: Motion - MMAL camera

Sat Jan 17, 2015 1:22 pm

@dozencrows thanks and yes that was the only prob- got the stream now...thanks again for all the work put into this!

User avatar
SteveDee
Posts: 343
Joined: Thu Dec 29, 2011 2:18 pm
Location: Sunny Southern England
Contact: Website

Re: Motion - MMAL camera

Fri Jan 23, 2015 1:01 pm

I used this version of motion by dozencrows very successfully last spring for my 2014 birdbox.

This year I started down the road of building a system using Raspbian Jessie (rather than Wheezy) but I've now run into dependency problems (e.g. libavformat53).

Is there a solution to this, or must I roll back to Wheezy?

cweub
Posts: 12
Joined: Wed Mar 26, 2014 2:46 am

Re: Motion - MMAL camera stream latency

Mon Jan 26, 2015 3:43 pm

I have read through many posts here but so far no luck finding anyone who seems to have the same degree of latency (30 full seconds) I am getting. I have cut the quality down to 50%, reduce the size, adjusted fps etc and still doesn't seem to impact it much. Can anyone provide some input on what sort of latency is "normal" using this setup? I am running an A model with Pi Noir and it works technically speaking, just the latency is making is unusable as a streaming webcam...it sounds like it's even slower than USB connected cams which makes no sense with the integrated cam.

My wireless is healthy and getting ranges from 100 Mbps-250 Mbps and no issues with anything on that side that I can see.

I don't think the A should be so much slower this would be impacted that much?

just not sure where else to look to tweak.

thanks!

Codex.
Posts: 3
Joined: Tue Aug 12, 2014 5:55 am

Re: Motion - MMAL camera

Wed Feb 04, 2015 12:01 am

Codex. wrote:Hey all

I haven't had much luck finding information on how to adjust the sensitivity of the motion captured

Can anyone please advise the setting to adjust this?

I keep getting 30 videos a day of a cloud going over the sun and dimming the room it's in enough to trigger it x____x
Bumping this post, still couldn't find a solution to this T___T

I got a Pi 2 so will have a chance to go through all the config again and start fresh, need to rewrite my python script i'm using to move the videos into google drive though, pretty messy at the mo

spikedrba
Posts: 75
Joined: Fri Feb 28, 2014 2:19 am

Re: Motion - MMAL camera

Wed Feb 04, 2015 10:04 pm

Codex. wrote:Hey all

I haven't had much luck finding information on how to adjust the sensitivity of the motion captured

Can anyone please advise the setting to adjust this?

I keep getting 30 videos a day of a cloud going over the sun and dimming the room it's in enough to trigger it x____x
Codex,

I couldn't find your original post, but I'm assuming you look inside motion's config file, yeah?

on line 199 there's where the motion detection settings start:

https://github.com/dozencrows/motion/bl ... .conf#L199

as you can see one of the settings is threshold.

hope that helps,

Spike

Codex.
Posts: 3
Joined: Tue Aug 12, 2014 5:55 am

Re: Motion - MMAL camera

Wed Feb 04, 2015 10:20 pm

spikedrba wrote:
Codex. wrote:Hey all

I haven't had much luck finding information on how to adjust the sensitivity of the motion captured

Can anyone please advise the setting to adjust this?

I keep getting 30 videos a day of a cloud going over the sun and dimming the room it's in enough to trigger it x____x
Codex,

I couldn't find your original post, but I'm assuming you look inside motion's config file, yeah?

on line 199 there's where the motion detection settings start:

https://github.com/dozencrows/motion/bl ... .conf#L199

as you can see one of the settings is threshold.

hope that helps,

Spike
Exactly what I was trying to find! Thank you! Will toy with this with the new pi setup :)

mainsailman
Posts: 18
Joined: Thu Sep 25, 2014 8:51 pm

Re: Motion - MMAL camera

Thu Feb 26, 2015 8:58 pm

any idea on where my settings are wrong in mmal?

http://imgur.com/LwPIztH

nickbelfast
Posts: 1
Joined: Thu Feb 26, 2015 9:20 pm

Re: Motion - MMAL camera

Thu Feb 26, 2015 9:21 pm

Hi,

I have followed the instructions on this page. Motion starts on bootup although it turns off again after a few seconds. The same happens when I start it from the command line with:
sudo /etc/init.d/motion start

Any ideas why this is the case?

Thanks

User avatar
dozencrows
Posts: 172
Joined: Sat Aug 04, 2012 6:02 pm

Re: Motion - MMAL camera

Sat Feb 28, 2015 12:19 pm

mainsailman wrote:any idea on where my settings are wrong in mmal?

http://imgur.com/LwPIztH
Have you got output_debug_pictures or ffmpeg_output_debug_movies set in your config file?

User avatar
dozencrows
Posts: 172
Joined: Sat Aug 04, 2012 6:02 pm

Re: Motion - MMAL camera

Sat Feb 28, 2015 12:25 pm

nickbelfast wrote: I have followed the instructions on this page. Motion starts on bootup although it turns off again after a few seconds.
Have you looked in the log file to see if it gives any helpful information? The default for the MMAL version is /home/pi/motion.log

If that doesn't say much, try increasing the log_level setting in the config file to 8 and try again.

Which Pi Linux distribution are you using? And did you install motion from its repositories, get it from the Drop-box link or build it from source?

vanderhoff
Posts: 2
Joined: Sat Mar 07, 2015 12:18 pm

Re: Motion - MMAL camera

Sat Mar 07, 2015 12:56 pm

Has anyone got motion to work on a pi2?

I have a couple of installations working fine on B+ boards, but my first attempt with a Pi2 produces broken-up and torn images. I don't really understand the log, but it seems that the main thread keeps timing out. Maybe something to do with the multi-core cpu?

Any advice, please?

vanderhoff
Posts: 2
Joined: Sat Mar 07, 2015 12:18 pm

Re: Motion - MMAL camera

Sun Mar 15, 2015 3:58 pm

Just in case anyone finds this post via a web search, mmal works fine on a pi2. My problem was a faulty camera module -- now replaced.

jonarin
Posts: 1
Joined: Thu Mar 12, 2015 7:49 am

Re: Motion - MMAL camera

Sun Mar 15, 2015 4:12 pm

Thanks, how is the performance?

brownjd
Posts: 2
Joined: Wed May 13, 2015 8:39 pm

Re: Motion - MMAL camera

Mon May 18, 2015 9:26 pm

intima wrote:I'm having trouble getting Motion - MMAL to record to .mov format.

When I set the following in /etc/motion.conf

Code: Select all

ffmpeg_video_codec mov
I get the following error:

Code: Select all

raspberrypi motion: [1] [ERR] [ENC] ffmpeg_open: avcodec_open - could not open codec mov
raspberrypi motion: [1] [ERR] [EVT] event_ffmpeg_newfile: ffopen_open error creating (new) file [/home/pi/MotionTempFiles/2014-06-11-12-17-40.mov]: 
Does anyone know why this is? Is it a simple case of installing a Quicktime library or something that I'm missing?
I'm having the same problem and didn't see any responses.

+1

jdupa
Posts: 3
Joined: Mon May 18, 2015 10:52 pm

Re: Motion - MMAL camera

Mon May 18, 2015 10:58 pm

I was able to compile the latest commit, however none of the options for mmalcam_control_params are being recognized. Specifically I tried to alter the exposure time, ISO, shutter speed etc. to no effect. Is this configuration option disabled in the latest commit?
Thanks.

ifermon
Posts: 10
Joined: Tue May 12, 2015 12:34 pm

Re: Motion - MMAL camera

Thu May 28, 2015 12:12 pm

Any chance I can get to the source code? I'm trying to merge it into the latest version so that I can get stream authentication (i.e. my webcam is not visible to everyone over the internet).

Thank you
dozencrows wrote:I've had some success writing a new module for Motion that reads frames directly from the Pi camera via the MMAL API. A test binary and config file is available here: https://www.dropbox.com/s/xdfcxm5hu71s9 ... mal.tar.gz

This binary is based on Motion SVN trunk at revision 557, and is compiled without MySQL, PostgreSQL or SDL support. Because it's based on trunk and not the 3.2 release branch, the syntax for the config file is different to the available documentation on the Motion wiki.

Next likely steps with this are:
* Tidy up, make command line build work and share the source publically.
* Add an option to support Pi camera settings available in raspivid/raspistill.
* Try optimising some obvious hotspots for the Pi (in reference frame tuning and frame difference code).

wildart
Posts: 1
Joined: Wed Jul 22, 2015 2:48 am

Re: Motion - MMAL camera

Wed Jul 22, 2015 3:01 am

I added hardware H264 encoding instead of ffmpeg to MMAL version, and cleaned it from some dependecies (no need for libffmpeg to build motion). If anybody is interested, look at omx branch in this repo: https://github.com/wildart/motion/tree/omx

Oleg13
Posts: 1
Joined: Thu Aug 06, 2015 9:02 am

Re: Motion - MMAL camera

Thu Aug 06, 2015 9:12 am

Hello Friends,

I'm quite new to both Linux and Raspberry, so I hope you'll be patient with me.
I can see this thread is dedicated to MMAL camera component, but many thoughts exchanged here are a bit above my head. Alright. To the point.

I'm trying to build a security camera using motion, as many people do. I have had an initial success using RPi's camera boards. However, when I wanted to change towards 2 usb cameras, motion fails at the start giving me the following error in the log (/tmp/motion.log)

"Failed to create MMAL camera component."

I don't know how to fix that. Just for your information, I've tried the following to narrow it down:
1. I checked for the presence of /dev/video0 and /dev/video1 - they exist.
2. I installed fsbwebcam and tried to take pictures using both cameras - succeeded.
3. I checked the resolution of cameras - they both work taking pictures at 1280x720 resolution.
4. I increased GPU memory to 256MB.
5. Finally, I flashed SD card twice and started from scratch, making sure I didn't do any typoes.

Here's the link to the tutorial used: http://www.codeproject.com/Articles/665 ... nce-camera

Thank you for your help. I will appreciate any comments and suggestions to resolve this issue.

CanuteTheGreat
Posts: 1
Joined: Mon Oct 05, 2015 5:32 pm
Location: Ferndale, WA

Re: Motion - MMAL camera

Mon Oct 05, 2015 6:29 pm

I am trying to install this on a raspberry pi (B, B+, or 2 B) so I can use the native camera, but I have run into an issue where motion depends on libavformat53 (I see at least one other person has run into this, but no solution that I see so far). However, in the current stable Raspbian (based on Debian Jessie) the version available is 56. I also tried briefly to compile it from source but it appears the source has the same dependency - although I did not look into why the source has this requirement. I would appreciate any help with this. Thank you!

Return to “Camera board”