You are viewing outdated content for BUG. If you have a BUG Y.T. edition or 2.0 series device, please visit our updated wiki: http://wiki.buglabs.net
Video
From BUG Wiki
Contents |
Introduction
Many people want to use the bug device for making videos, unfortunately for now there is no shiping bug-cam. But still...an external webcam can be used such as a gspca or an uvc webcam. Both driver exist the kernel source that the bug device uses(but may not be compiled by default).
In the future Angstrom-based image will start to appear and to be usable.
Angstrom
This part depends on having angstrom: Get an angstrom image with:
- a bug device kernel with your webcam driver
- some installable gstreamer or mplayer packages
Once you have it running do:
opkg update opkg install gst-plugin-video4linux2 opkg install gst-plugin-avi
Gstreamer
Then here's the command for making a video with a gspca based webcam:
gst-launch v4l2src device=/dev/v4l/video1 ! videorate ! image/jpeg ,framerate=25/1 ! avimux ! filesink location=video1.avi
And here's the same command for an uvc based webcam:
gst-launch v4l2src device=/dev/v4l/video1 ! videorate ! avimux ! filesink location=video1.avi
we should note that:
- /dev/v4l/video0 is a device node for the bug-cam so your webcam will be /dev/v4l/video1
- it will erase any video named video1.avi
- The cpu usage is pretty low(less than 50% with htop,enlightenment running)
streaming With gspca
On Bug device trough usb
gst-launch v4l2src device=/dev/v4l/video1 ! videorate ! image/jpeg ,framerate=25/1 ! udpsink host=10.10.10.1 port=5000
Or trough wifi:
gst-launch v4l2src device=/dev/v4l/video1 ! videorate ! image/jpeg ,framerate=25/1,width=320,height=240 ! udpsink host=ip_of_client_computer port=5000
On receiving computer:
gst-launch-0.10 udpsrc port=5000 ! jpegdec ! xvimagesink
Mplayer
Here's the command for viewing the output of the webcam on mplayer
export DISPLAY=:0.0 mplayer -fs mplayer tv:// -tv device=/dev/v4l/video1:driver=v4l2:width=320:height=240 -fps 25 -fs
Settings
If gstreamer is used,camera settings must be set separately,using another application.
http://www.vanheusden.com/dov4l2/ seem simple to cross-compile ( an oe_runmake under the devshell compiled it )
Note that mplayer seem to set its own settings for the camera,so if you want to use an external program to set settings,do it after that mplayer started
Here's an example of use:
./dov4l2 -d /dev/v4l/video1 -w Brightness -a write -z 255
