natively compiling ffmpeg, x264, mplayer on mac (with builtin x264 and webm encoding)

i’m very pleased that after years of hacks here and there, all three heads of the current codebases pretty well build natively on mac (snow leopard) for

  • x264
  • ffmpeg
  • mplayer

here, i’m making sure that i compile in static version of libvpx (Webm) and libx264 (h.264) video packages so that the ffmpeg can easily make hiqh quality h.246 and webm transcoded videos.


So we can make nice (2 pass video) ~768 kb/sec 640×480 derivatives like so (alter “-r ” as appropriate):

# make WebM
ffmpeg -deinterlace -y -i 'camels.avi' -vcodec webm -fpre libvpx-360p.ffpreset -vf scale=640:480 -r 20 -threads 2 -map_meta_data -1:0 -pass 1 -an tmp.webm

ffmpeg -deinterlace -y -i 'camels.avi' -vcodec webm -fpre libvpx-360p.ffpreset -vf scale=640:480 -r 20 -threads 2 -map_meta_data -1:0 -pass 2 -acodec libvorbis -ab 128k -ac 2 -ar 44100 tmp.webm

mv tmp.webm 'camels.webm'


# make h.264

ffmpeg -deinterlace -y -i 'camels.avi' -vcodec libx264 -fpre libx264-IA.ffpreset -vf scale=640:480 -r 20 -threads 2 -map_meta_data -1:0 -pass 1 -an tmp.mp4

ffmpeg -deinterlace -y -i 'camels.avi' -vcodec libx264 -fpre libx264-IA.ffpreset -vf scale=640:480 -r 20 -threads 2 -map_meta_data -1:0 -pass 2 -acodec aac -strict experimental -ab 128k -ac 2 -ar 44100 tmp.mp4

qt-faststart tmp.mp4 'camels.mp4'

our preset files:

Nice things about the h.264 derivative:

  • plays on all iphones and ipads
  • browser video tag and/or flash plugin compatible
  • starts immediately, seeks immediately even before entire video is downloaded

hope this may be useful!

it’s fun to drink and drive!

I’ve been having fun racing the boyfriend on the PS3 game “Gran Turismo 5”.
Turns out the quite recent and relatively new Nissan GT-R is a totally insane car — 4WD and one of the largest engines Japan has made plus supercharging. With a nice belgian beer and our media room, it makes it a super immersively fun time!

I’ve added a carbon hood, racing rear spoiler, custom wheels, weight reductions, and engine tunings to bring it to something crazy like peak 650 horsepower. Really fun to personalize it a bit! The replays are fun — especially when you do spectacular crashes and jumps. You can customize the pictures from all sorts of different camera angles. Virtual reality, indeed! 😎

Amazing Summer trip to Bali!

Two week vacation to the glorious island of Bali, summer 2010.

Bali is culturally fascinating — full of very happy and cooperative people unlike any place I’ve seen. Here are some interesting tidbits/observances:

Bali is an amazing isolated place whose people typically lives communally and is based off of the agriculture of rice. Despite being part of Islamic Indonesia, the vast majority (70%+) of the people are Hindu (with a mix of Animism from Bali’s indigenous roots).

We saw everything we could, ate their amazing food, and tried to soak up as much Balinese culture as we could!

You can see more formats and information here.

Sony P-Series running 10.10 Meerkat Ubuntu

Sony P-Series
(specifically: win7 era P788K, 8″ 1600×768 display, 2B RAM, GMA 500 graphics, 64GB SSD)

I got this supercute mini-laptop last year

I had been using Ubuntu linux Lucid (10.4) and just upped to Meerkat (10.10). (Both were Netbook Edition).
I’d never gotten video acceleration to work before and was stuck w/ ~1-5 fps video most of the time.

Doing the widely suggested:

sudo add-apt-repository ppa:gma500/ppa && sudo add-apt-repository ppa:gma500/fix && sudo apt-get update && sudo apt-get install poulsbo-driver-2d poulsbo-driver-3d poulsbo-config

bricked my vaio 8-( well, i mean, it gave me root login w/o X/windows ability but… 8-p)
but 2-3 apt-get remove, reinstalls, hunting google later, found the apparent saviour (I did 1000mb from 2000mb recommended here):

sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mem=1000mb acpi_osi=Linux"
sudo update-grub

booted clean! *immediately* got ability to use proprietary vaio accessory to output VGA to external monitor (a first!) and brightness up/down hotkeys working. (brightness to work even at all!)
but best of all, video and appearance *and everything* (moving windows, starting applications) was *so much faster* visually!

cmd-line video playback with:
sudo apt-get remove mplayer
sudo apt-get install gnome-mplayer gecko-mediaplayer

so this is *all* i have done, aside from starting w/ vanilla install (with just a few changes to help w/ SSD instead of HD) of lucid upgraded to meerkat.
(personally, i’m still working on getting suspend/resume to work (seems to work but the display doesn’t come back on — been like this the whole time) and to get hibernate to work — prolly will go with some kinda memory stick to dump to)


suspend/resume working now with change to suggested “gma500 fix”

