Archive for April, 2011

Forcing a Copy and Paste with Terminal

This is a shorty, but a goody. Have you ever had a large amount of data you need to layoff to an external drive and then had it quit half way through using the finder’s copy and paste? Well then have I got a tip for you! This method should work regardless of those finder copy/paste problems. Ok, all cheesyness aside here is all you need to do:

  • Open Terminal
  • type “cp”
  • space
  • type “-rvf”
  • space
  • type “\” (forward slash)
  • drag your source path
  • type “\” (forward slash)
  • drag your destination path
  • hit return

Compressing to the Perfect Web Resolution

In the video/film industry there are generally several ways to do things and they can get you a similar result.  Likewise, with compressing video for web you can make a video a lot of different sizes (resolution),  but in a technical and real world workflow there are right resolutions.

To make a long story short, mpeg (and most all modern compression codecs), use a shorthand to display image data (from 1′s, and 0′s) called macroblocks.  The largest of these macroblocks is 16 pixels wide by 16 pixels tall.  These macroblocks are very visible if you ever use your HDTV via an antenna to watch a broadcast that is not coming in all of the way.  You don’t see scrambled snow like the old days, you see the actual macroblocks scrambled up.

Ok enough boring background, in real world scenarios the reason using the following resolution below are the right video resolutions are two-fold.  This is because both the width and height are divisible by the size of a large macroblock (16×16).  And here are those reasons:

  • It is easiest for a processer to decode the compressed video
  • It is easiest for the codec to create a clean encoded video

All of this theory and practice comes from the fact that there are 8 bits in a byte since the creation of the personal computer.  You remember the time you bought a fancy 500GB hard drive and it wasn’t really 500GB? Same reason.  OK, so now you know why these resolutions are ideal – here they are:

16:9 Resolutions:

  • 256×144
  • 512×288
  • 768×432 (my favorite for general use)
  • 1024×576
  • 1280×720 (perfect for youtube uploads)

4:3 Resolutions:

  • 320×240
  • 640×480

Here is an example of what I mean by divisible by 16, using 768×432 as an example.  768/16=48 and 432/16=27 – both 48 and 27 are whole numbers and not a fraction, which means you would not be compromising part of a large macroblock to create that resolution video.

Hopefully this helps some people down the road.  There of course are times when you get silly requirements that you can’t do anything about, but when you can choose – always choose wisely.

Compressing Video for HTML5 – H.264 (Part 3)

This is the 3rd part and my favorite web delivery codec of all time – H.264!  H.264 will play happily in all Apple i-devices, Safari, Internet Explorer, and many others in the HTML5 protocol.  What is important to understand about H.264, is there are several flavors of it.  With my most recent testing last year, the open source version of X264 was by far the leader.  Other vendors include Apple (the worst by far), Dicas (not included anymore in current software), and Main Concept (Adobe Media Encoder, Episode).

What is so awesome about this is, the BEST VERSION OF H.264 IS FREE! You can usually find good recent builds of this in Handbrake, a lifesaver of a free DVD encoding tool, as well as in MyCometG3′s radical plugin.  You can download the plugin here:

http://www003.upp.so-net.ne.jp/mycometg3/

Yes, the website is ghetto, but the video output is amazing.  You quickly install the quicktime component into your library and can compress with X264 via quicktime pro and compressor.  A few of the great options available are:

  • ability to encode in high profile H.264
  • ability to encode in CABAC
  • and a check box to force 2.2 gamma on the video – (no more ‘corrections’ in compressors filters)

Ever since I was opened up to the world of this plugin, I never use anything else for my day to day compressions.  There are more options than any h.264 encoder on the market, and it is regularly updated to make it even better.  It rocks!

Compressing Video for HTML5 – Webm (Part 2)

Hopefully the part 1 post about HTML5 isn’t too long winded, but in reverence to your valuable time I will make this post short and to the point.  Webm is another video format that is used in HTML5 delivery.  Firefox 4.0 and Chrome are the players here.

The bad news here however is that there is not a good free option that I have found.  To create good Webm video I am using a software package known as “Episode” for the mac.  Version 6.1 is what I am currently running.  Episode is a great tool, but does come with a $500 price tag and with the advent of a freely available X264 quicktime plugin component available, I rarely use Episode aside from creating WEBM (aka VP8).

In the previous version of Episode, it only supported 25 or 30fps webm encodes.  This has since been fixed.

The video settings I use for making WEBm in Episode are:

  • 800-1400 kbps bit rate
  • check box for two-pass encoding
  • Forced keyframes every 240 frames (10 seconds)
  • Constant bit rate
  • Decode buffer time at 1 second
  • Maximum number of threads at 2

Compressing Video for HTML5 – Ogg Theora (Part 1)

