个人工具
登录
查看“UbuntuHelp:Webcam”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:Webcam”的源代码
来自Ubuntu中文
←
UbuntuHelp:Webcam
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/Webcam}} {{Languages|UbuntuHelp:Webcam}} Many webcams will "just work" in Ubuntu. There is a USB standard that defines USB streaming video called UVC. This stands for Universal Video Class, and it does for webcams what UMS does for USB memory sticks and hard drives. This allows one driver to work with many webcams. When looking to purchase a webcam for use with Ubuntu, you should look for a UVC compatible camera. The [http://linux-uvc.berlios.de/ Linux-UVC] project has a good list of UVC compatible webcams as well as [http://www.quickcamteam.net/devices The Quickcam Team] for Logitech cameras. === Testing your webcam === [[UbuntuHelp:Ekiga|Ekiga]] is installed by default in Ubuntu, and can be used to test your webcam. For UVC devices ''luvcview'' is a good program you can use to test that the camera is working. If it doesn't work, you may need to update the UVC driver (see Manual install instructions below). ''Cheese'' ''Camorama'', ''xawtv'', ''VLC'', ''aMSN'', and ''Kopete'' are in the Ubuntu repositories. They all can be used to test and use your webcam. In some cases you (VLC, mplayer, amongst others) will need to know the video and audio device files for your webcam. Before you plug in your webcam, try the following two command at a console: <pre><nowiki> ls /dev/video* ls /dev/audio* </nowiki></pre> Make a note of the devices appearing. Now plug in your webcam, allow the system a few seconds to register the device, and run the two commands again. The new appearances should belong to your webcam (for instance, /dev/video0 and /dev/audio2). === Driver installation === If needed, try [[UbuntuHelp:EasyCam|EasyCam]], a tool for installing webcam drivers. If you are unable to manage installing your Webcam using [[UbuntuHelp:EasyCam|EasyCam]], you may try installing your camera manually. At the end of this page are some links to help you with this. If you are using Intrepid and have a Logitech QuickCam or something else using the gspca driver, see [https://answers.launchpad.net/ubuntu/+question/49739 this answer] for video4linux 1 compatibility. Note: requires building and installing software from scratch :-( === Additional software === This software is not supported by Ubuntu, and is not available in the repositories. [http://www.infinicode.org/code/cameramonitor/ Camera Monitor] shows a tray icon letting you know when your webcam is on. === Recording video === ==== ffmpeg ==== To record both video and audio using [http://www.ffmpeg.org ffmpeg], first make sure ffmpeg is installed: <pre><nowiki> sudo apt-get install ffmpeg </nowiki></pre> then run ffmpeg with arguments such as these: <pre><nowiki> ffmpeg -f oss -i /dev/dsp -f video4linux2 -s 320x240 -i /dev/video0 out.mpg </nowiki></pre> ==== MPlayer / MEncoder ==== [[UbuntuHelp:MPlayer|MPlayer]] is capable of displaying a webcam video stream, for example with the command line <pre><nowiki> mplayer tv:// -tv driver=v4l:width=640:height=480:device=/dev/video0 </nowiki></pre> The resolution (width=??? & height=??? ) should be chosen to match the output of your device, and the device file (/dev/video0) to match your webcam's device file, see above. The companion to [[UbuntuHelp:MPlayer|MPlayer]], [[UbuntuHelp:MEncoder|MEncoder]] can record from a webcam to video files such as AVI, for example without audio: <pre><nowiki> mencoder tv:// -tv driver=v4l:width=320:height=240:device=/dev/video0 -ovc lavc -o webcam.avi </nowiki></pre> and with audio <pre><nowiki> mencoder tv:// -tv driver=v4l:width=320:height=240:device=/dev/video0:forceaudio:adevice=/dev/dsp1 -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o webcam.avi </nowiki></pre> Type 'man mencoder' for more info on the audio options. In the example, /dev/dsp1 refers to the webcam USB Audio device, while /dev/dsp would refer to the sound card. You may need to install these programs with <pre><nowiki> sudo apt-get install mplayer mencoder </nowiki></pre> ==== VLC ==== In VLC, choose 'Open capture device' from the file menu and enter the video and audio device files (see above) in video device name and audio device name, respectively. If you just want a 'mirror' (to see what the webcam is showing), click 'OK' and you're done. If you wish to record, tick off 'Stream/save' in the 'Advanced options' section. Click the settings button right next to it. Tick 'File' off under 'Outputs' and enter a filename. Encapsulation method can be left at the default (MPEG TS). Under 'Transcoding options', tick 'Audio codec' and 'Video codec'. These can also safely be left the defaults (obviously greater compression results in lower file sizes, so experiment). Click 'OK' in the Settings screen and once again in the main webcam screen (Video4linux). If you want to have more control, you can access several settings, including resolution, by clicking the Advanced options button. If you wish to be able to quickly start a video session with your webcam, the resulting vlc command is printed in the Customize line at the bottom. You simply need to prepend 'vlc', e.g. <pre><nowiki> vlc v4l:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/audio2" :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma="" :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=640 :v4l-height=480 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 </nowiki></pre> The recording instructions will similarly need to be appended. Copy the contents of the 'Stream Output MRL' box under 'Settings' and change ":sout=" to "--sout " and append it to your vlc command:, e.g. <pre><nowiki> vlc v4l:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/audio2" :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma="" :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=640 :v4l-height=480 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 --sout "#transcode{vcodec=mp1v,vb=1024,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=std{access=file,mux=mpeg1,dst=/tmp/test.mpg}}" </nowiki></pre> To simple take a few snapshots, open the webcam without recording and choose 'Snapshot' under the 'Video' menu. === Manual installation instructions === ==== Installing spca5xx manually ==== You can find howto's for manual installation of the spca5xx driver [[UbuntuHelp:Spca5xx|here]]. ==== Installing ov51x manually ==== You can find howto's for manual installation of the ov51x driver [[UbuntuHelp:Ov51x|here]]. ==== Installing ov51x-jpeg manually ==== This is a hacked driver by http://www.rastageeks.org/ and more info is available at http://www.rastageeks.org/ov51x-jpeg/index.php/Main_Page Suported hardware http://www.rastageeks.org/ov51x-jpeg/index.php/Working_Webcams (July 16 2008) Currently the source package for ov51x-jpeg doesn't compile, but you can use [http://overtag.dk/wordpress/2008/07/creative-live-cam-on-ubuntu-804-using-ov51x-jpeg/ this howto] to get it running. ==== Installing UVC manually ==== The UVC module is included in 7.10 and later, and possibly earlier but the included version has problems with some webcams. If you need to install/update it you can find a howto [[UbuntuHelp:UVC|here]] === Intrepid/Updated Hardy current issues with webcams === With Intrepid and Hardy fully updated, several issues were presented with previously working webcams. The root causes for this issues were several webcam modules merged into the kernel from 2.6.26 and 2.6.27, libv4l modifications, gstreamer modifications and changes in Ubuntu's kernel. Almost all the issues present at this time (14/12/08) are detected with corresponding bug reports, some of them are solved, and some others are in the process of getting them solved. We are working hard to uncover and solve the remaining issues, so please bear with us in the meantime. I'm listing here the issues organized by kernel module. So you've got to check which module your camera uses in order to check for the workaround or corresponding report. ==== List of Kernel modules with problems ==== {|border="1" cellspacing="0" |'''Driver''' || '''Launchpad Bugs''' || '''Brief problem description''' |- | gspca || https://bugs.edge.launchpad.net/bugs/260918 || The mother of all webcam related bugs :). Well almost all of the, this one solves a lot of libv4l issues with gspca webcam and some other webcams as well |- | uvcvideo || https://bugs.edge.launchpad.net/bugs/290506 || Uvcvideo webcam issue detected mainly with cheese. It's solved right now just waiting the next kernel |- | pwc || https://bugs.edge.launchpad.net/bugs/282473 || Due to the mentioned changes this one became a dupe from bug #260918 |- | gspca_zc3xx || https://bugs.edge.launchpad.net/bugs/292086 || This is caused by the inclusion of gspca modules on the kernel |- | gspca_zc3xx || https://bugs.edge.launchpad.net/bugs/144745 || Probably the same bug as the previous one |- | sn9c10x || https://bugs.edge.launchpad.net/bugs/280657 || snc9105 and sc9102 issues |- | sn9c20x || https://bugs.edge.launchpad.net/bugs/87054 || microdia solution for the sn9c20x webcams |- | r5u87x || https://bugs.edge.launchpad.net/bugs/219252 || This would be the package of userland tools needed to load firmware for Ricoh Cameras and would use the uvcvideo driver for the actual work |- | r5u870 || https://bugs.edge.launchpad.net/bugs/120434 || This is the way to go if you've got a WDM camera not supported by uvcvideo or if you want to use the old driver. In the near (really near) future this would be deprecated |- | ov51x_jpeg || https://bugs.edge.launchpad.net/bugs/263008 || Trying to introduce this module into the kernel |- | ov51x_jpeg || https://bugs.edge.launchpad.net/bugs/262853 || As the current source package no longer builds, the latest version is the one for this webcam to work |- | stk, stkwebcam || https://bugs.edge.launchpad.net/bugs/269123 || The st11k module present in Hardy is no longer available in Intrepid/Jaunty. The stkwebcam doesn't supports all the previous webcams. |- | quickcam || https://bugs.edge.launchpad.net/bugs/293176 || Description |} === See also === * [[UbuntuHelp:InstallingLogitechQuickcamPro5000OnEdgy|InstallingLogitechQuickcamPro5000OnEdgy]] * [[UbuntuHelp:InstallingEyetoyAsAWebcam|Installing|the Eyetoy as a Webcam with Kopete]] * [http://jbuberel.typepad.com/blog/2008/03/using-a-usb-web.html Using a USB Webcam to capture videos for upload to YouTube] ---- [[category:CategoryCleanup]] [[category:CategoryHardware]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:Webcam
。