sudo add-apt-repository ppa:gma500/ppa && sudo add-apt-repository ppa:gma500/fix && sudo apt-get update && sudo apt-get install poulsbo-driver-2d poulsbo-driver-3d poulsbo-config

I think this additional suggestion may have fixed sleep/resume (but it’s possible it was just the gma500/fix related packages in live above:

sudo mv /usr/lib/pm-utils/sleep.d/99video /usr/lib/pm-utils/99video

Great Frontline program — The Wounded Platoon

I just listened to this as a podcast and then watched the video online after that.  It’s a really interesting slice and view into the Iraq war — where they just focus on one specific platoon.  “Wounded” refers more to the psychological rather than physical wounds — although the latter relates to the former…

The original materials, background, and discussion can be seen here.

The 7 chapter program can be seen in its entirety here:

requires javascript

Star Wars re-remastered to high quality 1977 version!

So I wanted to sit down in my updated home theatre and watch one of my favorite films, “Star Wars”. Problem is, I have two versions on DVD, and neither are ideal. The 2004 DVD version has remastered audio and video, but also added scenes and changes I really don’t like. The 1977 DVD version is a poor quality transfer and encoding.

So I combined the 1977 and 2004 DVDs into the highest quality 1977 version of the film! I show all my scripts and techniques here, too, so you can make the same version from your two DVDs, too!

star wars comparison of two films
star wars comparison of two films

ffmpeg for time-lapse, sets of images, and even *archiving*!

I now use the FFMPEG package compiled locally on my Mac Leopard laptop.

If you want to take a bunch of JPEG images, you can turn them into a “motion JPEG” AVI video file (which is ideal for time-lapse). What’s neat about ffmpeg, is you can turn a directory of JPEGs into an AVI and later recreate the JPEGs from the AVI.

Thus, I can take 100-1000 JPEG images from a “shoot” and create a video time-lapse of all the JPEG images in a given subdir in a command-line shell (terminal):
ffmpeg -r 6 -i "%04d.jpg" -an -vcodec copy out.avi

Even cooler, you can go directly back to *the same JPEG* images like so (this is where you can see it is a lossless conversion from JPEGs to Motion JPEG and back):
ffmpeg -i out.avi -vcodec copy "%04d.jpg"

“-r 6” is the framerate, ie: “make the video play 6 JPEG images per second”.
It doesn’t get much nicer than that! Not to mention, the encoding is FAST! I recently moved from mencoder/mplayer to ffmpeg since you can specify a complete copy of the input JPEGs (lossless from the source) as well as compress them down a bit (as you like).

For the lossless conversion, the (not entirely obvious) *key* to success is to use the “-vcodec copy” *after* the source file(s).

You can get this running on Windows with Cygwin, Mac with terminal, and any linux distribution like Ubuntu.



donors to my AIDS LifeCycle8 bikeride!

I took about 500 photos myself during the seven days of riding. Hunter also took about that many photos, too. I will make a combined album soon and edit a video as well and put links to them on this site.

However, for now, you can see    ~100 of my best photos on my public albums here:

Photo album (1 of 2)

Photo album (2 of 2)

one of my most favorite shots for the whole trip!!

ffmpeg building on mac intel/x386

ffmpeg v0.5 just came out. it’s the bomb. it’s got tons of fixes and massive amounts of new codecs that it can read. for example, it can now decode my professional filmmaker brother’s “DVC ProHD” highly proprietary (and massive bitrate!) format! it can also decode flac and 24-bit flac. (encoding flac is disappointing though).

at any rate! macports is a great way to get it installed on your mac.
the current way of setting up macports and then doing
sudo port install ffmpeg
works fine on my PPC at work (oddly — pretty old computer now) but not my Air (intel x386)

So I set out to find the fixes needed to make it work. Here they are:

step 1: install macports — see

sudo port install x264 +noasm # for i386 (not needed for PPC)
sudo port fetch ffmpeg
sudo port checksum ffmpeg
sudo port extract ffmpeg
sudo port patch ffmpeg
remove “–enable-shared” from /opt/local/var/macports/sources/
sudo port install ffmpeg

[May update] I think the packages are improving so some of the above steps may not be necessary, depending on your Mac model, xcode version, and such. So I’d suggest just trying “sudo port install ffmpeg” first to see if it works and try some tweaks above if that doesn’t work

Home Theater!

… on a twelve foot diagonal screen, muhahaahaaaa!

Russ found a government auction site that disposes of lots of surplus
and other equipment.
I picked up two *geenormous* BARCO LCD rear projectors for only $75
plus my own shipping and handling by showing up to a “high alert” and
checkpointed military base just outside of Sacramento.

It tooks us many months to finally get around to mounting it, seeing if it even would work for us, and converging it.

But when we did — wow! The one we use displays HD signals (we bought 3 professional-grade BNC cables and connectors for the receiver-to-projector connection for under $50).
Both our TV box and DVD player line double a progressive signal.
I think we may have the best looking home theater that I’ve seen — not bad
for 10 year old equipment, eh? 😎