Hi.
Has anyone been able to get live video from a camera working on the Pi with the latest Raspbian build?
I'm getting Illegal Instruction errors when using ffserver and trying to compile ffmpeg on the Pi itself gives me a lot of errors during the Make.
--
Mike
Webcam / ffmpeg on Raspbian
My Raspberry Pi blog with all my latest projects and links to articles
http://raspberrypipod.blogspot.com. +++ Current project: PiPodTricorder - lots of sensors, lots of mini-displays, breadboarding, bit of programming.
http://raspberrypipod.blogspot.com. +++ Current project: PiPodTricorder - lots of sensors, lots of mini-displays, breadboarding, bit of programming.
- jasonclark
- Posts: 59
- Joined: Sun May 13, 2012 3:51 pm
- Location: Hertfordshire, UK
Re: Webcam / ffmpeg on Raspbian
I've been looking into this for the last few days. I've got a Logitech C270 Cam, running the current Raspbian, cam is connected via Powered USB Hub.
I can get UVCCAPTURE running, slowly (2 or 3fps).
I've been trying to get OpenCV working via Python, but just get a black screen. The exact same (very simple) script runs ok on my Ubuntu box.
Sadly, my Linux skils are pretty low, so I'm learning as I go. I've tried to follow the instructions to compile opencv on the 'PI, but its now failing the compile.
I think my next step will be to try Arch Linux as I hear some people have WebCams working with that.
Once I've got something working, I'll post.
I can get UVCCAPTURE running, slowly (2 or 3fps).
I've been trying to get OpenCV working via Python, but just get a black screen. The exact same (very simple) script runs ok on my Ubuntu box.
Sadly, my Linux skils are pretty low, so I'm learning as I go. I've tried to follow the instructions to compile opencv on the 'PI, but its now failing the compile.
I think my next step will be to try Arch Linux as I hear some people have WebCams working with that.
Once I've got something working, I'll post.
Re: Webcam / ffmpeg on Raspbian
You shouldn't be getting illegal instruction if you installed ffmpeg from the Raspbian repos.
What's in your /etc/apt/sources.list file ?
Also - check this. This is how I got ffmpeg working on Raspbian.
http://sirlagz.net/?p=493
What's in your /etc/apt/sources.list file ?
Also - check this. This is how I got ffmpeg working on Raspbian.
http://sirlagz.net/?p=493
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Re: Webcam / ffmpeg on Raspbian
Yeah, it was your guide I was following 
It's okay - I'm going to start from scratch with a fresh install anyway
What should I have for sources.list?

It's okay - I'm going to start from scratch with a fresh install anyway
What should I have for sources.list?
My Raspberry Pi blog with all my latest projects and links to articles
http://raspberrypipod.blogspot.com. +++ Current project: PiPodTricorder - lots of sensors, lots of mini-displays, breadboarding, bit of programming.
http://raspberrypipod.blogspot.com. +++ Current project: PiPodTricorder - lots of sensors, lots of mini-displays, breadboarding, bit of programming.
Re: Webcam / ffmpeg on Raspbian
Ah righto lol.
You should have only mirrordirector.rasbian.net (or something like that - my pi is dead atm lol)
paste up your sources.list
You should have only mirrordirector.rasbian.net (or something like that - my pi is dead atm lol)
paste up your sources.list
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Re: Webcam / ffmpeg on Raspbian
Ahhhh. It compiled this time
Followed your guide.
Still not got it streaming, but I think that's my camera

Still not got it streaming, but I think that's my camera

My Raspberry Pi blog with all my latest projects and links to articles
http://raspberrypipod.blogspot.com. +++ Current project: PiPodTricorder - lots of sensors, lots of mini-displays, breadboarding, bit of programming.
http://raspberrypipod.blogspot.com. +++ Current project: PiPodTricorder - lots of sensors, lots of mini-displays, breadboarding, bit of programming.
Re: Webcam / ffmpeg on Raspbian
Some cameras seem to be hit and miss still.
If you get it working, leave the solution in a comment on my blog if you could. Would help others who are trying the same thing
If you get it working, leave the solution in a comment on my blog if you could. Would help others who are trying the same thing

