1

I set up motion and the UV4L drivers for the raspberry pi camera module, but when I try to start motion with sudo motion, and connect with VLC I only get a grey screen. This is what the terminal says:

[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478785
[0] Thread 1 is from /etc/motion/motion.conf
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Thread 1 started
[1] cap.driver: "raspicam"
[1] cap.card: "Camera Board OV5647"
[1] cap.bus_info: "CSI"
[1] cap.capabilities=0x01000001
[1] - VIDEO_CAPTURE
[1] - READWRITE
[1] Test palette YU12 (320x240)
[1] Using palette YU12 (320x240) bytesperlines 480 sizeimage 115200 colorspace 00000000
[1] found control 0x00980900, "brightness", range 0,100 
[1]     "brightness", default 50, current 50
[1] found control 0x00980901, "contrast", range -100,100 
[1]     "contrast", default 0, current 0
[1] found control 0x00980902, "saturation", range -100,100 
[1]     "saturation", default 0, current 0
[1] found control 0x0098090e, "red balance", range 0,800 
[1]     "red balance", default 100, current 100
[1] found control 0x0098090f, "blue balance", range 0,800 
[1]     "blue balance", default 100, current 100
[1] found control 0x08000000, "shutter speed", range 0,65535 
[1]     "shutter speed", default 0, current 0
[1] found control 0x08000001, "zoom factor", range 1,8 
[1]     "zoom factor", default 0, current 1
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8081
[1] Retrying until successful connection with camera
[1] cap.driver: "raspicam"
[1] cap.card: "Camera Board OV5647"
[1] cap.bus_info: "CSI"
[1] cap.capabilities=0x01000001
[1] - VIDEO_CAPTURE
[1] - READWRITE
[1] Test palette YU12 (320x240)
[1] Using palette YU12 (320x240) bytesperlines 480 sizeimage 115200 colorspace 00000000
[1] found control 0x00980900, "brightness", range 0,100 
[1]     "brightness", default 50, current 50
[1] found control 0x00980901, "contrast", range -100,100 
[1]     "contrast", default 0, current 0
[1] found control 0x00980902, "saturation", range -100,100 
[1]     "saturation", default 0, current 0
[1] found control 0x0098090e, "red balance", range 0,800 
[1]     "red balance", default 100, current 100
[1] found control 0x0098090f, "blue balance", range 0,800 
[1]     "blue balance", default 100, current 100
[1] found control 0x08000000, "shutter speed", range 0,65535 
[1]     "shutter speed", default 0, current 0
[1] found control 0x08000001, "zoom factor", range 1,8 
[1]     "zoom factor", default 0, current 1
[1] ioctl (VIDIOCGCAP): Invalid argument

What is the problem? Thank you!

1

Try adding the following 2 lines to /etc/init.d/motion after the # lines

LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libv4l/v4l1compat.so
export LD_PRELOAD
| improve this answer | |
  • You might want to consider including some explanation as to why this would solve the OP's issue - just to improve your answer quality. – RPiAwesomeness Nov 25 '14 at 21:38
  • I will try that, thanks. I suppose this just loads the v4l library for arm, am I right? – SimMac Dec 4 '14 at 12:35
0

Had the same problem with a 2B and found the above answer didn't work. What did work for me was adding the line sudo modprobe bcm2835-v4l2 within /etc/init.d/motion just before the daemon is started.

Pi is running 4.1.10-v7+ #821. What I have found odd though is that in trying to do the same thing with an original B+ it refuses to work just kills daemon when motion is detected. NB this B+ updates only to 4.1.7+ #817 and error message is:-

motion: [1] Closing video device /dev/video0

kernel: [ 57.116367] CPU: 0 PID: 2842 Comm: motion Not tainted 4.1.7+ #817

Other than the kernel the setup is the same as the 2B.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.