Quantcast

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!
http://www.archive.org/details/reremaster

star wars comparison of two films

star wars comparison of two films

fotobook widget and plugin for wordpress

Make your facebook photos magically appear on your wordpress site

OK I’m certainly not all that and a bag of chips, but set to roll out in one week for a 565 mile bike trip to LA (over 7 days — I’m not *that* crazy 8-) I wanted to see if there was a nice/cute way to make me:

  • take pictures with my ifone
  • use the facebook app (to either take a picture or select one from ifone)
  • upload to facebook
  • have it automatically show up on my site

the first 3 are easy-peasy.  you throw money at the problem and get the ifone with its legendarily crappy cell service and the free facebook app.

for the last point, i searched around wordpress plugins and found “fotobook” plugin (which also comes with two default disabled widgets).

it’s a liddle scary — you login to facebook while it’s “bugging” you, but once you done that (and given it your car keys) it figures out all your photo albums.   you can pick which albums you want to show/hide.   you can login/auth more accounts/people too (but so far I only love myself).  to make my left-hand column “NEW TRACEY PIX” on

my wordpress site

show up, I enabled the “photos widget”, set it to “most recent”, and tweaked the underlying PHP code to make a simple link to my facebook “mobile uploads” public page.

I think there’s an “update all albums” button somewhere, but there’s also simple instruction to “cron a get of url [X]” every X period of time so I did that.  Next, I tested it and “voila!” 5 minutes later, and then a few hours later when Hunter tagged me in some pictures, the left-hand widget updated as if by magic.

I guess this sort of thing excites me.  May be old hat.  I know raj got tikirobot auto-posting the twitter feeds so maybe he’s figured something like this out already too.

neat, no?

ranchtronix case

RaNChTroNiX
has the same spelling as
RANchTronix
(or maybe every1 already knew that 8-)

archive.org supports random seeking in their videos now!

i finally found the magic dead chicken to use
with flowplayer + lighttpd + mod_h264_streaming.
it turns out one needs to download and use an additional
.swf file to get the scrubber bar to send the
(already working) “?start=610″ (to start 610 seconds in)
parameter to our litey on archive.org

phew! yay!

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 http://www.macports.org/install.php

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/rsync.macports.org/release/ports/multimedia/ffmpeg/Portfile
sudo port install ffmpeg

(and “ffplay” is pretty cool now! i am considering using it over mplayer, hmm….)

Tracey and Hunter go to Obama’s Inauguration

Hunter and I travelled from CA to D.C. to watch Obama’s Inauguration.
We stood in the very cold historic day for 5 hours (after 3 hours getting from VA to DC) but were THRILLED!
We watched from The Mall, at 12 Street, about 2/3 of the distance from The Capitol to the Washington Monument.

I made a 7 minute short video of our 70 hour trip 8-)

ffmpeg hook to aid with “rectangular pixels”

Tired of screen-scraping the output of ffmpeg and/or mplayer to get the parameters / clip info for a media file?

This hook attempts to remedy this by printing simple information about the passed in video from the cmd line.

It will also print out whether or not the clip is using “rectangular pixels”.

WTF is a rectangular pixel?

 

Well, the easiest examples are DVDs.  You only want to buy a DVD if it says one of two standard phrases on it — “Enhanced for 16:9 TVs” or “Anamorphic widescreen“.  They both mean the same thing — namely that the video on the DVD disk is wider than 4:3 aspect (pretty much all films are ratio 16:9 or even wider like ratio 2.35:1) *and* that it didn’t *waste* any DVD bytes by encoding “top/bottom black bars”.  (If it doesn’t say those code phrases, it’s an older, crappy/low budget produced, or worse a “pan-n-scan” chopped film (where they lop off the left and right sides of each frame to fit into a 4:3 TV!)  Worst yet, if the DVD only says something like “widescreen version”, though it sounds good, it means while they didn’t cut off the picture, they wasted 25% (or more!) of the pixels encoding “black bars” on the top and bottom.  So you have less pixels in the DVD encoding the picture compared to an “anamorphic” version of the same thing.  Hello crappy quality!)

 

 

Anamorphic DVDs are encoded internally at 720×480 pixels per image.

Now look at this:

  4:3 video == 1.33 ratio == 640×480 pixels image

16:9 video  == 1.78 ratio == 854×480 pixels image

so what is 720×480?  it’s almost perfectly in the middle of those two — math: 720/480 = 1.5

So the “encoded transport image size” is neither 16:9, nor 4:3 — it’s right in the middle, capable to encode either a 4:3 video (like non-high def TV, many computer screens) or 16:9 video (high def TV, some digital video).  I like to think of it as “how the formats that came out right before HDTV took off, compromised to hedge there bets to be between 4:3 and 16:9″.

The final critical bit of information about a DVD is the “aspect ratio” (not of the overall image, confusingly, but of each encoded *pixel*!)  This says “wait, this pixel isn’t square, literally, like you’d think if you just read the image — it’s actually supposed to be stretched to make the *overall image* either 640 pixels wide (squoosh down from 720) or 854 (stretch wider to 854).  So the video track is “flagged” with a “pixel aspect” (often referred to as PAR (Pixel Aspect Ratio), SAR (Sample Aspect Ratio), or DAR (Display Aspect Ratio) — some of those have some slight nuances/differences, but that’s digging too deep).  Anyway, neat, huh?  Your anamorphic DVD is a changeling!  (maybe “anamorphic” makes more sense mnemonically now 8-)  (PS: “DV” video — the most common format that digital camcorders that write to tape use — is similar.  720×480 pixels/image plus a “flag” for what each pixel “shape” is).

 

