dvgrab and dv players

Guides

Software

Command summary

  • use dvcont to control the camera: play, stop, rewind, record pause, pause, status
  • use grab to create avi files (can be done remotely and delayed)
  • use playdv --no-mmap /dev/ieee1394/dv/host0/NTSC/in to preview
  • use playdv filename.dv to play raw dv files
  • use kino * to read in all files in a directory for editing
  • at one point you had Dan Maas' dv1394io (no more):
    • dv1394in filename.dv to create raw dv files of any size
    • dv1394out /dev/ieee1394/dv/host0/NTSC/out to transfer raw dv to tape
  • cat /dev/video0 >dev_video0.mpg (untested, said to work)

Instructions

Controlling the camcorder

To capture footage from a digital camcoder, hook it up with a firewire cable and make sure you have control of the unit:

dvcont play, ff, stop, rewind, record, pause, status, timecode

Preview (this works fine)

playdv --no-mmap /dev/ieee1394/dv/host0/NTSC/in

Piped output (drop the -i when using the latest dvgrab?)

  dvgrab -i | xine -D stdin://#demux:rawdv   
Input from dvgrab can be piped to xine in this way; it didn't work well for me.

Capturing

To initiate the capture, press the play button and immediately issue

grab
This is a script at /usr/local/bin/grab. Alternatively, issue the whole string manually:
dvgrab --autosplit --format raw --frames 7500 --timestamp --dv1394 /dev/ieee1394/dv/host0/NTSC/in Tape01-

This line is correct for dvgrab 1.2.1, which appeared in February 2003.

Leave the machine alone while it's grabbing -- if it skips frames it will
abort in the middle.

Output format

 --format dv1 | dv2 | raw | test | qt | jpeg

Using raw files means that you can't play the uncompressed files in Windows without converting them first.  It's better to stick with the raw files for simplicity and for exporting back to the camcorder, and transcode handles
them.

While dvgrab can generate jpeg files on the fly, it's usually better to do this in kino, where you can chose a precise sequence to convert to stills.

To convert raw files to avi, use either kino (which will export to Windows-compatible AVI type 2 files), or the dv2dv command-line utility.
I'm not quite up-to-date on that one and have never tested it, but this is the way to go for bulk conversions.

Automatic file-name creation using timestamps

The --timestamp flag puts the date and time of the recording in the title. Make sure you don't use this flag if the tape lacks a timecode (verify by pressing the Data code button inside the flip-out screen while the tap is playing).

For Hi8 tapes

dvgrab --autosplit --frames 7500 --format raw --dv1394
/dev/ieee1394/dv/host0/NTSC/in 2002-01-

These don't have timecodes, so the files are just numbered sequentially.

File size

You could do without the frames limitation of 7500, but there's no real benefit from working with such large files when you otherwise have a functional autosplit that splits the footage into scenes.

It's important to use exactly the same dvgrab line, so that if you capture, transcode, delete the originals, and then want to get the originals back from the tape, you will do so.

Of course in the case of Hi8 tapes, where there is no automatic scene detection, this rule doesn't hold, so in some cases you might want to write dv files in kino that are larger than 7500 frames.

In the previous 1.1 release, dvgrab --format raw didn't autosplit or timecode, so you had to use dv2, which creates avi files.

Capture jobs can be started remotely and delayed.

Remote capture

If the machine is busy compressing and you have more tapes to capture, leave the camcorder hooked up with the tape inside it and start the capturing remotely once the compression is completed. This works on miniDV and Digital8 camcorders.

dvcont rewind
dvcont status
dvcont play

To start the capturing, issue screen to start a virtual terminal. To see a list of screen key bindings, press

Ctrl-a ?
Here are some examples:
detach         ^c d
start screen ^c c
select           ^c  '      Prompt for a window name or number to switch to

Then copy and paste the following one line at a time into one command:

dvgrab --autosplit --format raw --frames 7500 --timestamp --dv1394 /dev/ieee1394/dv/host0/NTSC/in T-

Alternatively, just use the script /usr/local/bin/grab, which contains the same line. Then detach the screen, either by a key shortcut or by going into a second terminal and issuing

screen -list
and then detaching using something like this:
screen -d 17989.tty1.spello

You can now log out cleanly. Later, you can monitor progress by

  • watching the files created
  • by issuing "dvcont timecode"
  • or you can reattach the screen:
screen -r 17989.tty1.spello

After reattaching, complete the job by pressing Ctrl-C (SIGINT) to close the last file.

