My New Apartment

I’ve recently moved to Westlake, OH to be closer to work. I took some pictures of the new place, before and after clean-up.

The den/office looks small in the photo but is actually big enough to be another bedroom. I didn’t photograph the bathroom, but it has a beautiful marble countertop. It also has a custom tapestry that my mom made. I would have photographed it but I think toilets are ugly. I also have a walk-in closet. Cool.

One of my favorite features is the patio, where I’ve got my grill and a table. I can access the patio from both the living room and my bedroom. It’s a pretty nice place to do some grilling, have parties, play cornhole (on the green space beyond the patio), etc. When the weather is nicer, I’ll photograph that too.

Here are the photos:

My New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New ApartmentMy New Apartment

Originals are on Flickr

Parallelized batch media transcoding using bash and ffmpeg

Thanks to Dave Matthews Band’s liberal taping policy, there are hundreds of DMB concerts available for free on the internet (see bt.etree.org for DMB and others). Most of these concerts are encoded in the lossless audio format FLAC. Unfortunately, iTunes (and consequently the iPhone or iPod) doesn’t read FLAC files. I have downloaded about 30 concerts and I was thinking of a way I could convert all of them from FLAC to something that iTunes can import, like AAC. Converting each song one at a time would take a while, so I also wanted to parallelize the process. Encoding a single file is, of course, completely independent.

A simple Bash script did the trick:

#!/bin/bash
for i in $(find . -type f -name "*.flac")
do
_basename=${i%.*}
if [[ ! -e ${_basename}.m4a ]]
then
ffmpeg -acodec mpeg4aac -ab 128000 -i "${_basename}.flac" "${_basename}.m4a"
fi
done

Just pass in a list of files and test to see if the destination file exists before converting the original. Run one instance for each CPU core that you have. When I did this a few months ago, I had four available cores between two machines (I've since purchased a dual core Macbook and a dual core Mac Mini), so instead of encoding one file at a time, I was able to do 4 files at a time.