« Bounty for Flash9 in Opera in FreeBSD | Main | It's 2008. 1 TB disk drives cost $160. Quotas are 32-bit. »

March 07, 2008

High Definition Content Playback on the Intel Mac Mini

One of the FAQs regarding the current Intel Mac Minis is "will it play HD video", or "will it play 1080p video".  The answers have been all over the place, from emphatic "yes" and "no" answers to hazy "maybes" with few real details.

It's important to have a good answer to this question because many, many people are interested in the Mac Mini as a HTPC.  There is little value, however, in spending time and money on a platform if it isn't powerful enough to run ALL high definition content that one might encounter.

In this post I will discuss how to measure high-definition playback in a useful way, what problems people are currently having with high definition playback, and why the current Mac Mini is probably fast enough to handle all currently available high definition content.

First, it is not useful to ask if a device can play "HD" or "1080p".  A high definition clip can be anything from 480p to 1080p.  Further, even if one does specify a resolution: "my 1.8ghz mini can play 1080p", it tells us nothing about how difficult decoding the clip really is.  There are many, many 1080i files floating around with extremely low (<4 mbps) bitrates.  Likewise, there are many 720p files with 10mbps bitrates.  Just because your Mac Mini can play a bitrate starved DirecTV rip you got from Usenet does not mean your Mac Mini "can play HD".

Finally, the format used can dramatically affect playback performance.  MPEG-2 is not very CPU intensive to play back, whereas h.264 is extremely CPU intensive to play back.

At the very least, when discussing video files, we should specify encoding format, resolution, and bitrate.  My favorite way to compare the details of video files is to run the 'midentify' script that is part of the mplayer package.  This script outputs details like this:

ID_FILENAME=Name.Of.Movie.50Hz.MyHD.ts
ID_DEMUXER=mpegts
ID_VIDEO_FORMAT=0x10000002
ID_VIDEO_BITRATE=17500000
ID_VIDEO_WIDTH=1920
ID_VIDEO_HEIGHT=1080
ID_VIDEO_FPS=25.000
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_CODEC=a52
ID_AUDIO_FORMAT=8192
ID_AUDIO_BITRATE=384000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_LENGTH=6760.88
ID_VIDEO_CODEC=mpegpes

In this example, we have a MPEG file with a 1920x1080 resolution and a bitrate of 17.5mbps.

If you learn nothing else from this post, I would like you to understand that it is a waste of time to compare playback quality and speed if you don't have at least those three metrics.

With that in mind, how well does the Mac Mini play back high definition content ?  The answer is, very, very well.  The problem is that, for most of the lifecycle of the Intel Mac Mini, most playback software has NOT been multi-core aware.  For instance, until recently, release versions of VLC did not use multiple CPU cores for h.264 playback.  Even now, with the 0.8.6e release, a 1920x1080 h.264 file with a (variable) bitrate of 11-30mbps, is rarely using more than 60% of each core of a 2.0ghz core2duo.  Most of the time it is below 50% on each core.

The current version (0.1.5) of OSXBMC performs much better.  Whereas playing the above clip is impossible with VLC (which could lead a user to conclude the Mac Mini is not powerful enough to play such a clip) it plays quite nicely in OSXBMC.

I am not trying to highlight one player software over another.  What I am trying to highlight is that previous failures to play high definition content on the Mac Mini by the many people that have tried are mostly due to inefficient players.  The actual hardware itself is most certainly capable of playing the most difficult of video files.  This situation is improving daily.  VLC, OSXBMC, and the ffmpeg component of OSXBMC are all being constantly updated - further streamlining and optimizing the decoding h.264 and other difficult video files.

Things are not perfect yet.  The worst case scenario in the world of difficult video files is probably a 40mbps, 1920x1080 h.264 encoding of the "bird scene" in Planet Earth:

<kozubik> elan_osx : you know those frame drop numbers you have on the .5 relnotes, RE: bird scene ?
<elan_osx> yep
<kozubik> elan_osx : any idea what % drop that was ?
<elan_osx> pretty damn high
<elan_osx> it wasn't completely unwatchable, but it was pretty bad