If you don't reattach, you can instead send a SIGINT to the process pid to complete the last file:

kill -2 <pid dvgrab>

This cleanly closes the last file and exit dvgrab, as can be verified in the log file.

Rewind the tape when you're done -- you can even eject it if you have a local person who can swap it out:

        dvcont rewind
        dvcont eject

In earlier versions of dvgrab, it used to be possible to pipe the output to a logfile, as follows:

dvgrab --autosplit --format raw --frames 7500 --timestamp --dv1394 /dev/ieee1394/dv/host0/NTSC/in T- >& logfile &
This method no longer works as described, though there may be a variant that will still work -- see the dvgrab man page. In the meantime, use screen, which in any case is more elegant.

Delayed execution

To instruct a capture job to start a few hours from now, you probably need to put the dvgrab string into a shell script, let's call it grab.sh, and then issue this command:

at <tt:mm> -f /usr/local/bin/dvgrab.sh

where <tt:mm> is the hour and minute to begin the job. Note that you have to give the full path of the file to be run.

In this way, you can start the job after you leave work, or after a compression job has completed. Just leave the tape to be captured in the camcorder.

Delayed remote capture is still untested. A side benefit is a grab script -- this is now standardized and a script would make it easier for others to use.

Update 1 January 2003

Arthur Peters has written some very useful dv utilities, available as dv-utils 0.2.1-1 from the main debian distribution and as dv_utils-0.2.1.tar.gz from http://www.singingwizard.org/programming.php.

They include several small programs for moving between dv, avi, and mov (Arthur works on libquicktime), and a few others:

dv1394connect.cc
dv2avi.cc
dv2mov.cc
dvavi2dv.cc
dvavi2mov.cc
dvmov.cc
dvmov2avi.cc
dvmov2dv.cc

" The main tool is dv2dv. It is a file converter that converts from between AVI, quicktime and raw DV without decoding."

Status prior to the debian installation fall 2002

Both gubbio and cyberspace handle dvgrab and kino. Only gubbio has playdv and dv1394in and out; they rely on the new dv1394 driver, which is in the 2.4.19 kernel.

There are several players to handle these different formats. Kino plays well on cyberspace but not on gubbio. Quicktime will play raw dv, but currently lacks the right codec. I could also install xdvplay, based on the libdv codec. Aviplay handles uncompressed avifiles fine, but it rarely compiles and I don't have a working copy on gubbio. Mplayer does great on divx and may handle dv on cyberspace. It's too slow on gubbio.

If you leave dvgrab running, you can close the last file cleanly with kill -2 <pid> -- see commands for details.

See also kino and firewire.

How to use dvgrab

To get five-minute files of the raw dv format, automatically named Tape02-001 etc., enter:

dvgrab --autosplit --frames 7500 --format raw --index small --timestamp Tape02-

How to use dv1394in

To import a file raw from the camcorder, issue:

dv1394in my.dv

It does a beautiful job.

How to use dv1394out

To export a raw dv file to the camcorder, issue:

dv1394out my.dv

For details on the tweaked setup, see firewire.

How to control the camcorder:

1. start camera playback:

dvcont play

2. preview:

playdv --no-mmap /dev/ieee1394/dv/host0/NTSC/in

3. stop camera:

dvcont stop

4. prepare to record:

dvcont record pause

-- the camcorder will wait in record / pause mode.

5. start recording after issuing dvcont record pause:

dvcont pause

5. view in monitor:

playdv my.dv

Installation

October 2002 update

On 3 Oct 2002, I got dvgrab-dv1394 from Dan Dennedy -- that is, the dvgrab version that goes with the new dv1394 driver. I compiled it and placed it in /usr/bin/dvgrab -- the other dvgrab is in /usr/bin/local/dvgrab and comes up as default.

I made a symlink from /dev/dv1394 to the working /dev/1394in. The dvgrab-dv1394 lacks the --index switch, so it likely won't support large file sizes. It also doesn't support the raw format, and I found it doesn't split the files at scene breaks ( --autosplit doesn't work).

I kept having trouble with this version. It produces garbled sound and poor video, sometimes with block effects. However, I reestablished the /dev nodes needed for the old dvgrab, which continues to work fine!

Dan also sent me the dv1394io utility by Dan Maas. When I tried to compile it with default gcc, I got this:

gcc: dvout.cpp: C++ compiler not installed on this system

I then swithed to /usr/bin/gcc and got part that hurdle -- evidently this version was compiled to handle C++.

Next I ran into this:

