个人工具

UbuntuHelp:HowToCaptureDigitalVideo/zh

来自Ubuntu中文

跳转至: 导航, 搜索
  1. title Capturing Digital Video

This page is not current and describes methods which do not apply to current releases of Ubuntu and Kino. Please look at the UbuntuHelp:Firewire page for current information. -- DuncanLithgow

How to Capture Digital Video on the Ubuntu GNU/Linux Platform Using Only Open Source Applications

This guide shows how to configure an i386 system running Ubuntu (Debian based GNU/Linux) to capture from a dv device through an ieee1394 (firewire) interface. This is a step-by-step tutorial that assumes that the reader has very little experience with Linux so many parts of the explanations can be skipped over by more experienced users. The purpose of this tutorial is not only to explain how to set up video capture but also to give practical experience for anyone wishing to learn how Ubuntu functions. We will use the Synaptic Package Manager for installing software packages as well as the old-school method of downloading and compiling source code. This should serve as a substantial foundation for anyone new to the Ubuntu Linux platform. If at any point in this tutorial you feel frustrated by the intricacies of the technological pedantry herein, I'd like to invite you to have a read of my personal blog (link dead) to help relieve your stress. (Don't worry ... its not that difficult ... just lots of new stuff to learn.) - your happy slave, ekendra das (link dead)

Kino: Digital Video for Linux

The example used in this tutorial is based on these specifications:

  • box:
  • hp pavillion ze5300 notebook w/ built in ieee1394 (firewire) port
  • os:
  • Ubuntu GNU/Linux 4.10 (The Warty Warthog): October 2004. (Warty is no longer supported by Ubuntu)
  • dv device:
  • Panasonic NV-GX7 DV Camera (PAL)

Configure the Synaptic Package Manager

The first thing we need to do is to configure the Synaptic Package Manager to look into repositories that are not in Ubuntu's main distribution. To do this take a look at AddingRepositoriesHowto

related information:


Download and Install Packages Via the Synaptic Package Manager

Next we need to search the repository for the software needed for capturing from a DV device. The main software we will use is called Kino. It relies upon several other pieces of software to run properly though. We will address that later. For now just click on search in the Synaptic Package Manager and look for a package called kino (without the quotes). Underneath the text box in the search panel is a drop down menu. Set this to 'name' and then click 'search'. If you reloaded the list of available packages in step one you should have a list of packages show up in your menu with the characters kino within the name. https://www.ubuntulinux.org/wiki/spmKino (link dead) Now select the kino package by clicking on the tick box to the left of the name. Select 'Mark for Installation' on the menu that pops up. screencapture.png (link dead) A dialogue box will most likely show up asking you to mark additional required changes. Just click on mark.

  • Now you should select the other two packages in the menu, namely kino-dvtitler and kino-timfx. Now do another search for dvgrab and select it in the same way. also imlib1-dev and libxml2 and libxml2-dev and libdv4 make sure build-essential, x-dev and esound are installed or marked for installation.
  • If in any of the above steps a dialogue box opens up asking to download dependencies then just agree.
  • After all has been selected click on apply and after reviewing click 'apply' again.

The selected packages will now download and afterwards a terminal will pop up and install the recent packages into the proper places on your system. When the terminal reads Successfully applied all changes just close the window. You can also exit out of the Synaptic Package Manager at this time. That part was easy. The next method requires a bit more learning ....

related information:

Download Source Code Packages

Now that we've downloaded and installed our core components we need to download and compile some codecs and drivers that work specifically with our system. The advantage of compiling drivers from source code ourselves is that it is more likely to run on our setup than a generically distributed binary. Also modifications can be made by those with technical inclinations. For this we will again need to download some files but this time we will do it through the browser here. Please put them in a convenient location on your hdd. Here are the files:

related information:

Next we will need to do something that Windoze users will have to get their head around. For anyone familiar with the old DOS systems this should all seem vaguely familiar ....

Compiling and Installing a Package Via the Command Prompt

Now we need to open a root terminal. This is a textual interface where we can type commands to the system at the prompt. Just click on Applications --> System Tools --> Root Terminal A dialogue that looks like this should popup. Just enter your root password again when prompted and then our terminal will open up. Note that there is a difference between a root terminal such as this and a normal terminal. The root terminal allows us to execute commands that will effect the configuration of our system and install packages. The normal prompt won't allow this unless we log in as a root user using a sudo prefix before all of our commands. That's another subject altogether. This first line with the blinking cursor is a command prompt. Here is where we will type our instructions. First we need to navigate to the directory where we downloaded the above drivers and codecs. The commands to use for this are:

  • dir – lists contents of directory including folders.
  • cd / – returns us to the root directory
  • cd directoryname – from the root directory we can move into directoryname (If we are in the root directory we need to put the forward slash otherwise we just use cd directoryname and that will move us into the folder; where directoryname is the name of the folder we want to navigate into.)
  • cd .. - takes us to the directory directly above the present one

