Converting .mov to .mp4 Guide

For the past few months, Alex had been providing us with 1080p MP4 HD trailers which you can use to play on your PS3 (PlayStation 3). I thought it’d be neat and in the spirit of this site to provide a guide/tutorial on how he accomplishes the conversion.

Alex has kindly written up a tutorial on how he converts the .mov HD trailers to .mp4 files: Convert .mov to .mp4

He usually uses Quicktime Pro to do the conversion, but since Quicktime Pro isn’t free, he went and searched for a free alternative:

So after a small research, I came across a program called Yamb. Produces the same results as QuickTime Pro… for free!

Alex is also intending to do another tutorial for converting using Quicktime Pro and you can expect that shortly.

We hope you’ll find it useful.

Update:

As a continuation from yesterday’s posted guide, Alex has provided an update on how to use QuickTime Pro for the conversion. The guide is still located at:

Convert .mov to .mp4

Any comments and feedback are welcomed.

New Catalog Urls

I’ve been meaning to do this for some time and that is to use the rewrite engine and have nicer urls for the main site (catalog). Previously, the url would be to something like: http://www.hd-trailers.net/preview.php?id=terminator_salvation

The old url will continue to work and it’ll automatically redirect you to the new url. The new official url will be: http://www.hd-trailers.net/movie/terminator_salvation/

This is all utilizing Apache’s rewrite engine. It took me a while to get a hang of it, but once I remember how to do all the crazy stuff, it wasn’t that bad.

I only needed to add the following lines (assuming RewriteEngine is already on):
RewriteRule ^movie/([^/\.]+)$ /movie/$1/ [R=301,NC]
RewriteRule ^movie/([^/\.]+)/$ /preview.php?id=$1 [NC,L]

I’ve fixed up the code on the main site to point to the new url format. I did hit into issues where references were now broken since I had a previous assumption all my files will be loaded in the base directory, which is no longer true with this url rewrite engine.

If anyone hits into issues (i.e. broken image link) or if something just looks out of the ordinary, please do let us know.

New Theme

I finally upgraded WordPress to 2.6.5 and at the same time I’ve decided to try out a new theme. As you may have noticed, when my post includes a flash video player, it goes beyond the allotted space for the post. So I was already looking for a theme with a wider post area.

Also, I wanted to make future upgrades easier, where I can just drop newer versions of WordPress and themes and not worry about overwriting my changes. Of course there are still going to be little changes here and there to customize the layout, but I had a lot of hacks and changes in the previous theme to enable stuff to work the way I wanted.

Then there was the fact the theme I was currently using was pre-widgets, so I really wanted a theme that supported widgets so I can easily add stuff like Recent Comments or Most Viewed to the sidebar.

I took a look at the Most Popular themes over at WordPress Themes and landed on Green Light. I thought it’d be a nice match for my content.

I customized the header, modified the page bar at the top, and added a few things that were from the old site (i.e. Link to Catalog and Informational Links). So far, I’m really digging the new theme.

I also fixed a few issues I found where it had several W3C compliance issues and the comments link pointed to an anchor that didn’t exist. Otherwise, it’s been great so far. Let me know what you think in the comments.

Gravatar Speaking of comments, it appears this theme pulls your avatar from Gravatar, which is rather neat. So if you don’t want to have a dull gray guy with no face next to your comment, register your email with Gravatar and it’ll automatically pull down your avatar.

Yahoo! HD Trailers Page Format Change

It looks like Yahoo! HD Trailers Page had a slight format change and therefore broke my parser. However, the parser has now been fixed. If you see anything weird, please notify us.

I’ve also made another fix where sometimes multiple Yahoo! trailers would point to the same url. That was due to the caching logic we had. I’ve went ahead and fixed the logic and now urls should always be up-to-date.

I also wrote an array recursive comparison function. There’s probably a bunch in the wild, but I couldn’t find one on php.net:

/// <summary>
/// Does a recursive array comparison
/// </summary>
/// <param name=”array1″>1st array</param>
/// <param name=”array2″>2nd array</param>
/// <returns>if the 2 arrays match</returns>
function array_equals_recursive( $array1, $array2 )
{
    if( count( array_diff_assoc( $array1, $array2 )) != 0 ||
        count( array_diff_assoc( $array2, $array1 ) ) != 0 )
    {
        return false;
    }
   
    foreach( array_keys( $array1 ) as $key )
    {
        if( is_array( $array1[ $key ] ) ||
            is_array( $array2[ $key ] ) )
        {
            if( !is_array( $array1[ $key ] ) ||
                !is_array( $array2[ $key ] ) ||
                !array_equals_recursive(
                    $array1[ $key ],
                    $array2[ $key ] ) )
            {
                return false;
            }
        }
    }
   
    return true;
}

Two New Members to the Team

I’d like to welcome 2 new members to our team: Manjunath and Alex

Awhile back, you may have remembered that I started on a side project that would provide mirroring to the HD trailers I posted. However, that took up too much of my time, and was ultimately abandoned. After that news was posted, Manjunath contacted us expressing interest in continuing to provide mirror links. At first I asked him to post the links in the comment section, but that didn’t really work out that well as Akismet was constantly blocking them, even when I had registered him as a subscriber.

Around the same time, Alex contacted us expressing interest in providing MP4 encodings of the HD trailers that people can use to watch on their Xbox 360 and PlayStation 3.

I needed a way to allow users to modify posts directly without giving them too much power. That’s when I found: Role Manager plugin for WordPress. It had exactly what I needed, specific knobs to enable/disable for particular users.

I have then created a new role: InfoAdder which has the ability to edit others’ published posts and save them. Soon, you’ll be seeing 2 new sets of links:

  • RapidShare Mirror:
  • MP4 Encoded:

Enjoy!

Mirror No More

… or until I find a way to automate it. Mirroring these files are taking more time than I had anticipated. If someone of you are willing to upload to mirrors, we’re more than happy to have you post them in the comments section.

Existing mirror links will not be taken down, but moving forward, you’ll probably notice its absence.

Only in the case where it’s no longer accessible or people are having problems downloading, will I be creating mirror links that appear in the post.

Apple Movie Trailers Layout Change

As some of you have noticed, Apple – Movie Trailers‘ layout has changed and this has broken my parser. The changes aren’t that simple either as they’ve complicated a few things:

  1. Not all trailers are located in /hd anymore
  2. HD trailers can now be mixed in with standard trailers
  3. There’s 2 layouts I’ve noticed so far: single vs multiple trailer mode

I’ve gone ahead and fixed all the source links to point to the main page instead of /hd, but I’m still working on a fix for the parser so it can work for all their layouts. I’m hoping to be able to fix the parser this weekend.

Update: Looks like I got the parser up and working. If you notice any errors or broken links, please do let us know. Thanks!

RapidShare Mirrors

So I’ve gotten requests to add mirroring for the HD trailers for some time, but never found a solution that I like. We can’t host it ourselves since these are large files and would be a huge strain on our bandwidth and given that this is just a hobby of mine, I didn’t have the time, money, nor resources to support mirroring directly.

Our only option was to test out file sharing sites and I had a set of requirements, which previously none had met:

  • At least a 200MB file size cap
  • Remote uploading (pass in URL and have it remotely download it)
  • Free

Most file sharing sites capped the max file size to 100MB. Most 720p and 1080p are between 100-200MB, making it unfeasible to support HD trailers. There are a few that go to 300MB and 1GB, but then they didn’t satisfy the 2nd requirement.

The 2nd requirement is support for remote uploads. I don’t have the time nor bandwidth to download all 3 trailer resolutions first and then upload it afterwards. With remote uploading, I can just pass in an URL and it’ll go fetch and download the trailer.

After a small confrontation yesterday, Alex emails me that RapidShare had recently bumped their maximum file size from 100MB to 200MB. They already supported remote uploads, so this was great news!

I’ve tested out a few and it looks like all new trailers moving forward will have a RapidShare Mirror section. Do note that files are only stored as long as there is activity. After 90 days of inactivity, RapidShare will delete it from their servers.