In file included from dvout.cpp:37:
dv1394device.h:5: dv1394.h: No such file or directory

I opened the dv1394device file and added a full ref to dv1394.h in the kernel and it got past this point, but it still wouldn't compile. Dan Dennedy said compile with g++ instead of gcc (change the Makefile), and in fact this worked flawlessly. I have no idea why.

This produced a number of files, but as far as I could tell it's dv1394in and dv1394out that are the useful binaries. I copied them both to /usr/local/bin -- they should be used for copying to and from the camcorder.

On 7 October 2002, I used dv1394in to transfer a 1 1/2 hour LP tape; it created a 20GB file. Kino read it fine, but didn't see the scene changes. I asked it to export this huge file to create a file that is split in two at 107,000 frames -- this would create a one-hour segment that could then be exported to a new SP tape, and a half-hour remnant. This worked!

I then read the 107,000 frame file into kino -- and it shows the scene changes!

First installation

I downloaded dvgrab 1.01 as a tarball and installed it. To make the new file execute, I had to move dvgrab from /usr/local/bin to /usr/bin and it started up, apparently accepting the libraw library. Test it using

dvgrab --frames 25 test

It should produce a small avi file. I had to build a new kernel to make firewire work -- with the help of gscanbus to diagnose the problems -- but once I had done that, dvgrab WORKED!!

I tested it a bit and then did this:

dvgrab --autosplit --frames 5400 /windows/e/Valerie/2001-12-12

This produces three-minute .avi files on the video harddrive. Pretty cool, eh? While my little production system was capturing, I kept working -- no overhead taken up by huge programs!

dvgrab produced ten 3-minute files over a half-hour period of about 650 MB each. I then switched to Windows and downloaded the Windows Media 8 Encoding Utility, a command-line codec. It took seven and a half hours to compress three minutes -- down from 650MB (a CD) to 3MB !! That's a megabyte a minute, or a full hour comfortably on a CD.

Note that dvgrab can grab to three different formats: two avi formats and a raw format. I used the default avi format, which plays perfectly in Windows Media Player. The results were extremely clear, but with some color distortion at the bottom of the screen. Possibly this is due to the High-8 format, or it could be due to dvgrab.

Here's material from dvgrab's forum: Here's a remark on capturing: "Maybe someone can tell me what data-mode would be best to capture under EXT3 (journal, ordered or writeback, I think journal is too slow, but I can't say if ordered or writeback is better). Maybe it's generally better to use EXT2 or any other filesystem for capturing."

And a possible compatability issue between V4L and kino: "I've found that if I don't load any of the Marvel/G400-TV video4linux modules, that XVideo support in Kino does work!"

On kino, Arne Schirmacher writes, "Please use 2.4.12 or 2.4.16 kernel."

On the new dv1394, there's Dan Dennedy: "A new driver called dv1394 in the linux1394 CVS aims to make DV export more stable and predictable. We hope it is ready for general use by the end of the year."

On kino's future, Thomas Ostreich writes, "there will be 2 export modules in 0.5.2. One for raw DV with sound interleaved and one for AVI with sound as extra track in any format."

xmms is the most popular music player -- the equivalent to WinAmp.

Xanim is at http://xanim.va.pubnix.com/ -- there's lots of excellent development work being done there, and detailed information about supported codecs.

See Mplayer installation.

Xanim

Xanim is not working with dv files -- neither dv1 or dv2.

I discovered Suse has installed the xanim codecs in /usr/lib/xanim/mods/

Before you install something, check the Suse repository to see where they put things. Use

xanim <filename> -d5

to display verbose errors.

MainActor

find / -name MainActor -mount -print | less

/usr/share/doc/packages/MainActor
/usr/share/doc/susehilf/raw_pacs/en/MainActor
/opt/MainActor

Good news: MainActor will edit video grabbed in dvgrab's -dv2 format! Down to the millisecond. Don't know how much I'll like it, but it works. Note that it takes a while to load a clip, and it doesn't handle the -dv1 format. That could be a matter of adding a codec of course.

MainActor will also play the video, and the sound is rendered perfectly. However, the video runs slowly and the two are completely out of synch. The video noticeably speeds up when the sound is done, so this looks like it's a CPU constraint! Which is fun -- you should see much better results with the new machine.

Blender is a 3D animation program.

http://www.blender3d.com/ -- see their ipaq page!

 

 

 

top
Debate
Evolution
CogSci

Maintained by Francis F. Steen, Communication Studies, University of California Los Angeles


CogWeb