How to encode video for mobile use

The bad news first. There are hundreds of mobile devices out there, and it’s basically impossible to support 100.0% of them.

The good news is that mobile devices are getting better. Gone are the days when 176×144 3GP was synonymous with mobile video. Modern smartphones can actually play high quality video, and smartphone use is increasing. That’s not to say that 3GP is over, or that everyone has a smartphone. But smartphone use is growing (at a 64% annualized rate as of Q2 2010), and, not surprisingly, smartphone users are more likely to watch video on their phones than their, er, dumb-phone-using friends.

So if you want to support 90%+ of mobile devices, you need at least two video types: 3GP + MPEG-4 for less sophisticated devices, and H.264 + MP4 for smartphones.

That’s good news, really. One output video can cover all of your smartphone users – iPhone/iPad/iPod, Android, and (for the most part) Blackberry too. Toss in PSP, PS3, and Xbox 360 for good measure.  (If you want to learn more about encoding for iOS specifically, check out our comprehensive iOS encoding guide.)

Of course, while one universal smartphone output can take care of most smartphone users, you can do better with multiple mobile outputs. For example, the iPad has a native resolution of 1024×768, fully five times higher than the 480×320 on earlier iPhones. So if you encode your video at 480×320, you’ll be missing out on the near-high-def capabilities of the iPad.

Fortunately, you can target mobile devices well using a handful of standard encoding profiles. Start with the Universal Smartphone Profile for wide compatibility; add in an Advanced Smartphone Profile version for the more advanced devices; and round out your mobile list with a legacy profile for widest compatibility – either our Legacy Smartphone Profile (below), or even a 3GP video for even wider compatibility.

Note that the following defaults are the starting point for these profiles. Zencoder uses these settings by default, but you can replicate them easily enough in whatever encoding tool you’re using.

Defaults:

Video: H.264, Level 3.0, Baseline profile
Audio: AAC, 1-2 channels

1. Universal Smartphone Profile

This is a great starting profile for wide compatibility with modern smartphones. Plays on just about everything, though it doesn’t take advantage of the higher resolutions and codec complexity possible on the newest crop of devices.

Plays on:

iOS: iPhone, iPad, Apple TV, iPod Touch, iPod Classic, iPod 5.5G
Blackberry: Bold 9000, Curve 8910, 8900, 8520, Pearl 9XXX, Storm, Storm 2, Torch, Tour, Bold 9650 + 9700
Android: All (?)
Other: PSP (3.30+), PS3, Xbox 360, web

Doesn’t play on:

iPod 5G, PSP (pre-3.30), Blackberry Curve 9330, 9300, 8530, 83XX, Pearl 8XXX, 88XX

Settings:

Defaults, plus:

audio_bitrate: 128 (or less)
audio_sample_rate: 44100 (or less)
size: 480×320
max_frame_rate: 30
video_bitrate: 1500 (or less)

1b. Universal Smartphone Profile B: higher resolution

This profile plays better on iPhone 4g, iPad, Apple TV, new iPod Touch, Droid, PS3, and Xbox, by increasing the video resolution. The extra pixels are wasted on older iPhones though, and make for a video that won’t play on Blackberry and some Android phones.

Plays on:

Everything above, minus Blackberry and maybe weaker Android devices

Settings:

Universal Smartphone Profile (above), plus:

size: 640×480

2. Advanced Smartphone Profile

Newer iOS devices allow higher resolutions and higher encoding complexity (which means better compression). In particular, iPad and Apple TV users shouldn’t have to watch 480×320 video on their beautiful screens, so it makes sense to provide a higher quality version if you want to provide a good experience to these users.

Plays on:

iOS: iPhone 4G, iPad, Apple TV*, newer iPod Touch
Android: Nexus One, Droid, maybe others. (YMMV on these, though. Some users report trouble with 720p video.)
Other: PS3, web

Doesn’t play on:

iOS: iPod 5G/5.5G/Classic, iPhone 3GS and before, older iPod Touch PSP, old Apple TV*
Blackberry: all
Android: others
Other: PSP, PS3, Xbox 360, web

Settings:

Defaults, plus:

h264_profile: main
h264_level: 3.1
audio_bitrate: 160 (or less)
audio_sample_rate: 48000
size: 1280×720 (max) or 960×640 (iPhone 4 native)
max_frame_rate: 30
video_bitrate: 5000 (or less)

*2b. Advanced Smartphone Profile B: with old Apple TV compatibility

To support older Apple TV devices, use the Advanced Smartphone Profile setting, plus one of the following:

Settings:

