So, let's get the shameless self-promotion out of the way first... I made a Let's Play!
Since I used Kdenlive 0.9.2 to make it, I thought it might be worth talking about the issues I encountered while trying to put it together.
Video Capture
Right off the bat, I had trouble capturing the footage in the first place. I went out and bought a Pinnacle Dazzle DVC-100, which is a USB standard-def video grabber, and for which mature Linux drivers exist. However, drivers are only a tiny portion of the equation. It turns out there are several ways you can capture footage from a V4L2 device, none of which work very well. I tried:
- xawtv: Discovered and connected to the Dazzle immediately, but threw a ton of errors concerning audio underrun/overrun. Also, it defaulted to the smallest window size available, and resizing the window made it crash.
- cheese: Apparently I don't have the Exact Version of the gstreamer libraries installed that cheese wanted, as the program hung while eating 100% of a CPU core.
- ffmpeg: Sadly, it has a bug whereby it doesn't synchronize the audio and video input streams before it starts writing the output file, with the result that the audio and video are anywhere from slightly to laughably out of sync. I added my input to the ticket in ffmpeg's bug tracker.
- Kdenlive: Sorry, didn't work at all. I wrote up my experience in these very fora a couple weeks ago.
So that left mencoder, which did a reasonable job. For those playing at home, here was the magic incancation:
mencoder tv:// -tv driver=v4l2:normid=0:input=1:width=720:height=480:forceaudio:immediatemode=0:amode=1:audiorate=48000:alsa:adevice=hw.1 -fps 30000/1001 -oac lavc -ovc lavc -lavcopts acodec=mp2:abitrate=384:vcodec=mpeg2video:vbitrate=8000 -of mpeg -mpegopts tsaf -o output_file.mpg
The -tv options were the hardest to get right. Here's what the less-obvious arguments mean:
- driver=v4l2: Use V4L2 driver (as opposed to the older V4L driver) to talk to the device.
- normid=0: Device-specific. The Pinnacle Dazzle can capture several video formats (NTSC, PAL, SECAM, etc.) This argument says to capture in NTSC.
- input=1: Select S-Video input jack. Specifying input=0 will select the composite jack.
- width=720:height=480: Capture dimensions.
- forceaudio: Force audio capture, even if V4L/mencoder thinks there are no audio inputs.
- immediatemode=0: Capture audio and video together. (Don't really understand this; why wouldn't you want to capture them together?)
- amode=1: Audio capture mode; 1 means capture stereo.
- audiorate=48000: Audio capture rate. There were some sites that said a rate of 32KHz was better for this, but I had no problem with 48KHz.
- alsa: Capture using ALSA device (as opposed to OSS or ESD or Pulseaudio).
- adevice=hw.1: The ALSA device to capture from (device-specific).
The rest were just tweaks to the encoder. A lot of this is Cargo Cult Programming, as I was trying suggestions cribbed from various other Web sites. I chose to encode as MPEG2, as my machine is about six years old and not beefy enough to encode H.264 in realtime; I reasoned that 8 MBits should be plenty. Also, I didn't have enough disk space to capture to DV. I didn't try MJPEG.
Soon after that, however, I found I needed to transcode everything to H.264/MP4, as slicing and dicing MPEG2 doesn't really work all that well (which may be obvious to everyone else reading, but was a comparative surprise to me ("Surely it will simply interpolate from the last available I-frame...").
Special Effects
I was particularly interested in getting one effect, where I spliced in some footage of me dying, then "rewinding" that segment, restarting it, and completing it successfully. This meant playing a video segment backwards. Turns out that's not possible.
...Okay, it sort of is possible. There were a couple of cryptic posts in these very fora describing how to do it. After working through what he was trying to say, it turns out you go to your command line and enter this command:
melt -profile square_ntsc framebuffer:input_video.mp4 reverse=1 -consumer xml:reversed_video.mlt
This will generate a file named reversed_video.mlt, which you then load as a clip and add to your timeline. Poof! you have a backwards-running clip -- although Kdenlive will stutter if you scrub the timeline over it, and rendering this segment is very slow. But it works.
...Except that it doesn't entirely. Not only did I want to "rewind" the clip, I wanted to do so at 8X speed. "No problem," thinks I, "Apply a Speed filter to the clip in the timeline, and set it to 800%." I regret to report that this does not work. Kdenlive gets very confused when you try to do this -- the reversed clip suddenly collapses to one or two frames in duration, but is still visible in the preview window, and still only plays back at 1X (or should I say -1X), and no amount of fiddling achieved the result I wanted.
Eventually I had to create new clips containing the reversed footage, and it seems the most popular tool for doing this is avidemux (although, oddly, it won't reverse the audio as well). About a half hour later, I had the reversed clips I needed. I put them in the timeline, applied a Speed filter set at 800%, and it worked just as I wanted. (A key-frameable Speed filter would have been even better, wish, wish...)
Final Composition
Once I had all the assets in place, putting it all together was cake. The only confusing moment was when I dragged the glowing green dot at the upper-left corner of a video clip to create a fade from back, but it instead created an audio fade. Not sure if I did anything wrong there.
I also used a fair amount of the key-frameable audio volume filter. It would have been nice to be able to add keyframes to the filter directly on the timeline. That is, I would have liked to have been able to say, "Add a new keyframe here," rather than have to scroll around for an existing keyframe and double-click on it, then try to find the place I had been working on. But that's a relatively minor complaint.
Once it previewed properly, I set it to rendering. Two hours of crunching (and four hours of uploading) later, it was on YouTube.
Kdenlive is earning a reputation with me as a solid and extremely useful tool. Thanks for all your excellent work.
