Archive for September, 2008

MKMP4: An automated H264 / HE-AAC (aacPlus) encoder script for Mac and Linux / Unix

Friday, September 26th, 2008

I have been nothing but amazed about the feedback that i got on my prior tutorials on how to automate the whole chain of free and open source tools to create amazing quality video at really low bitrates (great for flash streaming, etcetera).

I usually write such tools and scripts for myself or for clients, but due to the fact that it seems a lot of people is interested in the process, I’m releasing here the new version of my encoding tools for the Mac and any Linux / Unix variant.

Needed tools and applications

For all this to work, you will need the following things

Extra pre-requisites for Mac OS X

Mac OS X users need to install the Apple Developer Tools (aka XCode) in order to compile software, also, for building the x264 encoder, you will need to get and install YASM.

Now, you have to build and install all the tools, AND they have to be on any directory in your executable path. My scripts assume that all the tools are in your executable path.
(more…)

MediaInfo Mac 0.7.7.58, revisited.

Sunday, September 21st, 2008

As you maybe know, time is a commodity these days, but i took some hours to fix some bugs and update several things in MediaInfo Mac.
Most of the fixes are related to the usability aspect of this little tool, as in, improved open and save dialogs, etc, but there is also some speed improvement in the parsing routines, and, the application is 64bit ready now (for capable hardware).
For the late comers, MediaInfo Mac is a Macintosh version of an amazing tool (called MediaInfo) created by Jerome Martinez, you can find more info about his incredible work by going here.

If you want to download MediaInfo Mac, you can visit the official site by going here… or, if you are lazy, you can just grab the latest version by clicking here.

Below is a little video demo of what the application can do and what kind of detailed information you should expect when processing video / audio files.

[flashvideo filename=/wp-content/uploads/2008/09/mediainfo_demo.mp4 /]

As usual, questions, comments and suggestions are welcome :)

Apache redirect rules for moving your site to a new domain.

Saturday, September 20th, 2008

So you are moving your website or blog to a new domain / url, but what happens to all that people and search engines trying to reach the OLD domain that you are leaving ?

Well, as you maybe noticed, I have moved my blog to a subdomain (yes, now this blog is at http://blog.massanti.com) and i was somehow worried about how to deal with all that people and search engines still going to the OLD url (http://massanti.com), so obviously, one thing came to my mind: “Apache redirects”.

This took me a whole 5 minutes to write, so I’m writing it here just for anybody interested.

Basically, the goal was to redirect anybody going to massanti.com/someblog/post/here to blog.massanti.com/someblog/post/here AS LONG as the file doesn’t exists on massanti.com: i.e: i don’t want massanti.com/somedir/somerealpage.html being redirected to blog.massanti.com/somedir/somerealpage.html.

So what i did was to create a .htaccess file in the root directory of massanti.com with the following contents:

<ifmodule mod_rewrite.c>
   RewriteEngine on
   RewriteCond %{REQUEST_FILENAME} !-f [NC]
   RewriteCond %{REQUEST_FILENAME} !-d [NC]
   RewriteRule ^(.*)$ http://blog.massanti.com/$1 [R=301,L]
</ifmodule>

Let’s analyze this:

  • The ifmodule encapsulation is self explanatory, it basically means “do whatever you find inside me only if the mod_rewrite module is enabled”.
  • The first RewriteCond line takes whatever url parameter we get and checks if a real file exists, while the 2nd line does the same, but for directories.
  • The “[NC]” bit in each of the conditions tells mod_rewrite to ignore casing.
  • The RewriteRule line will only execute IF ANY of the 2 RewriteCond conditions is TRUE (if no real file and no real directory is found in the file system matching the URL request), AND if that happens, it will redirect the client’s browser or search engine to the new page (blog.massanti.com/ + the requested URL) and it will send a 301 permanent redirect header, telling the browser and search engines that the redirection is permanent, hence, causing most search engines, browsers and RSS readers to automatically update all the URL’s to the new ones.