Advanced Smartphone Profile (above), plus either one of the following:

size: 960×540

OR

max_frame_rate: 24

3. Legacy Smartphone Profile

This profile plays on the last major set of H.264-based mobile devices: notably, older iPods and some Blackberries. The tradeoff is significantly smaller video: 320×240, at no more than 768kbps.

Plays on:

Everything above, plus: iPod 5G, PSP (pre 3.30), Blackberry Curve 9330, 9300, 8530, 83XX, Pearl 8XXX, 88XX

Settings:

Defaults, plus:

audio_bitrate: 128 (or less)
audio_sample_rate: 44100 (or less)
size: 320×240
max_frame_rate: 30
video_bitrate: 768 (or less)
h264_level: 1.3

4. Legacy 3GP Profile A and B

Finally, a 3GP profile or two will extend support to many remaining mobile devices.

Notably, you can use these on most of the same devices supported above under the Legacy Smartphone Profile. So if you’re encoding a 3GP video at 320×240, you might not need to encode another H.264 video at 320×240.

Note that 3GP video support is still in beta at Zencoder.

Finally, note that these videos will look terrible, but that’s the cost of supporting 3GP phones.

Plays on:

Hard to say. There are thousands of types of 3GP devices, and each one is a little different. Consider these a starting point.

Profile A

format: 3gp
video_codec: mpeg4
size: 320×240
aspect_mode: pad
frame_rate: 15
upscale: true
video_bitrate: 192
bitrate_cap: 192
audio_bitrate: 24
audio_channels: 1
audio_sample_rate: 16000

Profile B

format: 3gp
video_codec: mpeg4
size: 176×144
aspect_mode: pad
frame_rate: 5
upscale: true
video_bitrate: 52
bitrate_cap: 58
buffer_size: 16
audio_bitrate: 16
audio_channels: 1
audio_sample_rate: 16000

Summary

If you want to create mobile video, start with the Universal Smartphone Profile. For better quality, supplement this with Advanced Smartphone Profile video. For wider compatibility, add a Legacy profile or two using either MP4 or 3GP. That’s it. It only takes 1-3 profiles to support most mobile devices.

Edits

Older iPhone/iPod devices ask for the “H.264 Baseline Low Complexity” profile. “Low Complexity” isn’t actually a H.264 standard – it actually just means “only 1 reference frame”. The jury is out on how much Apple devices really enforce this, but for true compatibility, you should probably use Baseline profile and limit reference frames to 1. You can do this at Zencoder with the new h264_reference_frames setting.

November 23: A few people have asked about Palm Pre video. The published specs for Palm Pre are very similar to other smartphones: 480×320 native resolution (with 640×480 supported); H.264, H.263, or MPEG-4 video; MP3 and AAC audio (along with a few other codecs). If these specs are accurate and comprehensive, then the Universal and the Legacy profiles above should work on Palm Pre. I don’t have easy access to a Pre, so if anyone wants to test this for us, we’d be happy to give you some free encoding at Zencoder to use for testing. Get in touch if you want to help out.

