Making MP4 H.264 Videos in Apple Compressor

UPDATE June 2013: This method will work but it’s likely to cause playback problems with Android devices. Android officially only supports up to Baseline profile and it’s hard to control the profile of videos encoded with Compressor. If you’re concerned about Android compatibility, I highly recommend Handbrake.

Unless there’s a specific need for something else, I almost exclusively encode web video using H.264 in an MP4 container. It looks great, and is the most widely compatible format I know. I started doing it mostly because Flash Video players support it without having to re-encode as FLV. Here are the settings I use in Compressor:

Do this on a full-quality “Current Settings” QuickTime movie already exported from Final Cut Pro. Don’t export directly to Compressor from FCP. This is a lot cleaner.

Start with the “QuickTime H.264” preset in the Apple/Formats/QuickTime folder. It might seem wrong, but we’re not going to use the MPEG-4 “File Format” setting. We’ll be working in QuickTime Movie format since we get the most control over compression settings that way.

Drag the preset onto your video to apply it.

Change the Extension setting to mp4. Yes, it’s really that easy. You have to change it here though. You can’t just change your .mov filename to .mp4 after it’s encoded.

UPDATE  August 2012: I used to get invalid public atom errors when I renamed .mov H.264/AAC files to .mp4, but I just had a whole bunch of .mov files otherwise encoded with these settings that I needed to play in a Flash player. Sound played, but no picture. I didn’t have time to re-encode, so I tried just renaming the file and changing the extension to mp4. Picture now plays fine in the Flash player in Firefox, and QuickTime Player can open the files locally with no problem. The .mov extension wasn’t even an issue for the HTML5 player in Chrome.

Next, click on the Video “Settings…” button and use these settings:

You might need to change these based on your needs. I find the sweet spot for quality and file size lives between that Medium and High setting. Some streaming may require you to restrict the data rate. Multi-pass encoding hardly adds any time to the process (the 2nd pass is very quick) so I always leave it on.

Click OK, and move on to the Audio “Settings…” button. Switch the Format over to AAC and you should be fine.

If you have to be stingy with your bits, you can fiddle by going down to Mono or reducing the Target Bit Rate. I’m generally of the opinion that we shouldn’t be too stingy with our bits, so I don’t do that.

Hit OK and move on to Streaming. Change it to “Fast Start”

This lets your video start playing before the file finishes downloading. It’s not streaming, but progressive download; like YouTube. Don’t choose Fast Start – Compressed Header because that will prevent Flash players from taking advantage of the progressive download and won’t really help your file size much.

Frame Controls. Use them if you have the time. It really makes a difference in quality but definitely increases encode time. I usually just switch it on and leave it at the default settings unless I need to deinterlace or change the framerate. In this case I’m only really using the Better Resize Filter.

Finally, do whatever you need to in the Geometry tab to output the resolution you need. Keep the height an even number. Odd numbers freak out the H.264 codec. In this case 720×405 is closer to 16:9, but change it to 404 and everyone will be happier.

Save your custom preset and then submit. Make sure you set up a QuickCluster if you have more than two cores and you’ll get a real speed boost.

Files encoded this way work perfectly with my Video Embed & Thumbnail Generator WordPress Plugin.

