IEEE 1394 DV Image Capture
- IEEE 1394 for Linux
- IEEE 1394 for Linux - http://www.linux1394.org/
- Arne Schirmacher's Linux DV
- IEEE 1394 card source
- FirewireDirect Type II cardbus adapter
I am documenting here my success with capturing digital video stills from my DV Handycam under Linux. I am not a hot programmer and I probably can not help with any problems you may have outside of looking at your lsmod or lspci results and commenting on things that should be obvious but in the heat of battle you may have over-looked. My GoBook only had a 2GB drive at that time so I had to go minimal; Let us just say that I started with RedHat7.3 stock out-of-the-CD laptop Gnome-only install, and later added the development libraries and gcc so I could compile stuff and let it go at that.
Typical comments on compatibility at the SourceForge hardware compatibility site were "Works great!" and mostly just, "Works". Big help, guys. No "HOW I DID IT!" anywhere, not even an email address or URL to a HOWTO. (Bet these folks never write home from school, too.)
My (actually "her") camera is a Sony DCR-PC1 DV Handycam. It is a miniature DV tape unit with iLink (Sony???s name for IEEE1394, or FireWire). Output resolution is an 'interpretted' 640x480 pixels. I don't think the CCD is that large.
I scanned the IEEE1394 for Linux site at SourceForge for units with positive compatibility notes. A couple caught my eye and I picked the FireWireDIrect OHCI card mainly for its well-thought-of TI chipset and resonable price ($66 including shipping), and it came in a kit including a cable (and software for Windoze and Mac only).
Install the Apps and libs
This is one of those projects that needs all the little pieces in place to even START to work. Refer to the IEEE1394 site in reference #1, above for a complete list of what's available on Linux digital video. Here is what I needed to capture images:
- The 2.4.12 or higher kernel and ohci1394 driver and ieee1394 modules (or whatever your card needs - RH7.3 came with a plethora of card drivers and the 2.4.18-3 kernel). On my laptop, these two installed when the card was inserted.
- libraw1394_0.9.0.tar.gz - should be one of the first to go in.
- tar -zxf libraw*.gz
- cd libraw1394-0.9.0
- make install
- make dev !!! IMPORTANT STEP !!!
- libdv-0.98-1.i586.rpm - codecs for interpreting image compression schemes
- rpm -Uvh libdv*.rpm
- dvgrab1.01.tar.gz - the app you use to capture frames to files.
- tar -zxf dvgrab*.gz
- cd dvgrab-1.01
- make install
- libavc1394-0.4.1.tar.gz - this is important; it provides dvcont, a commandline interface to control the camera. Install the typical way of tarballs, as for dvgrab, above.
- gscanbus-0.7.1.tgz - install as above for dvgrab.
- Insert the card with the camera connected and turned on, either in VCR or RECORD mode.
- The raw1394 thingy - I do not know what this is; is it a driver too? Or a plugin... Anyway, capture and stuff does not work until this is in the kernel too, and it apparently does not install itself, so I have to do
- modprobe raw1394
If all these compile/install without errors (you may have to search out some dependencies -- of course) you should be "good-to-go", as Ellie says.
Here is my lsmod results before inserting my FirewireDirect card:
Module Size Used by Not tainted maestro 30432 0 soundcore 6436 2 [maestro] autofs 11940 0 (autoclean) (unused) nfs 84956 1 (autoclean) lockd 55584 1 (autoclean) [nfs] sunrpc 73812 1 (autoclean) [nfs lockd] wvlan_cs 25760 1 ds 8352 2 [wvlan_cs] yenta_socket 11872 2 pcmcia_core 48480 0 [wvlan_cs ds yenta_socket] usb-uhci 23492 0 (unused) usbcore 71168 1 [usb-uhci] ext3 64448 2 jbd 47608 2 [ext3]
Here is my lspci results after inserting the FirewireDirect card with the camera connected and powered on:
00:00.0 Host bridge: Intel Corp. 430TX - 82439TX MTXC (rev 01) 00:01.0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02) 00:01.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01) 00:01.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01) 00:01.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02) 00:10.0 Multimedia audio controller: ESS Technology ES1978 Maestro 2E 00:11.0 CardBus bridge: Texas Instruments PCI1250 (rev 02) 00:11.1 CardBus bridge: Texas Instruments PCI1250 (rev 02) 00:12.0 VGA compatible controller: Neomagic Corporation NM2160 [MagicGraph 128XD] (rev 01) 05:00.0 FireWire (IEEE 1394): Texas Instruments TSB12LV23 IEEE-1394 Controller
Here is my lsmod results after inserting my card:
Module Size Used by Not tainted ohci1394 17760 0 (unused) ieee1394 36360 0 [ohci1394] maestro 30432 0 soundcore 6436 2 [maestro] autofs 11940 0 (autoclean) (unused) nfs 84956 1 (autoclean) lockd 55584 1 (autoclean) [nfs] sunrpc 73812 1 (autoclean) [nfs lockd] wvlan_cs 25760 1 ds 8352 2 [wvlan_cs] yenta_socket 11872 2 pcmcia_core 48480 0 [wvlan_cs ds yenta_socket] usb-uhci 23492 0 (unused) usbcore 71168 1 [usb-uhci] ext3 64448 2 jbd 47608 2 [ext3]
Here is my lsmod results after issuing modprobe raw1394:
Module Size Used by Not tainted raw1394 8176 0 (unused) ohci1394 17760 0 (unused) ieee1394 36360 0 [raw1394 ohci1394] maestro 30432 0 soundcore 6436 2 [maestro] autofs 11940 0 (autoclean) (unused) nfs 84956 1 (autoclean) lockd 55584 1 (autoclean) [nfs] sunrpc 73812 1 (autoclean) [nfs lockd] wvlan_cs 25760 1 ds 8352 2 [wvlan_cs] yenta_socket 11872 2 pcmcia_core 48480 0 [wvlan_cs ds yenta_socket] usb-uhci 23492 0 (unused) usbcore 71168 1 [usb-uhci] ext3 64448 2 jbd 47608 2 [ext3]
Grab an Image
Try the dvcont play command in VCR mode or dvcont record if in RECORD to see if the camera is responding. If this does not work, you probably will not get any further.
If that works, either play a tape so images are streaming to the card, or have the camera framed on something you want to view. Issue the command:
dvgrab --frames 1 --format raw test
That should grab one raw video image into the file "test.dv". Now to convert the image to a format the GIMP can open for editing, do:
playdv -n 1 --dump-frames=test%02d.ppm test.dv
That takes one frame from the test.dv file and converts it to ".ppm" format with a filename of "test00.ppm". Now, just launch the GIMP and open the file.
- Camera does not respond to dvcont play:
- The system does not know your camera exists. Try running gscanbus and see if it shows up as a node; If it does not, you either did not boot with the camera "live" (powered up) or perhaps libavc1394 and libdv are not properly installed.
- Error opening images with playdv:
- Try different output formats from dvgrab (see man dvgrab for options.)
Credits:basically all credit goes to the guys who developed the IEE1394 Linux software, and Dan Dennedy for hinting I needed to install something else (<tt>dvcont which I traced to libavc1394).