January 24: In order to deliver 3GP video as an RTMP stream it needs to be “hinted”. Add "hint": 1 to your API request to enable it.

  • Rudy444

    Which of these profiles will Flash play? On desktops or mobile? What is “play's on web”?

  • Rudy444

    Which of these profiles will Flash play? On desktops or mobile? What is “play's on web”?

  • jondahl

    Flash will play just about any MP4/H.264/AAC-encoded video. So any of these H.264 videos should play in Flash.

    The same is true for HTML5 video in browsers that support MP4 (Safari, Chrome, and IE9). These MP4/H.264 profiles should play natively in these browsers too.

  • http://zencoder.com Jon Dahl

    Flash will play just about any MP4/H.264/AAC-encoded video. So any of these H.264 videos should play in Flash.

    The same is true for HTML5 video in browsers that support MP4 (Safari, Chrome, and IE9). These MP4/H.264 profiles should play natively in these browsers too.

    We're working on another, similar guide for HTML5 video, so watch for that soon!

  • Rudy444

    Which of these profiles will Flash play? On desktops or mobile? What is “play’s on web”?

  • http://zencoder.com Jon Dahl

    Flash will play just about any MP4/H.264/AAC-encoded video. So any of these H.264 videos should play in Flash.The same is true for HTML5 video in browsers that support MP4 (Safari, Chrome, and IE9). These MP4/H.264 profiles should play natively in these browsers too.

    We’re working on another, similar guide for HTML5 video, so watch for that soon!

  • Blu

    Or just buy an N900 and ignore the entire contents of this blog posting.

  • Blu

    Or just buy an N900 and ignore the entire contents of this blog posting.

  • jondahl

    Of course, if you're publishing content for others, you'd have to convince your entire audience to switch to a N900. :)

  • http://zencoder.com Jon Dahl

    Of course, if you're publishing content for others, you'd have to convince your entire audience to switch to a N900. :)

  • Blu

    Or just buy an N900 and ignore the entire contents of this blog posting.

  • http://zencoder.com Jon Dahl

    Of course, if you’re publishing content for others, you’d have to convince your entire audience to switch to a N900. :)

  • akshay2000

    Seems to have forgotten super-smart phones ,i.e., Pocket PCs. Perhaps those were the ones to give smartphone concept. I don't see HTC HD2 anywhere!

  • akshay2000

    Seems to have forgotten super-smart phones ,i.e., Pocket PCs. Perhaps those were the ones to give smartphone concept. I don't see HTC HD2 anywhere!

  • Anonymous

    Seems to have forgotten super-smart phones ,i.e., Pocket PCs. Perhaps those were the ones to give smartphone concept. I don’t see HTC HD2 anywhere!

  • Evennevel

    You are soo not a developer! :P

  • Evennevel

    You are soo not a developer! :P

  • Evennevel

    So. If I add a src element under the “full size play for web” src elements (854×480 H.264 and Ogg Vorbis(for firefox)) encoded as the universal smartphone experience in a <video> element, I'd be safe? and if I wanted to add the advanced smartphone version, I'd put that in between right? So the biggest movie files are first?</video>

  • Evennevel

    So. If I add a src element under the “full size play for web” src elements (854×480 H.264 and Ogg Vorbis(for firefox)) encoded as the universal smartphone experience in a <video> element, I'd be safe? and if I wanted to add the advanced smartphone version, I'd put that in between right? So the biggest movie files are first?</video>

  • Evennevel

    Uh, writing out the video element made an automatic closing element at the end of my post after I posted it.. :S

  • Evennevel

    Uh, writing out the video element made an automatic closing element at the end of my post after I posted it.. :S

  • Evennevel

    You are soo not a developer! :P

  • Evennevel

    So. If I add a src element under the “full size play for web” src elements (854×480 H.264 and Ogg Vorbis(for firefox)) encoded as the universal smartphone experience in a element, I’d be safe? and if I wanted to add the advanced smartphone version, I’d put that in between right? So the biggest movie files are first?

  • Evennevel

    Uh, writing out the video element made an automatic closing element at the end of my post after I posted it.. :S

  • jondahl

    Hi Evennevel. It's a little more complicated than that, unfortunately. HTML5 (as far as I'm aware) won't automatically switch between high quality and low quality versions of the same format. So the first MP4 file will get picked up automatically by any browser that will play MP4. For what you want, you'd likely have to use Javascript to switch between the two, or let the user decide which to do.

    Check out a HTML5 video player like http://videojs.com for help managing different versions, degrading gracefully, etc.

  • http://zencoder.com Jon Dahl

    Hi Evennevel. It's a little more complicated than that, unfortunately. HTML5 (as far as I'm aware) won't automatically switch between high quality and low quality versions of the same format. So the first MP4 file will get picked up automatically by any browser that will play MP4. For what you want, you'd likely have to use Javascript to switch between the two, or let the user decide which to do.

    Check out a HTML5 video player like http://videojs.com for help managing different versions, degrading gracefully, etc.

  • http://zencoder.com Jon Dahl

    Hi Evennevel. It’s a little more complicated than that, unfortunately. HTML5 (as far as I’m aware) won’t automatically switch between high quality and low quality versions of the same format. So the first MP4 file will get picked up automatically by any browser that will play MP4. For what you want, you’d likely have to use Javascript to switch between the two, or let the user decide which to do.

    Check out a HTML5 video player like http://videojs.com for help managing different versions, degrading gracefully, etc.

  • http://zencoder.com/encoder-blog/2010/10/06/how-many-formats-do-i-need-for-html5-video/ How many formats do I need for HTML5 video? « Zencoder Blog

    [...] For full details, check out our recent post on encoding video for mobile use. [...]

  • Josh_Anderson

    I am confused as to why you recommend 1500 and 5000kbps?

    In my mind any video you encode for phone should be targeted at under 500kbps… the lower you can get away with the better.

    Can you imagine trying to load a 5000kbps video of any significant length (a minute or more) over a 500kbps 3g connection?

    Loading… Loading… loading… loading – Advanced or not optimized bit rates matter all the time

  • Josh_Anderson

    I am confused as to why you recommend 1500 and 5000kbps?

    In my mind any video you encode for phone should be targeted at under 500kbps… the lower you can get away with the better.

    Can you imagine trying to load a 5000kbps video of any significant length (a minute or more) over a 500kbps 3g connection?

    Loading… Loading… loading… loading – Advanced or not optimized bit rates matter all the time

  • http://nanacast.com Josh Anderson

    I am confused as to why you recommend 1500 and 5000kbps?In my mind any video you encode for phone should be targeted at under 500kbps… the lower you can get away with the better.Can you imagine trying to load a 5000kbps video of any significant length (a minute or more) over a 500kbps 3g connection?Loading… Loading… loading… loading – Advanced or not optimized bit rates matter all the time

  • jondahl

    Hi Josh – those are the max bitrates for these devices. In practice, you should usually use much lower bitrates for performance reasons. But 1500 and 5000 are the published limits, so strictly speaking, these are the numbers that matter for device compatibility.

  • http://zencoder.com Jon Dahl

    Hi Josh – those are the max bitrates for these devices. In practice, you should usually use much lower bitrates for performance reasons. But 1500 and 5000 are the published limits, so strictly speaking, these are the numbers that matter for device compatibility.

  • http://zencoder.com Jon Dahl

    Hi Josh – those are the max bitrates for these devices. In practice, you should usually use much lower bitrates for performance reasons. But 1500 and 5000 are the published limits, so strictly speaking, these are the numbers that matter for device compatibility.

  • Josh_Anderson

    Thanks for replying… that makes more sense now.

    From an optimization standpoint bit rates should be targeted at below the average available connection speed of your target market for web enabled mobile devices to avoid buffering and loading issues.

  • Josh_Anderson

    Thanks for replying… that makes more sense now.

    From an optimization standpoint bit rates should be targeted at below the average available connection speed of your target market for web enabled mobile devices to avoid buffering and loading issues.

  • http://nanacast.com Josh Anderson

    Thanks for replying… that makes more sense now.From an optimization standpoint bit rates should be targeted at below the average available connection speed of your target market for web enabled mobile devices to avoid buffering and loading issues.

  • Indixolutions

    I’ve choosen JWPlayer for my video compatibility strategy. You can switch through different types of encoded videos using javascript (called levels). Which encodings to perform is up to publishers or developers…. and I was looking for this post to get my ideas more clear; thanks!

  • Rajeshwar

    It was very helpful in understanding how to resolve the issues with different mobiles and sizes. I might be asking very dumb question, so excuse me for that. I would like to know how do you determine the video to be played on a particular mobile. Will you get the screen resolution and choose the video profile or is there any alternate way to determine what profile has to be used for which mobile.

  • http://ebluar.com/video-games/psp-accessories.html psp accessories

    Using psp in iphone is really very different experience. And it gives pleasant moments.

  • Tanu_cste10

    wud you plz tell me the maximum resulation and video length support android phn…i tried to programm to display video in android.but the emulator did not play the video.i think the video resulation is high.so i need to know the limited value

  • http://zencoder.com heff

    Actually the android emulator doesn’t work for video. You have to test it on a real phone.

  • http://profiles.google.com/jkoorts Jacques Koorts

    Great post, but when you mention 
    MPEG-4, what part of MPEG-4 are you referring to because 
    MPEG-4 part 14 = MP4.

  • http://profiles.google.com/jkoorts Jacques Koorts

    Great post, but please add the unit to your values. eg. is it 5 hz, 5 bits per second, 5 kilobits per second?

  • http://twitter.com/Duesynapse Düsynapse

    The profiles you mention here are entirely different from the ones that I can select when I create an encoding job.
    I want to use the “Legacy Smartphone Profile” described above. So which one should I choose?
    - mobile/legacy
    - v1/mobile/legacy
    - v2/mobile/legacy

    If these profiles are intended to match the above described profiles, then it would be good to add their names to the post.

  • http://goo.gl/EZfRQ Enterprise Mobile Hub

    Thanks for introducing zencoder! I would like to use it.

  • Anonymous

    Mostly websites in the world not easy to neavigate but I love this website because its very easy to neavigation good work and keep continue provide friendly interface check out more website to provide friendly interface

    bollywood ringtones for iphone-iphone bollywood ringtones-mobiles ringtones-download free ringtones-free iphone ringtones-iphone ringtones-free funny ringtones-english ringtones-funny sms ringtones free-bollywood ringtones-mobile sms tones-funny sms tones-iphone ringtones free-mobile ringtones

blog comments powered by Disqus