Sometimes it can be a bit daunting to navigate into a folder due to spelling etc ... it helps to use the dir command first because the spelling is then in view. If there are any spaces in the names of your folders (a Windoze habit) you will need to either rename them or use a backwards slash before any spaces in the name – ex. a folder named "stuff for kino" would be opened by entering cd stuff\ for\ kino Another tip is to use the up and down arrows to scroll through previous commands. This can make entering commands easier and prevent typos. Once we are in the folder where we downloaded the above packages we should type dir so that we won't mess up the spelling in the next steps. The first package we will extract contains the ieee1394 drivers. The command for uncompressing .tar.gz archives is this:

tar xzvf libraw1394-1.2.1.tar.gz

Now a lot of stuff should come flying down the page and after a while another command prompt should appear. Type dir again. Now you can see there is now a directory where all of the contents were extracted. In this example the directory is called libraw1394-1.2.1 Next we should navigate into our new directory (cd libraw1394-1.2.1) and have a look around (dir). We now are at the mission critical stage of configuring, compiling and installation. To configure our package we need to type ./configure at the prompt. Some packages might have a slightly different spelling so be careful to have a look in the directory for config or configure or something similar. Lots of stuff should appear here and at the end we should be given another prompt. If all of the steps above have been followed we shouldn't get an error message. Now to compile the source code we type make (Lots more gibberishy looking stuff should appear for a while and then we are returned to the command prompt.) Now type make dev to create a device file. Next we need to install our newly compiled binary. To do this just type make install and all of the files will go into the appropriate directories. Finally we need to clean up things by typing make clean at the prompt. In most cases that's really all there is to it and we woulden't have to use the make dev command. You can concatenate the make targets, so we will use make install clean later. Now to unpack our DV Playback Controllers ...

  • navigate up one directory (cd ..)
  • tar xzvf libavc1394-0.5.3.tar.gz
  • cd libavc1394-0.5.3
  • ./configure
  • make install clean

another driver:

  • navigate up one directory (cd ..)
  • tar xvf libsamplerate-0.1.2.tar.gz
  • cd libsamplerate-0.1.2
  • ./configure
  • make install clean

getting the hang of this? now to install our audio codecs ...

  • navigate up one directory (cd ..)
  • tar xvf audiofile_0.2.6.orig.tar.gz
  • cd audiofile-0.2.6 (watch spelling here, or just press the TAB key after typing the first few letters)
  • make install clean

That's all we need to install for now. Not too bad was it?

related information:

A Hack (Get used to it.)

Because ubuntu haven't integrated raw1394 driver support into their package yet we need to take extra measures so that our devices are recognized by the system. This has to be done each time the system boots up so we will need to edit a boot configuration file to create a device node called /dev/raw1394 that will be read upon startup.

  • at the prompt type gedit /etc/init.d/bootmisc.sh
  • scroll down to the bottom of the document by pressing the down arrow
  • copy the edit below to your clipboard (ctrl+c)
# Begin Edit. 20041031 RCB - Added to hopefully get the raw1394 devicenode.
mknod /dev/raw1394 c 171 0
chown root:video /dev/raw1394
chmod 666 /dev/raw1394
#End Edit
  • paste it at nearly the bottom of the file just above where it reads exit 0 (use ctrl + V)
  • now save the file (Ctrl + S) and exit.

Next we need to create a launcher for kino on the desktop. This is similar to a shortcut in Windoze. Its simple.

  • Just go to the desktop (click on the desktop graphic on the bottom left of your screen in GNOME).
  • right click on desktop --> Create Launcher
  • in the 'Name' field type whatever name you'd like to use (kino is a good idea)
  • in the 'command' field type kino
  • make sure 'type' is set to 'application'
  • choose an icon if you like

Done! We now just need to reboot the system. When we're back up and running just browse back to this page and continue on if you want a few more tips for capturing dv from a camera.

related information:


Upon return you can connect your dv camera and then start the Kino application (don't forget to turn the camera on :) ). On the right side there is a tab that says capture. Click there and then click on AV/C to enable camera controls. Now you can just navigate around the tape in your camera by clicking the controls there. Click on capture (with the red light) when you get the tape where you want it. Help file: file:///usr/share/kino/help/index.html The help file has very good information for how to configure Kino for optimum performance. related information:

  • [1] Kino support Forum

Hope this helps. I could write more but then there wouldn't be anything for anyone to wiki about. It'd be nice to have a related page for video information but until I have the time I can't put anything up. Drop me a line from my blog [2] sometime if you'd like to discuss anything regarding streaming media, internet application design or if you just want to talk about the meaning of life. And remember ... if anything gets you down ... shout go– run– gaa- !! really loud and amazingly you'll feel good. :) go-run-gaa-!! your happy slave, ekendra das


From IngoLantschner Sun Jan 16 10:27:40 +0000 2005 From: Ingo Lantschner Date: Sun, 16 Jan 2005 10:27:40 +0000 Subject: Error 2 during make Message-ID: <20050116102740+0000@https://www.ubuntulinux.org> If you get an error during make, this is propably due to a space in the path. F.e. if you downloaded and unpack the tarballs in "/home/ingo/My Downloads/Video" you have a blank in "My Downloads" (btw. a silly default of Firefox). Solution: Rename the Folder "My Downloads" to "MyDownloads" mv My\ Dowloads MyDownloads and type make again. And Many thanks to ekendra for this excelent Howto!!!!!