13 replies
  1. gfisch
    gfisch says:

    Wow – this is EXACTLY the solution to my problem. I was missing the fast start option in my H264 iPod/iPhone setting. A google search for “h264 fast start compressor” made me find your wonderful tutorial. You made my day (night). Sigh. gfisch

    Reply
  2. Roy Nolan
    Roy Nolan says:

    I loaded my QT file into compressor and that was alright until I checked Inspector
    The 1st page you displayed at the top of this page came up and my movie title was displayed, in the proper place, but all the windows were grey and inactive so I couldn’t make the changes you suggested. What’s the problem?

    Also, my project is in Standard Definition. I don’t have HD. Is that a problem?

    I originally had made an Mp2 file for making DVDs and had loaded this on to my server so that the video could be downloaded by customers. The file was so large 2.63gb [53min] that it took forever. Several friends suggested that I change to an Mp4 file instead to lower the file size. Then one of them referred me to your website.

    Can you help me? And by the way what would be the final file size if I go this way?
    If this works this would really make my day and you would surely be a hero in my world.
    I will be anxiously awaiting your reply
    Thanks
    Roy [[email protected]

    Reply
  3. Hugues
    Hugues says:

    Really doubtful with this, there is a mp4 set up in compressor. Changing the extension as you do, using the h264 don’t make it a mp4. So I wonder if you doN,t mean use the mp4 preset

    Reply
  4. Kyle
    Kyle says:

    @Hugues I wrote this post a year and a half ago and use variations on this preset several times a week. I have yet to encounter a situation in which this doesn’t work. If you find that it doesn’t work for you, please let me know what the application is.

    The MPEG-4 preset in Compressor uses the “MPEG-4” video codec, not H.264, so I definitely do not mean use the MPEG-4 preset, unless for some reason you need to use the MPEG-4 video codec, which I have never needed to do. For web video, H.264 is the preferred video codec, and I prefer to have it an MP4 container rather than an MOV container. That’s what changing the extension does.

    There are Compressor presets for Apple devices such as “H.264 for iPad and iPhone 4” which give similar results, but you get less control over the various encoding options, so I like to use this custom preset.

    Reply
  5. Markus
    Markus says:

    hi,

    nice settings!

    i’m not 100% sure, but i think i’ve sometimes encountered problems in the past when renaming .mov to .mp4 and trying to play them back on a sony bravia tv. still, works most of the time, so maybe i just messed up the encoding settings for the files that didn’t work.

    i never cared about the “frame controls” option for a straight render (and i guess, they don’t matter if you don’t change resolution, timing, interlacing,…), but i definitely have to play around with the “fast start” option.

    one other strange thing i noticed – when resizing a 1080p file to 720p i get a file with 1280×720 (1248×702) in quicktime – what’s with this 1248×702? – some strange aspect ration? – the file works fine so far.

    Reply
  6. ed s
    ed s says:

    hiya

    i just stumbled on this great page and was feeling very hopeful BUT having tried it, i’m still having an issue and wonder if you can shed any light on it?…

    i have a prores 422 (source) file straight out of fcp. it s 1’40” long film and comes out at 1.31gb.

    when i try to open and play it in QT (7 or 10) it won’t play picture, just sound

    however if i open it in mpeg streamclip it plays great

    i need to deliver it with brightcove specs – not surprisingly that’s h264 .mp4

    so naturally i tried exporting from mpeg streamclip as that

    when i do so, the new file still won’t open in QT and when played in mpeg streamclip looks darker and kind of sharpened.

    i’ve tried both the old and new Apple Compressors too and QT7 and a bunch of other things

    any advice??

    ed

    Reply
    • ed s
      ed s says:

      ok.. replying to myself here. i think my MBP was switching graphics cards and (gfx) and a restart has meant that all my earlier various compression attempts DO open in quicktime and look good. your guide is good tho!! sorry to take up space on the blog!!

      Reply
  7. Thomas
    Thomas says:

    With Compressor 4 you can just choose the MPEG-4 Export instead of Quicktime Movie. It now works with H264 (both Main and Baseline). This mp4 files automatically has fast start and the headers are at the beginning.

    Reply

Trackbacks & Pingbacks

  1. […] I highly recommend starting with H.264 video and AAC audio in an MP4 container. If you’re encoding with Handbrake, make sure that “Web Optimized” is checked. Using Apple’s Compressor, the “Streaming” setting should be “Fast Start” (not Fast Start – Compressed Header). I’ve written up my recommended video encode settings in a post on my website. […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply to HuguesCancel reply