Multiple Instances of Dropbox on Ubuntu Jaunty

I used this technique to run two dropbox daemons at the same time. I have one dropbox for data and a separate one for portable applications I use on a USB stick when I’m forced to use Windows. I run two instances of dropbox on the USB stick already, but wanted to keep a copy of the portableapps dropbox on my Ubuntu machine as well. Keeping the two dropboxen separate means I have more control over when the two data stores are updated.

Run the following command in a terminal:

HOME=$HOME/.dropbox-alt /usr/bin/dropbox start -i

This should start the dropbox installer. In the wizard, you can create a new account or link to an existing one. “.dropbox-alt” is the directory where I want the installer to download the new instance — you can choose a different location for the actual dropbox sync folder during the installation. Note that the .dropbox and .dropbox-dist folders will still be created inside the .dropbox-alt folder, so don’t panic if it looks empty.

I haven’t tried it, but I presume this method should work for as many instances as necessary.

I don’t want my second dropbox to run automatically, so I can start it up when I want it with the same command without the “-i” (which runs the installer):

HOME=$HOME/.dropbox-alt /usr/bin/dropbox start

The dropbox wiki suggests adding this line to /etc/rc.local in order to run the dropbox daemon at startup (replace “username” with the actual user):

su username -c “/home/username/.dropbox-alt/.dropbox-dist/dropboxd &”

UPDATE: I tried the previous command and it doesn’t seem to work. I’m trying this instead:

su username -c “HOME=$HOME/.dropbox-alt /usr/bin/dropbox start”

Capturing from Canon Vixia HV40 in Ubuntu

I am very pleased to report that capturing from my new camera works like a charm.  I hardly had to do any tweaking to get it to work.

Here are some commands that worked for me to begin with:

  • grab video
    sudo dvgrab –autosplit –frames 0 –size 0 –format hdv –buffers 1000 –showstatus –timestamp /home/video/foo-
  • convert to avi format for facebook, etc.
    ffmpeg -i foo.m2t video.avi
  • convert to dv format for editing
    ffmpeg -i /home/video/foo.m2t -target ntsc-dv foo.dv

New Camera

Just bought a new camera: a Canon Vixia HV40. Since my old beloved Panasonic died, I’ve decided I should plan for the future by moving to HD. Even so, I also wanted to stick with MiniDV tapes rather than HDD storage. This camera is perfect for me.

I love the HV40. I haven’t found anything not to like yet. My only small complaint is that the battery pack connection has a little play in it when attached to the camera.

Checking CSS for Errors

I just spent an hour or so struggling with some changes to the CSS of this site. I just couldn’t get my changes to show up in a browser. Finally, I ran my CSS through CSSCheck and discovered that my last definition ended with a ) (right parentheses) rather than a } (right brace).  Apparently, CSS doesn’t care if you close your last statement incorrectly, but, of course, when you add a new definition at the end, CSS ignores it completely.

Convert Raw MiniDV Footage to Upload to Facebook

I just shot a bit of footage I wanted to upload to Facebook. According to this Facebook question, mpeg4 video is a good choice.

This command seems to do the trick to convert my rawdv footage to a Facebook friendly format:

cat foo.dv | ffmpeg -f dv -i pipe: -acodec libfaac -vcodec libx264 -s 640×360 -aspect 16:9 foo.mp4

Note that the names of the codecs in this command seem to vary according to your version of ffmpeg.  If this version doesn’t work, you might try faac and h264 instead of libfaac and libx264, respectively.

Setting up/Moving a Cinelerra Project

I finally decided to reorganize my current video project to make things easier to find.  For starters, I realized that all the raw dv footage I’ve captured should not be in the same folder as the project itself.  That is a recipe for creating copies of the same footage later when I want to use it in another project.

Instead, I created a folder for my footage named by date and subject and stored it with the rest of my similar captured footage.  That way it is ready for me to grab for any project.  Next, I created a project folder (I called it “project_wbp” in my case).  Inside that I added another folder called “media_rawdv”.  Then I used this command in a terminal:

ln -s -t /path/to/media_rawdv /path/to/original/*.dv

That command creates symbolic links (i.e. shortcuts) to all the original files.  Cinelerra doesn’t care whether its resources are real files or links, so this works fine.  Later, if I move the original files, I can just recreate the links and I’m all set.

There are two important steps  you need to do when you move things around or rename them in your project:

1. You should edit your project .xml file and change the paths as necessary (note that Cinelerra doesn’t seem to like relative paths, so you should use absolute ones).  Don’t forget to change the path to the xml file itself if that has moved.  Any text editor can handle this.

2. To save a lot of processing on large projects with many resources, you should rename all the project’s index files (you can change the location in Cinelerra’s settings, but they’re usually in ~/.bcast”) and change the internal paths in each file.  The following program should do the trick:

#!/bin/bash
#first rename the files in .bcast
rename ‘s/home_video_oldname/home_video_project_wbp_media_rawdv/’ ~/.bcast/*.idx
#next use this to fix the internal paths in the index files
OLD=”\/home\/video\/oldname\/”
NEW=”\/home\/video\/project_wbp\/media_rawdv\/”
DPATH=”~/.bcast/*.idx”
BPATH=”~/.bcast/bak/”
TFILE=”/tmp/out.tmp.$$”
[ ! -d $BPATH ] && mkdir -p $BPATH || :
for f in $DPATH
do
if [ -f $f -a -r $f ]; then
/bin/cp -f $f $BPATH
echo $f
sed “s/$OLD/$NEW/g” “$f” > $TFILE && mv $TFILE “$f”
else
echo “Error: Cannot read $f”
fi
done
/bin/rm $TFILE

The only things to change in the preceding script are the two paths in the rename command and the same in the OLD and NEW variables.  Note the the index files include real paths (hence the \ escapes to make the literal / characters work), but in their names they replace the / characters with underscores.

For smaller projects, you could probably skip this step, as Cinelerra will regenerate the files anyhow.  For my 40 minute video, which has hundreds of clips, it takes hours to do this.   The script does the job in a couple of minutes.

Ubuntu Studio Tweaks

As I’ve been using Ubuntu Studio, I’ve discovered a number of must-have (for me, anyhow)  packages which were not installed by default.

As with any Ubuntu-based distro, there are a number of steps required to enable non-free and/or non-supported software.  I won’t bother to go into them, because Ubuntu has reached the point where it mostly prompts you to add codecs and things when you need them.  Of course, you should enable all repositories in the application manager (better yet, use Synaptic or, my favourite, Aptitude from the command line).

One exception I had to add was the “unstripped” versions of all the ffmpeg libraries.  I don’t think this is actually broken, just disabled in the default version of Ubuntu.  I just went into Synaptic, searched for ffmpeg, and added all the packages with “unstripped” in the name. (for details see Bug #254201 in ffmpeg-debian (Debian): “feature regression: ffmpeg lacks some video encoders (like h263+, MPEG4, maybe more…)”).  I use ffmpeg at the command line to encode video files and it is used in the background by many other video manipulation tools.

Some other packages I wanted to add to UbuStu:

  • openoffice (I used it to log my clips in a spreadsheet)
  • emacs (indispensable for tweaking config files and taking notes)
  • ntp (to make sure I’ve got the right time)
  • fslint (very useful for finding and removing duplicate files)
  • most (better than more or less for paging)
  • flashplugin-nonfree (to play flash in Firefox)
  • gstreamer (and plugins)
  • rhythmbox (my favourite jukebox for large music collections)
  • mplayer (commandline video player)
  • wv (commandline msoffice document dump)
  • elinks (commandline browser — comes in handy more often than you’d think)

I’m sure I’ll add plenty of more packages as I go along, but these are a few of the ones I’ve wanted so far.  I’ve also added a number of other applications, such as PiTiVi, Kdenlive, Avidemux, VideoCut, which I’m hoping to play with and get to know better.

Auditioning Multimedia Distros (part 3 – Ubuntu Studio)

After trying dyne:bolic and pure:dyne, I reverted to my last resort:  Ubuntu Studio (Intrepid Ibex version).

It isn’t that I dislike Ubuntu.  I’ve had it installed on my laptop and on our family computer for years.  I’ve also recommended it to friends several times with great success.  There were, however, two reasons why I wanted to avoid it for my multimedia workstations:

  1. Ubuntu uses the Gnome desktop, which, although it is great, needs more system resources than, for instance, Xfce.  I wanted to leave as much CPU and memory as possible for Cinelerra.
  2. Ubuntu Studio comes pre-configured with loads of good multimedia applications, but Cinelerra itself isn’t one of them.

It turns out that I needn’t have worried on either score.  Installing Cinelerra turned out to be painless.  I used the community version (see Cinelerra :: a video editor and compositor for Linux for information on adding the repository to apt and installing the package).  Further tips for installing Cinelerra on UbuStu can be found here.

Once I had Cinelerra installed, it seemed to be working, but I still needed to do some tweaking of Cinelerra’s own settings to make it usable.  I’ll cover that in another post.

Beyond that, UbuStu worked like a charm without any performance issues on my aging hardware.  I’m also really enjoying the artwork and styling of the default UbuStu desktop.  Very snazzy.

Capturing Video Over Firewire in UbuStu

Today I wanted to capture some video from mini-DV tapes using my camera, a Panasonic mini-DV model. I have done so in the past using a firewire cable, but this is the first time I’ve tried with my new Ubuntu Studio setup.

Here are the steps to follow:

1. In “Ubuntu Studio Controls,” check “enable raw1394 access.” If you try to use your firewire device now, it may crash the machine, so you should reboot before proceeding. I had the system freeze up on me two or three times before I had everything working reliably (this may be a result of the wonky firewire connection on my camera, which seems to be loose).

2. After the reboot, put the camera into VCR mode and press play. Then run Kino (from a terminal as root) and switch to capture mode. You should see the video playing in the Kino window. Rewind the tape again before you proceed. This step seems to be necessary in order to get Ubuntu Studio to recognize the camera as a firewire device (dvgrab may work just as well).

3. If you aren’t capturing a whole tape, you could just use Kino to control the camera and capture the clips. I actually prefer to do the capture from the command line using dvgrab.  To begin capture, enter this command (again as root):

#dvgrab –autosplit –frames 0 –size 0 –format raw –timestamp <dest>/<foo>

In this command, <dest> is the place you want to store the clips (e.g. /home/video), and
<foo> is whatever prefix you want the resulting filenames to have (e.g. tape1-). The clips will automatically be split into files and the timestamp will follow the prefix in each name.

Once you run the dvgrab command, it will wait for you to press play on the camera and begin capturing the clips. You’ll have to press <ctrl>-c once the clips are finished being captured.

Because of the broken firewire connection on my camera, I investigated the possibility of using USB to capture video, but that doesn’t appear to be a viable choice (and much slower, even if one could get it to work).

More info on firewire in Ubuntu here: Firewire – Community Ubuntu Documentation

Auditioning Multimedia Distros (part 2 – pure:dyne)

So, after my brush with dyne:bolic, I decided to try pure:dyne. PD was originally a revised version of dyne:bolic, but the producers of it decided to go upstream and recreate their distro based on Debian — The Universal Operating System (the ultimate ancestor of many specialized distros, including Ubuntu).

I’ve been using Debian for nearly ten years now, and I believe it is a good foundation to start from.  Unfortunately, the pure:dyne folks have a lot of work to do in order to customize their version to the same extent as dyne:bolic.  For example, where dyne:bolic has organized its apps and utilities into a very hierarchical menu system which makes it easy to find the function you want, even if you don’t know the name of the application, pure:dyne dumps everything into a single menu folder.  Unless you already know all of the multimedia apps you want to use, you have to spend a long time exploring to begin to be productive.  This is a minor complaint, of course, and otherwise pure:dyne looks like it would suit my purposes just fine.

When I tried to run Cinelerra on “leek and potato,” the latest pure:dyne release, I couldn’t get past loading my project.  This was due to the USB hard drive problem I’ve been having with certain kernel versions.  Pure:dyne, through no fault of its own, inherited the same issue.

At this point, not yet understanding the source of the problem, I gave up and moved on to Ubuntu Studio.  Since my drive worked with Ubuntu Hardy on another machine, I reasoned that UbuStu might work better.  Meanwhile, PD looks like a good distro which I would happily use again.  I expect it will be even better in future versions.