Difference between revisions of "Lisa Logitech Camera"
Line 113: | Line 113: | ||
TODO: opencv, libwebcam, mjpeg-client | TODO: opencv, libwebcam, mjpeg-client | ||
====ffserver/ffmpeg==== | |||
Create /etc/ffserver.conf with | |||
<pre> | |||
Port 8090 | |||
# bind to all IPs aliased or not | |||
BindAddress 0.0.0.0 | |||
# max number of simultaneous clients | |||
MaxClients 1000 | |||
# max bandwidth per-client (kb/s) | |||
MaxBandwidth 10000 | |||
# Suppress that if you want to launch ffserver as a daemon. | |||
NoDaemon | |||
<Feed feed1.ffm> | |||
File /tmp/feed1.ffm | |||
FileMaxSize 5M | |||
</Feed> | |||
# FLV output - good for streaming | |||
<Stream test.flv> | |||
# the source feed | |||
Feed feed1.ffm | |||
# the output stream format - FLV = FLash Video | |||
Format flv | |||
VideoCodec flv | |||
# this must match the ffmpeg -r argument | |||
VideoFrameRate 5 | |||
# generally leave this is a large number | |||
VideoBufferSize 80000 | |||
# another quality tweak | |||
VideoBitRate 200 | |||
# quality ranges - 1-31 (1 = best, 31 = worst) | |||
VideoQMin 1 | |||
VideoQMax 5 | |||
VideoSize 320x240 | |||
# this sets how many seconds in past to start | |||
PreRoll 0 | |||
# wecams don't have audio | |||
Noaudio | |||
</Stream> | |||
# ASF output - for windows media player | |||
<Stream test.asf> | |||
# the source feed | |||
Feed feed1.ffm | |||
# the output stream format - ASF | |||
Format asf | |||
VideoCodec msmpeg4 | |||
# this must match the ffmpeg -r argument | |||
VideoFrameRate 5 | |||
# generally leave this is a large number | |||
VideoBufferSize 80000 | |||
# another quality tweak | |||
VideoBitRate 200 | |||
# quality ranges - 1-31 (1 = best, 31 = worst) | |||
VideoQMin 1 | |||
VideoQMax 5 | |||
VideoSize 320x240 | |||
# this sets how many seconds in past to start | |||
PreRoll 0 | |||
# wecams don't have audio | |||
Noaudio | |||
</Stream> | |||
</pre> | |||
At one console start ffserver then at another launch ffmpeg with the following : | |||
: ffmpeg -r 15 -s 320x240 -f video4linux2 -i /dev/video0 http://localhost:8090/feed1.ffm | |||
In IE or VLC on a remote computer open URL : mms://<IP_ADDRESS>:8090/feed1.asf or mms://<IP_ADDRESS>:8090/feed1.flv | |||
Other recommendations : | |||
<pre> | |||
Streaming | |||
^^^^^^^^^^ | |||
1. Mplayer | |||
Through serial console: | |||
mplayer tv:// -tv driver=v4l2:device=/dev/video0:width=480:height=272 -vo fbdev -v -brightness 0 -contrast 0 -saturation 0 | |||
Using xterm: | |||
mplayer tv:// -tv driver=v4l2:device=/dev/video0:width=320:height=240 | |||
2. Gstreamer | |||
gst-launch -v v4l2src ! 'video/x-raw-yuv,format=(fourcc)UYVY,width=320,height=240,framerate=(fraction)15/1' ! fakesink | |||
3. Mjpeg-streamer | |||
mjpg_streamer -i "input_uvc.so -f 30 -r 640x480 -y -d /dev/video0" -o "output_http.so -p 8090 -w www" | |||
Recording | |||
^^^^^^^^^^ | |||
1. Menucoder | |||
mencoder tv:// -tv driver=v4l2:width=480:height=272:device=/dev/video0 -nosound -fps 10 -ovc lavc -o filename.avi | |||
2. FFMPEG | |||
ffmpeg -f video4linux2 -s 320x240 -r 30000/1001 -i /dev/video0 -f avi -vcodec mjpeg -s 320x240 -r 30000/1001 -y filename.avi | |||
</pre> |
Revision as of 05:12, 27 August 2010
Notes for getting Logitech QuickCam Pro for Notebooks camera streaming over wifi
Gstreamer and uvc_stream
Download source
I grabbed svn on --Paulcox 13:41, 27 August 2010 (CEST)
svn co https://mjpg-streamer.svn.sourceforge.net/svnroot/mjpg-streamer mjpg-streamer
Build
Small changes required in Makefiles due to cross compilation for ARM architecture of overo (don't worry, painless)
Modify Makefiles
In mjpg-streamer/Makefile and uvc-streamer/Makefile I put:
DESTDIR = /home/paul # set the compiler to use #CC = gcc OVERO_OE=/home/paul/overo-oe CC = $(OVERO_OE)/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-gcc CROSS_COMPILE=$(OVERO_OE)/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi- ARCH=arm GLIB_INC = $(OVERO_OE)/tmp/work/armv7a-angstrom-linux-gnueabi/glib-2.0-2.22.4-r1/staging-pkg/staging/armv7a-angstrom-linux-gnueabi/usr/include/glib-2.0 GLIB_LIB = $(OVERO_OE)/tmp/work/armv7a-angstrom-linux-gnueabi/glib-2.0-2.22.4-r1/staging-pkg/staging/armv7a-angstrom-linux-gnueabi/usr/lib/
I also had to do this in all the Makefiles in the plugins folder
Remove header
apparently libv4l2.h which is included in a few files is no longer included. Thankfully it doesn't appear to be needed so commenting the references works ok :
paul@paul-laptop:/media/PackBell_Linux/overo-oe/mjpg-streamer/mjpg-streamer$ find . | xargs grep -n "libv4l2.h" ./plugins/output_http/httpd.c:40://#include <libv4l2.h> ./plugins/output_http/.svn/text-base/httpd.c.svn-base:40:#include <libv4l2.h> ./plugins/input_uvc/v4l2uvc.h:35://#include <libv4l2.h> ./plugins/input_uvc/.svn/text-base/v4l2uvc.h.svn-base:35:#include <libv4l2.h>
patch available here
Build uvc_streamer
paul@paul-laptop:/media/PackBell_Linux/overo-oe/mjpg-streamer/uvc-streamer$ make
Build mjpg-streamer
paul@paul-laptop:/media/PackBell_Linux/overo-oe/mjpg-streamer/mjpg-streamer$ make
copy to target
scp uvc_stream @auto3: scp *.so start.sh mjpg_streamer @auto3:mjpg-streamer scp -r www @auto3:mjpg-streamer
start streaming
Log in
- ssh auto3
Look around :
- root@overo:/home/paul# ls
- capture.elf ffserver.conf mjpg-streamer overo_twist.elf uvc_stream
Go for it:
root@overo:/home/paul# ./uvc_stream Using V4L2 device.....: /dev/video0 Resolution............: 640 x 480 frames per second.....: 5 TCP port..............: 8080 motor control TCP port: 8081 root@overo:/home/paul# cd mjpg-streamer/ root@overo:/home/paul/mjpg-streamer# ./start.sh MJPG Streamer Version.: 2.0 i: Using V4L2 device.: /dev/video0 i: Desired Resolution: 640 x 480 i: Frames Per Second.: 5 i: Format............: MJPEG o: www-folder-path...: ./www/ o: HTTP TCP port.....: 8080 o: username:password.: disabled o: commands..........: enabled
watch stream
In chrome or vlc open http://auto3:8080
uvc_stream
mjpg_streamer
Coming soon
ffmpeg, mplayer, mencoder, vlc, gstreamer. what was library needed libav? installing with opkg "opkg install <name>", proxy setup in /etc/opkg/opkg.conf setting up x-forwarding over ssh tunnel?
TODO: opencv, libwebcam, mjpeg-client
ffserver/ffmpeg
Create /etc/ffserver.conf with
Port 8090 # bind to all IPs aliased or not BindAddress 0.0.0.0 # max number of simultaneous clients MaxClients 1000 # max bandwidth per-client (kb/s) MaxBandwidth 10000 # Suppress that if you want to launch ffserver as a daemon. NoDaemon <Feed feed1.ffm> File /tmp/feed1.ffm FileMaxSize 5M </Feed> # FLV output - good for streaming <Stream test.flv> # the source feed Feed feed1.ffm # the output stream format - FLV = FLash Video Format flv VideoCodec flv # this must match the ffmpeg -r argument VideoFrameRate 5 # generally leave this is a large number VideoBufferSize 80000 # another quality tweak VideoBitRate 200 # quality ranges - 1-31 (1 = best, 31 = worst) VideoQMin 1 VideoQMax 5 VideoSize 320x240 # this sets how many seconds in past to start PreRoll 0 # wecams don't have audio Noaudio </Stream> # ASF output - for windows media player <Stream test.asf> # the source feed Feed feed1.ffm # the output stream format - ASF Format asf VideoCodec msmpeg4 # this must match the ffmpeg -r argument VideoFrameRate 5 # generally leave this is a large number VideoBufferSize 80000 # another quality tweak VideoBitRate 200 # quality ranges - 1-31 (1 = best, 31 = worst) VideoQMin 1 VideoQMax 5 VideoSize 320x240 # this sets how many seconds in past to start PreRoll 0 # wecams don't have audio Noaudio </Stream>
At one console start ffserver then at another launch ffmpeg with the following :
- ffmpeg -r 15 -s 320x240 -f video4linux2 -i /dev/video0 http://localhost:8090/feed1.ffm
In IE or VLC on a remote computer open URL : mms://<IP_ADDRESS>:8090/feed1.asf or mms://<IP_ADDRESS>:8090/feed1.flv
Other recommendations :
Streaming ^^^^^^^^^^ 1. Mplayer Through serial console: mplayer tv:// -tv driver=v4l2:device=/dev/video0:width=480:height=272 -vo fbdev -v -brightness 0 -contrast 0 -saturation 0 Using xterm: mplayer tv:// -tv driver=v4l2:device=/dev/video0:width=320:height=240 2. Gstreamer gst-launch -v v4l2src ! 'video/x-raw-yuv,format=(fourcc)UYVY,width=320,height=240,framerate=(fraction)15/1' ! fakesink 3. Mjpeg-streamer mjpg_streamer -i "input_uvc.so -f 30 -r 640x480 -y -d /dev/video0" -o "output_http.so -p 8090 -w www" Recording ^^^^^^^^^^ 1. Menucoder mencoder tv:// -tv driver=v4l2:width=480:height=272:device=/dev/video0 -nosound -fps 10 -ovc lavc -o filename.avi 2. FFMPEG ffmpeg -f video4linux2 -s 320x240 -r 30000/1001 -i /dev/video0 -f avi -vcodec mjpeg -s 320x240 -r 30000/1001 -y filename.avi