Thankfully with the advent of ‘smart’ phones in everyone’s hands nowadays, I am no longer compressing video in tiny 3GP old school mpeg wrappers for mobile customers.  However, one big thing that I learned while creating compression profiles for ATT Media Mall and Verizon V-Cast back in the day was the appreciation of this constant compromise:

How do I make video look and play good  (or good enough) on so many cell phones or newly dubbed ‘devices’?

I thought I might be able to make some other editors and compressionist lives easier by doing a 3 part blog about encoding for today’s web browsers and what I use that works.  In the past few months we launched 2 fully capable HTML5 websites – one for Coke Zero’s Tron iPhone game and one for American Express’s new travel service called Nextpedition.

Well, going back to the question “how do i make video look and play good”, the answer now is – Make a lot of compressions and TEST. Don’t just watch them with one setting applied use several and see what is looking best for your edited show.  Current HTML5 sites need to supply 3 different video sources, those are:

  • Ogg Theora (to support Firefox)
  • Webm (to support Chrome, my favorite browser)
  • H.264 (to support everyone else, and by far the most advanced codec using X264)

Enough boring banter, here is how I am currently creating Ogg Theora video to supply my web developers for HTML5 sites.

  1. Create a scaled master in After Effects to the output resolution (for me lately this has been 512×288, although I’l like to lean more toward 768×432 in the future)
  2. Use Chris and Trish Meyer’s trick with unsharpen mask and composite CC to sharpen it up when possible
  3. Here is the catch – Export as Animation codec (the terminal tool won’t accept ProRes)
  4. Download ffmpeg2theora and install
  5. Open terminal on a mac
  6. type the following:  ”ffmpeg2theora -V 800 –soft-target –optimize –two-pass -a 3″ without the quotes, this is a good setting to use for a lower end server.  If you have a better server you can easily get away with setting the data rate (-V 1400) kbps and get a cleaner encode.
  7. this encodes a .ogv video at the same path as your source.  Test with VLC player.

Compressing Ogg Theora video for HTML5 from Chadwick Shoults on Vimeo.

Another useful tip is if you type in “man ffmpeg2theora” in the terminal, you will pull up the manual which is super helpful for understanding the options available.  If you are not so inclined to use terminal, there also is a quicktime component plugin from xiph that also creates usable Ogg video (just not as customizable and quality suffers a little).

Render After Effects Comps in Terminal

Recently, a super cleaver Art Director – Tim Haldeen, showed me a tip that blew my mind for productivity in After Effects.  What if I could render out a comp and still continue to work on other comps on the same machine?  In addition, what if I could use all of my available ram?

This trick does just that – using the terminal (sorry windows guys) not sure what your solution is.

  1. Add your comp to the render que – (command+m) “make movie” is how I remember.
  2. Under “output module” select, under “format” – PNG Sequence (rather than quicktime movie).
  3. Under “render settings” select the check box at the bottom for “skip existing files” – this is what allows you to maximize your ram usage on your single machine.
  4. Save the project file
  5. Open terminal
  6. Find the file called “aerender” which should be in your applications folder for After Effects and drag it into the terminal window
  7. Now hit space “-project” space, and drag your AEP into the window and hit return.

This begins the render!

Bonus Points if you want to use more than 2GB of ram here is what you do:

Copy/Paste the command into another terminal window and hit return.  Each time you do another window you are allocating another 2GB to the render.

Happy animating and designing!

Finishing a Video Edit

“And… Cut!”, the director says to the DP as production has wrapped.  Thus beginning the long exploration of what is to come in post-production.  I have just recently had the pleasure on finishing one of the largest documentary projects I’ve worked on in a long time.  Here are some of the fun stats from it:

  • Hours of Footage:  46
  • Average editing shot length: 38 frames (based on 23.976 timeline)
  • Number of Shows: 14
  • Number of Killed Shows: 2
  • Average Length: 1 minute
  • Music Tracks Auditioned:  168
  • Days in Post Production:  106

The set of web shows is to promote a new service from American Express Travel Services.  Basically, the idea is you get profile from taking a short quiz on the type of traveler you are.  Then you select how much budget you have for your trip you want to take.  Then Nextpedition plans your vacation for you.  You get an iPhone-like device that gives you information as you travel, telling you places they think you would enjoy.

It’s a pretty cool idea and I hope it catches on.  Some of the awesome adventures people have gone on are:  learning how to row a gondola in Venice (opposed to riding in one), and taking a cooking class inside the kitchen of a famous french chef after shopping with her in the market.

We built the site to be friendly with HTML5 which means lots of compressions filled my days recently.  Every different show received an encode for – Firefox, Chrome, and all other browsers (as well as different ending for the youtube versions).  Lots was learned by myself and a lot of people along the way.

Here is the link:

http://www.nextpedition.com/

Follow

Get every new post delivered to your Inbox.