However, only 1.5 of the 2 CPU cores were ever fully utilized during that test.  So at the time of this writing, there is (roughly) 30% more decoding performance available, given the right thread optimization.  Further, this assumes that no improvements are made in the decoding algorithms themselves - only improvements in their thread handling.  I personally do not have any clips as difficult as this one, and thus I am fairly close to 100% success at "1080p HD" playback - even with very high bitrate 1080p h.264 files.

In conclusion, I believe the 2.0ghz core2duo Mac Mini is capable of playing all modern high definition files that one could reasonably encounter, circa 2008.  Currently, OSXBMC, with ffmpeg underneath, seems to be the best decoder, but I am sure VLC will catch up eventually.  When all is said and done, I feel confident that even the "bird scene" will be made watchable, provided that final 50% of a core can be utilized and some additional optimizations are made by the ffmpeg developers.  At that point you will be very hard pressed to find any video files that the 2.0ghz core2duo Mac Mini cannot play.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e54fba2851883400e5507a88148834

Listed below are links to weblogs that reference High Definition Content Playback on the Intel Mac Mini:

Comments

I have been wanting to get a mac mini for this sole purpose and I have been a little worried about some of my 1080p HD content that was around 12 - 15 Mbps; but thanks to you I don't have to worry any longer. Thanks alot for providing what will surely be the final word on can a mac mini be used as a HD HTPC.

Really great post, thank you. I'd like to translate to spanish and post it in my HTPC blog.

Please feel free to translate this and post it in your HTPC blog.

Thank you very much

Just want to say thanks for an awesome read, and a clear concise explanation of the issues affecting mac owners, HTPC users, and HD content. I actually have a macbook, but from what I can gather, the hardware is pretty similar.

Most of the HD content I watch is 4.5 or 8.5 GB h.264 rips of Blu-Ray or HD DVD discs. These are extremely popular on usenet and on private torrents, I would say they are a benchmark. I have an e6300 CPU overclocked from 1.86 up to 2.8Ghz. I am on XP but maybe I will have to put osx86 on the box to find out for sure. My experience is vlc and mplayer using ffdshow simply cannot play the h.264 mkv files without drastic stuttering and loss of audio sync. Nor can they play the 16GB 1080i .ts files. So I am skeptical that a 1.8 or 2.0 Ghz laptop CPU in an Apple mac (mini/ iMac/ laptop, all use the same CPUs) can handle the 1080p that in my experience is a standard. But if you insist I will install osx86 on this hardware and run a test. My other concern is the prejudice in the open source community against coreAVC. Why do they demonize and fight this codec, is it evil because it costs $8? Are they just jealous because it is 2x as fast as any open source codec, but oh yeah, any day now ffdshow will magically double in performance and any day now there will be a 3Ghz mac mini, I am tired of the lies and rationalizations. Anyway, the linux port of mplayer made some accomodation for compiling in a way to integrate an outboard coreAVC codec. It would also allow older macs to play 1080p. I strongly hope this can be integrated into osxbmc.

First, please note the appeal in the original post to be more specific about your clips. Don't tell us "it's 1080p" - tell us the bitrate as well.

BD and HD DVD rips are all over the place in terms of bitrate, as can be seen from this chart:

http://forum.blu-ray.com/showthread.php?t=3338

When you do your tests with osx86, please monitor your core usage. Release versions of VLC may still be single-core, which will lead (of course) to very poor performanc
e. OSXBMC is multi core aware, and I suggest you test with the latest version of that.

I have no comments on a CoreAVC conspiracy. If it could be made to work with OSXBMC, I would happily pay $8 for it. I will ask Elan if that is possible.

Let us know how your tests go, with specific bitrates and specific core usage measurements.

Running under the dreaded linux (as I still havent ported DVB-S/T device drivers to fbsd yet), I can playback 1080i MPEG 4 AVC content (from BBC HD, bitrate ~ 20Mbps) with mplayer with a few options:

mplayer -vo xv -ao alsa -a52drc 1 -cache 65536 -lavdopts threads=2 -vf pp=fd

CPU usage is high, but I dont get any dropped frames.

It also plays back those 'scene' 1080p rips (or samples thereof) just fine. This should be quite similar to a mac mini: 2.4 GHz core 2 duo, intel onboard graphics.

All normal if you using Plex http://www.plexapp.com/
or mplayer -sws 0 -lavdopts threads=2:fast=1:skiploopfilter=noref
http://mplayerosx.sttz.ch/

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment