Firewire
出自Ubuntu中文
| Previous: Video | Up: UserDocumentation |
文章来源:官方WIKI
翻译人员: Murodoch
校对人员:
贡献人员:
文章状态: 等待翻译
目录 |
1 Capturing video over Firewire 如何通过火线抓取视频资料
1.1Disclaimer 免责说明
This is being written as I try to understand the issues myself, there are probably some mistakes so I suggest you do your own research. If you know something is wrong or missing please help improve this page for the next person by correcting it. DuncanLithgow
因为本人(原文作者)是在尝试理解问题的基础上写出本文的,因此本文可能包含一些错误。在此建议各位将本文用作理解问题的一种参考,并最后能够有自己的理解。如果你发现本文存在错误或者是遗失的地方,请帮助修改完善本文。谢谢!DuncanLithgow
1.2Hardware 硬件方面
Almost all modern digital camcorders have included an IEEE1394 port (commonly called Firewire) since 1995. Many computers intended for home or professional audio/video use have built-in FireWire ports including all Macintosh and Sony computers currently produced. You can read more general notes about firewire in the Wikipedia entry: http://en.wikipedia.org/wiki/IEEE_1394
You should note that if you plan on buying an expansion card (PCI) to support IEEE1394 you must be sure that your system bios supports it.
从1995年开始,几乎所有的数字摄像机都配备了IEEE1394端口(通常被称为火线)。包括苹果和索尼在内的许多为家庭以及专业用途设计的电脑在音频/视频方面都配备了火线端口。您可以通过阅读下面的链接来获得更多关于火线的知识http://en.wikipedia.org/wiki/IEEE_1394
1.3 Software 软件方面
You'll need some software to capture from the firewire port. This page looks at using Kino versions 0.8 and 0.9. Kino (0.8) is available in the Ubuntu repositories and is a well regarded home video editing suite. The device file (also called a node) which acts as an interface between Kino, Firewire and your camera can be one of:
- dv1394-0 (gives access to Firewire for video capture but not to the camera's controls)
- raw1394 (gives raw access to Firewire and allows access to your cameras controls, but poses a security risk)
要想通过火线端口来采集音频/视频的话,您就得安装必须的软件。本文当中用来举例的kino0.8版以及kino0.9版都能够在Ubuntu以及家庭视频编缉软件中正常使用。而在Kino、火线端口以及摄像机之间起端口作用的设备文件可以使下面两个当中的任何一个:
- dv1394-0(允许视频采集系统访问火线端口但是不能控制摄像机)
- raw1394(允许直接访问火线端口同时也允许控制摄像机,但这样可能会带来安全上的问题)
When you connect your camera and turn it on udev should create one or more of the device files needed, I will assume you want to use dv1394-0. If Ubuntu doesn't create /raw/dv1394-0 you will need to give it a kick with
sudo modprobe dv1394
假定您使用的是dv1394-0,那么在连接好了摄像机并且在udev上面打开它那么系统应该会创建一个或者是多个需要的设备文件。如果Ubuntu没有创建/raw/dv1394-0,您也可以通过使用下面的命令来手动创建
| <tablewidth="947px" tablestyle="width: 947px; height: 26px;">sudo modprobe dv1394 |
Start Kino and open the 'Capture' tab. Kino will attempt to connect to your firewire port and detect any device there. Kino tries raw1394 by default, which will fail. You will see the error:
| WARNING: raw1394 kernel module not loaded or failure to read/write /dev/raw1394! |
... and that's the way it's meant to be. In an email from Scott James Remnant the reason is given as this:
一旦Kino启动并且打开'Capture'对话框。Kino将会试图与您的火线端口建立连接并尝试删除任何已经连接上去的设备。因为Kino在默认情况下使用raw1394,因此连接将会失败,同时您将看到一条错误信息。错误信息的内容如下:
| WARNING: raw1394 kernel module not loaded or failure to read/write /dev/raw1394! |
"The problem is that the raw IEEE1394 device is literally just that; raw access to the IEEE1394 stack! This means that anyone with write access to that device can access any device connected to the Firewire port, and because of the nature of Firewire, they may execute arbitrary code on the host system as root!"
As there is not one single solution to this I have made the list below. I hope you find a method that helps.
只需要能够对某一台设备进行写访问操作便能访问所有已经连接到火线端口的设备,因此raw IEEE1394很可能会造成非法用户获取root帐户权限进而对主机进行任何任何操作的安全隐患。
1.3.1 dv1394-0
(Tested in Ubuntu 6.06 with Kino 0.9)
Once there's a device file for IEEE1384 as outlines above, in Kino go to 'Edit > Preferences' and select the 'IEEE 1394' tab. Any detected cameras will be listed in 'AV/C Device'. In 'dv1394 Device' change the value to '/dev/dv1394-0'. (In Ubuntu 5.10 choose "dv1394" on the pulldown menu and set the path in the text box to "/dev/dv1394/0"). Now go back to the 'Capture' tab and press Play on your camera just before clicking the 'Capture' button. The cameras controls are not accessable via dv1394 but if the DV tape is rewound before starting, that won't be a problem.
1.3.2 raw1396
(Kino 0.9 installed from source will not access raw1394)
One way around the read/write permissions of raw1394 is to give the user read and write permission on the raw1394 device file - this is a security risk. (See [FilePermissions File Permissions] for help) Anyone with physical access to the firewire port (and enough cunning) can use it to control the computer. The currently prefered way to minimise this risk is to add raw1394 to a new group - 'firewire' and make the user a member with read/write permission. To do this select 'System > Adinistration > Users and Groups'. In the 'groups' tab select 'add group' and call the new group 'firewire'. Add your users group to the new 'firewire' group. Now open nautilus as root and navigate to the /dev/raw1394 device file with:
sudo nautilus
In the context menu under 'permissions' change the file permissions to allow read and write access to members of the 'firewire' group (which includes your user). Now you should be able to capture.
1.3.3 method 3
Apparently the dv1394 device, and video1394, are set up to allow users in the video group to read and write to them. So try and add yourself to the video group.
1.3.4 Method 4
If the methods above haven't helped, try also running kino as root, that might get around a few things.
sudo kino
1.4 Ubuntu 5.04 (Hoary) Specific notes
Ubuntu 5.04 does not create a device file for IEEE1394 when you plug in your camera, read: http://ubuntuforums.org/showthread.php?t=2792
(The following steps are adapted from bxlug.be) The module you need for capturing from Firewire are built into the Linux kernel, but 5.04 doesn't create the device files automatically when you plug your camera in. To make you 5.04 always create the device files you need to edit /etc/modules as root. To do this open a terminal and type:
sudo gedit /etc/module
Then add one or both of these lines at the end:
raw1394 video1394
To save you having to restart you can force start them now with:
modprobe raw1394 modprobe video1394
Try the camera now. If it still doesn't work there are a few more steps to try over at http://www.bxlug.be/en/articles/220 Their approach didn't work for me.
2 See Also
- BootFromFirewireHardDisk
- EthernetOverFirewire
| Previous: Video | Up: UserDocumentation |
- 文章来源:官方WIKI
翻译人员:
校对人员:
文章状态:等待翻译