This hook I wrote will output information about the clip (like “ffmpeg -i” will do, but in a format easier to parse) as well as information about the pixels (unlike ffmpeg).  So you can then know more about a clip if you are going to do things like pull single frames/thumbnails from it or convert it to another format.  We have been using this at Internet Archive for our movies for over a year and a half now and it works great!

 

C Code is here.  

There are some instructions for compiling with an ffmpeg source at the top of the C code.  (There is also an ubuntu-on-AMD compiled “.so” at that link by changing the suffix from “.c” to “.so”, FWIW)

 

Example invocation and output:

ffmpeg -vhook "/petabox/deriver/identify.so oldpresidio.mpeg"
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-pp --enable-libvorbis --enable-libogg --enable-liba52 --enable-libdts --enable-dc1394 --enable-libgsm --disable-debug --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-x264 --prefix=/usr/
  libavutil version: 49.3.0
  libavcodec version: 51.38.0
  libavformat version: 51.10.0
  built on Nov 30 2007 19:09:20, gcc: 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
Video: mpeg2video, yuv420p, 720x480, q=2-31, 8000 kb/s
width: 720
height: 480
aspect: 32/27
fps: 29.97
duration: 00:03:05.2
audio: true
Failed to Configure /petabox/deriver/identify.so
Failed to add video hook function: /petabox/deriver/identify.so oldpresidio.mpeg
The “failure” above at the end is deliberate/OK (it just makes sure ffmpeg stops and doesn’t try to transcode).
So we see that this video clip:
is indeed widescreen by the “aspect” line above (indicating the pixels are rectangular, not square) with value 32/27.
If we multiply the encoded image width of “720″ by 32 and divide by 27, we get the magic/correct 853.33 (round up or down to nearest pixel).
We use this utility at Internet Archive to make user friendly formats like “h.264 .mp4″ videos and “Ogg Theora .ogv” videos that get converted to the proper square pixel equivalent (and *not* messup widescreen videos 8-)

geek stuff from archive.org — making Ogg Theora videos

Fast, reliable way to encode Theora Ogg videos using ffmpeg, libtheora, and liboggz

archive.org has started to make theora derivatives for movie files, where we create an Ogg Theora video format output for each movie file.   after trying a bunch of tools over a good corpus of wide-ranging videos, i found a neat way to make the Archive derivatives.

 High Level:

  • use ffmpeg to turn any video to “rawvideo”. 
  • pipe its output to *another* ffmpeg to turn the video to “yuv4mpegpipe”.
  • pipe its output to the libtheora tool. 
  • for videos with audio, ffmpeg create a vorbis audio .ogg file. 
  • add tasty metadata (with liboggz utils). 
  • combine the video and audio ogg files to an .ogv output!   

Detailed example:  

 
/usr/bin/ffmpeg -v 0 -an -deinterlace  -s 400x300 -r 20.00 -i CapeCodMarsh.avi -vcodec rawvideo -pix_fmt yuv420p -f rawvideo -  | \
/usr/bin/ffmpeg -v 0 -an -f rawvideo   -s 400x300 -r 20.00 -i - -f yuv4mpegpipe -  | \
/petabox/deriver/libtheora-1.0/lt-encoder_example --video-rate-target 512k - -o tmp.ogv;
 
/usr/bin/ffmpeg -y -i CapeCodMarsh.avi -vn -acodec vorbis -ac 2 -ab 128k -ar 44100 audio.ogg;
/petabox/sw/bin/oggz-comment audio.ogg -o audio2.ogg TITLE="Cape Cod Marsh" ARTIST="Tracey Jaquith" LICENSE="http://creativecommons.org/licenses/publicdomain/" DATE="2004" ORGANIZATION="Dumb Bunny Productions"  LOCATION=http://www.archive.org/details/CapeCodMarsh;
/petabox/sw/bin/oggzmerge tmp.ogv audio2.ogg -o CapeCodMarsh.ogv;

WTFs:

  • Why the double pipe above? Some videos could not go directly to yuv4mpegpipe format such that libtheora (or ffmpeg2theora) would work all the time.
  • We do the vorbis audio outside of libtheora (or ffmpeg2theora) to avoid any issues with Audio/Video sync.
  • We convert to yuv420p in the rawvideo step because ffmpeg2theora has (i think) some known issues of not handling all yuv422 video inputs (i found at least a few videos that did this).
  • We add the metadata to the audio vorbis ogg because adding it to the video ogv file wound up making the first video frame not a keyframe (!)

So this will end up working in Firefox 3.1 and greater — the new HTML “video” tag:

<video controls=”true” autoplay=”true” src=”http://www.archive.org/download/commute/commute.ogv”> for firefox betans </video>

This technique above worked nicely across a wide range of source and “trashy” 46 videos that I use for QA before making live a new way to derive our videos at archive.org ( http://www.archive.org/~MY-FIRST-NAME/_/stream.php  [sorry don't necessarily want all that crawled by non rajbot robots] )

-tracey jaquith   “don’t make me 3:2 pulldown you”