leah blogs

September 2005

15sep2005 · DV on OS X and a Lession in Being Dumb

This post was meant to be a big rant, then suddenly everything changed. But first things first.

I got a nice digital camcorder for a few days (Panasonic NV-GS55, if you care) and wanted to do a clever hack with it (about which I’m going to tell in a later post, I hope it works). So, I filmed the some things I needed, and started to wonder how I would get that material onto my Mac. Macs are really good at multimedia, they say, but my task is a bit unusual. Basically, I need a directory holding each frame of the movie as a file.

Looking through my installed software, iMovie seamed to be the right tool for the task, and after grabbing a Firewire cable it nicely detected the camcorder and was ready for recording. Fun, I think, my disk space is getting filled up really fast. Some hundred megabytes for a minute of video is pretty much, but the clip is short, so I didn’t care at first. Now, I thought, export that clip into some format, and you are almost done. mencoder, I knew, could expand movie clips into files.

Export. How funny. That’s probably what Apple thought when they restricted iMovie not to export at all until you register. Which I don’t see at all why I should. So, let’s hack this. After looking into my iMovie project folder, I see the whole clip is just a file in there. I wonder what it is, and let file(1) tell me:

Media/Clip 01: DIF (DV) movie file (PAL)

Hmm, I didn’t know that format, but at least it has a name, and isn’t just data. Hey, it can’t be that hard to convert that to something more useful. Unfortunately, mplayer, my swiss-army movie tool, can’t open it. I google a bit and discover the file format is actually called “raw DV”. There are not a lot of tools that can handle it, and I tried a lot of them.

This is where my trip starts. I couldn’t find reasonable tools at first, so tried grabbing the clip anew, this time from Helix Producer. Their “open-source” version can’t grab, however, you need a propietary version for that. No thanks! (And requiring bugmenot.com for downloading isn’t exactly nice either.)

I search some more, and discover for Linux there is a tool called dvgrab that can capture too. Not on OS X, however. I notice it has several output formats, among them DV2 and raw DV. Most other tools related to DV only can read DV2. I get and play with libdv, ffmpeg and mjpegtools and lots more. Nothing does what I want, and getting some of the tools (esp. smilutils) to compile takes a lot of time and hacks and just drives me crazy. I’m short before giving up, bitching at Apple for now allowing exporting (older versions of iMovie apparently did it) and having no software for an apparently simple task. Even converting raw DV to DV2 would do it as of now, but I only have tools for the reverse direction.

I google some more and find a post where they use a tool that I thought would help me a great deal, raw2yuv, was replaced with ffmpeg. Wait, ffmpeg, I installed that in the beginning of my experiments. I try to use the included player, ffplay and it tells me:

Media/Clip 01: could not find codec parameters

What the hell? The documentation says raw DV can be played with -f dv. It doesn’t. I feel dumb. In a few minutes, I’ll feel infinitely more dumb. I check the file again:

Media/Clip 01: empty

What the … hell? It takes a few more minutes to realize that I spend over four hours trying to play an empty file! Some of above tools must have clobbered it in the early stages of experimentation. The anger at the tools drifts, the anger at myself raises a big deal. I wasted half of a day doing complete utter crap. But heck, I learned a lot about how not to package your software.

I rip again, and—voilĂ —I have an MPEG2 of the file, thanks to ffmpeg, good enough for further progressing.

NP: Dan Bern—New American Language

Copyright © 2004–2022