Rendering video with Cinelerra and FFmpeg

I’ve been making videos to share with posts and looked around for some video editing software that works with Ubuntu. I’m running 11.10 Oneiric Ocelot and Avidemux is not yet in the repositories so I decided to give Cinelerra a try. It’s availalbe in a PPA.

I like it. I’d guess it’s got a 2-4 hour learning curve but after you figure out what commands and clicks control each function it’s pretty easy. The problem came when it was time to export my video to post on YouTube.

I tried exporting OGG files, but I got some weird errors, and only part of my video would appear when uploaded to YouTube. I needed to find an alternative. Since I’ve already compiled FFmpeg from source for transcoding my over-the-air recordings it seemed like a good choice for rendering the videos outside of Cinelerra. All I needed to do is get my hands on the raw audio and video, then use FFmpeg to assemble the parts. See the steps I took after the break. Continue reading

Stream music from Linux to iPad – no app needed

I’m a Linux guy but I’ve also got this iPad. I don’t run iTunes so there’s no music on it. I have a collection on my home server that feeds the computers and XBMC boxes in the house. But what about the iPad? I had looked all over, and managed to patch together a working system using gnump3d but it was a pretty gruesome hack. 

Well, I’ve got some functionality working now. I installed mod_musicindex for my Apache server. It’s just an added layer on top of the indexing feature that Apache has. I like it, and it works somewhat acceptably. I can even password protect the directory, but I can’t seem to get anything to stream outside of the LAN. I also have one album that I can’t play but I have no idea why.


Is this crippled functionality really necessary? Why can’t the iPod app have built-in web address browsing? Nice hardware, but I detest crippled software. Grr!

Transcode from 1080i to DVD

I’m getting rid of cable TV. There are still programs that I want to watch and since I often work at night I’m never around to watch primetime. I’m migrating my MythTV from analog cable encoding over to digital ATSC (over the air). I’ve built an HD antenna which I’ll share in another post, and I’ve picked up a Huappauge HVR-1250 ATSC tuner which I popped in and it immediately was picked up by my Ubuntu Karmic 9.10 box. The problem is I don’t care to upgrade storage space right now. 1080i recordings take up at least 6GB an hour so this will become an issue quickly.

I’m perfectly happy with the quality of DVD recordings on my HDTV so I’m going to downsample every recording to DVD size. I searched for help on this but there’s not much good information out there so I’m going to share what currently works for me.  If you have a better method I’d love to hear about it so leave a comment.

I’m using ffmpeg to transcode my 1080i recordings down to DVD quality. Here’s the command line:

ffmpeg -i YOUR_INPUT_FILE.mpg -y -target ntsc-dvd -aspect 16:9 -ac 6 -sameq -copyts YOUR_OUTPUT_FILE.mpg

I had to add the “-ac 6″ because I kept getting an error without it. It seems the output file was trying to encode 0 channels of audio. I haven’t extensively tested this yet but it worked on one recording. I’m writing a script that will take care of this for me. It will encode to a temporary file, delete the original, move the temp file to the original location, then rebuild the index file. Look for this in a future post.

Writing a Bus Pirate udev rule

It only took a couple of instances where the Bus Pirate wasn’t linked to /dev/ttyUSB0 before I got sick of that game and wrote a udev rule to create a symlink. Now, every time I plug it in it is available at /dev/buspirate. This simple bit of code creates the rule:

sudo echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6001";, MODE="0660", SYMLINK+="buspirate"' | sudo tee /etc/udev/rules.d/47-BusPirate.rules
sudo restart udev

Note: The restart udev command is for Ubuntu 9.10 Karmic Koala. Older version should run “sudo /etc/init.d/udev restart” instead.

Update: Kenny emailed saying he uses this for Bus Pirate v4:

SUBSYSTEM=="usb", ATTR{idVendor}=="04d8", ATTR{idProduct}=="fb00", MODE="0660", SYMLINK+="buspirate4"

That should do it.  You can now point your serial terminal program to ‘/dev/buspirate’. This doesn’t differentiate between different devices using the same FTDI chip but I don’t have any others so this isn’t a problem. If you need to specifically pinpoint this Bus Pirate as a unique device, add a compare key that looks at the serial number (ATTRS{serial}==”YourSerialNumberHere”).