Unfortunately, the IGN trailers that caused all this commotion doesn’t support remote upload. I may eventually upload those manually.

For those who have played with RapidShare Remote Upload, is there a way to clear all those jobs that have completed without manually deleting them one by one?

Apple Red Band Trailers… GONE?

So some of you may have noticed that Apple recently started releasing Red Band trailers (in contrast to the normal green ones) to signify these were rated R trailers intended for mature audiences.

A day or two ago, TekMan alerted me that the Red Band trailer link for Burn After Reading was broken. I checked and indeed it was and interestingly enough, it was completely removed from Apple’s website.

Today, Matt emails me and tells me the Red Band trailer was broken for Wanted and that piqued my curiosity. I went and checked every single Red Band trailer (there’s been 4 so far) and they were all no longer available. They’re not even available on iTunes anymore.

I went ahead and removed them from the main page, but the blog entries are still around. I still have copies of the 1080p trailers and will probably upload them to some file sharing site sometime soon. If I don’t, someone should ping me.

Anyway, I have no idea if they just expire after some time or if Apple removed them altogether at once. It could be that since it’s rated R for mature audience, they received complaints or what not and decided to no longer support them. If someone knows the real reason, I’d like to know.

Update: The 1080p versions of all 4 Red Band trailers have been reuploaded. See this post for more details.

Upgraded to WordPress 2.5.1

So after many months of WordPress complaining that I should upgrade from 2.3.1, I’ve finally decided to upgrade. What prompted this action was the fact I was trying to do a review on 時をかける少女 (The Girl Who Leapt Through Time) and the stupid blog would convert all my unicode characters to ???????? (question marks).

I have no idea what’s wrong since Krunk4Ever.com runs on the same WordPress version and does unicode fine. I decided to try upgrading to WordPress 2.5.1, but the unicode problem still exist.

Searching online, I found WordPress, Unicode, and ‘?’s and it turns out Krunk4Ever.com’s wp-config.php was so old, it didn’t have the following defined:

define('DB_CHARSET', 'utf8');
define(’DB_COLLATE’, ”);

When I commented that out from HD-Trailer.net’s wp-config.php file, I was able to do unicode, but all my existing blog entries that had non-standard characters now became funky (white question mark inside a black diamond). There didn’t seem to be a simple search and replace where I could fix the problem. The underlying problem appears that when WordPress first created the database, the text data type it set as default was latin1 instead of utf8.

Searching a bit more, I found: Converting Database Character Sets on WordPress.org’s site. So a brief read revealed this is exactly what I wanted. I wanted to convert my existing latin1 text to utf8 text. So I jumped to the solution and start altering tables, which wasn’t as simple as it looks. Those …for all other tables/columns… really gets to you.

Half way through the process, I found that I screwed up. Apparently I was suppose to convert LONGTEXT to LONGBLOB, and not just BLOB. Guess I should’ve read all the instructions first. Thankfully, I had backed up my database as it instructed. And I guess I should’ve scrolled further as under solution was Conversion Scripts and Plugins. Grrrrr.

I installed the UTF-8 Database Converter plugin, read the readme.txt FULLY, activated the plugin and started the conversion. BAM! Everything works now. Even though there were big red warning signs saying this plugin was meant for 2.1-2.2, it worked on 2.3.1 and 2.5.1 w/o any problems.

Back to WordPress 2.5.1. The admin UI has completely changed. It’s definitely prettier, but I dislike the fact that they’ve moved a bunch of stuff I’ve been accustomed to the side (such as categories) to below the post. And since I run on a 1920×1080 resolution monitor, this is leaving about half my screen white, basically wasted space.

However I really appreciate the fact that Save no longer refreshes the page. Same with a bunch of other post editing functions.

Another awesome thing is that plugins now support updating from within the admin panel! No longer do I need to deactivate the plugin, download the plugin, overwrite the existing plugin, and reactivate it. In one click, it now goes fetches the plugin and automatically upgrades it on its own!

I wonder if they’ve supported upgrading WordPress like this yet…

Anyway, if I find anything more interesting, I’ll let you know!

Also, if you see any funky characters, please let me know too. Thanks!