My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Re: Webcam / ffmpeg on Raspbian
UVC cameras should work in general. However, I've found these problems:
- ffmpeg is buggy and basically doesn't work at all for streaming. Solution: compile from source
- Resolution, frame rate and pixel format are not set properly by ffmpeg. Solution: use v4l2-ctl and set it before using ffmpeg.
- ffmpeg is buggy and basically doesn't work at all for streaming. Solution: compile from source
- Resolution, frame rate and pixel format are not set properly by ffmpeg. Solution: use v4l2-ctl and set it before using ffmpeg.
Re: Webcam / ffmpeg on Raspbian
I've followed your guide and compiled ffmpeg on the Pi.SirLagz wrote:This is how I got ffmpeg working on Raspbian.
http://sirlagz.net/?p=493
I'm using the latest respian build:
Code: Select all
Linux raspberrypi 3.2.27+ #60 PREEMPT Thu Aug 23 15:33:51 BST 2012 armv6l GNU/Linux
Code: Select all
ffserver version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
built on Aug 22 2012 19:36:43 with gcc 4.6.3
configuration: --enable-libv4l2
libavutil 51. 54.100 / 51. 54.100
libavcodec 54. 23.100 / 54. 23.100
libavformat 54. 6.100 / 54. 6.100
libavdevice 54. 0.100 / 54. 0.100
libavfilter 2. 77.100 / 2. 77.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
built on Aug 22 2012 19:36:43 with gcc 4.6.3
configuration: --enable-libv4l2
libavutil 51. 54.100 / 51. 54.100
libavcodec 54. 23.100 / 54. 23.100
libavformat 54. 6.100 / 54. 6.100
libavdevice 54. 0.100 / 54. 0.100
libavfilter 2. 77.100 / 2. 77.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
[video4linux2,v4l2 @ 0x2c73550] [3]Capabilities: 5000001
libv4l2: error allocating conversion buffer
[video4linux2,v4l2 @ 0x2c73550] mmap: Cannot allocate memory
/dev/video0: Cannot allocate memory
I've tried using different memory splits but none of them solve the issue.
Re: Webcam / ffmpeg on Raspbian
tried a lower resolution ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Re: Webcam / ffmpeg on Raspbian
Yeah, Exactly the same message, even at 176x144SirLagz wrote:tried a lower resolution ?
Re: Webcam / ffmpeg on Raspbian
Doh! Found the issue. I had compiled with a --enable-libv4l2 configuration option in an effort to get around other error messages and I forgot to do the final sudo make install after the 3 hour compilation. All working nowfbutler wrote:Yeah, Exactly the same message, even at 176x144SirLagz wrote:tried a lower resolution ?
Re: Webcam / ffmpeg on Raspbian
What resolution / framerate are you getting now?
Re: Webcam / ffmpeg on Raspbian
At 320x240 I see between 6-7fps but with loads of duplicate frames, and the picture is very choppy viewing with VLC. I've stopped testing for now until I can try with an MPEG2 license to see what difference that makes.tekmanro wrote:What resolution / framerate are you getting now?
Re: Webcam / ffmpeg on Raspbian
From some more testing it looks like these instructions don't include alsa for sound in the ffmpeg build. I believe that you need to do aSirLagz wrote:You shouldn't be getting illegal instruction if you installed ffmpeg from the Raspbian repos.
What's in your /etc/apt/sources.list file ?
Also - check this. This is how I got ffmpeg working on Raspbian.
http://sirlagz.net/?p=493
sudo apt-get install libasound2-dev
before doing a ./configure as the configure automatically checks for alsa header files and doesn't compile ffmpeg with alsa unless these are present. I'm recompiling now to check this.
Re: Webcam / ffmpeg on Raspbian
indeed it doesn't as I did not have a need of sound at the time. if what you do works, I'll update my blog 

My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Re: Webcam / ffmpeg on Raspbian
I guessed as much. I can confirm that it now recognises alsa.SirLagz wrote:indeed it doesn't as I did not have a need of sound at the time. if what you do works, I'll update my blog

Code: Select all
[alsa @ 0x155a390] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:1,0':
Duration: N/A, start: 1345981083.761076, bitrate: 768 kb/s
Stream #1:0: Audio: pcm_s16le, 24000 Hz, stereo, s16, 768 kb/s

Re: Webcam / ffmpeg on Raspbian
Thanks for the effort !
I'll update my blog
I'll update my blog

My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
-
- Posts: 2
- Joined: Wed Apr 29, 2015 2:21 pm
Re: Webcam / ffmpeg on Raspbian
Hi Sir Lagz
I am compiling FFMPEG from your guide on my raspberry pi and it seems like it is compiling for a very long time, almost over 30 mins just constantly saying CC libavcpdec/<whatever library>
Should it take this long ? I plan on streaming from my raspberry pi using HTML5 and Nodjs websockets. Looked around and it seems to be quite a good FPS and quality.
What do you think of this ?
Cheers
I am compiling FFMPEG from your guide on my raspberry pi and it seems like it is compiling for a very long time, almost over 30 mins just constantly saying CC libavcpdec/<whatever library>
Should it take this long ? I plan on streaming from my raspberry pi using HTML5 and Nodjs websockets. Looked around and it seems to be quite a good FPS and quality.
What do you think of this ?
Cheers