# Encoding mp4's to play on android phones

**URL:** <https://boards.straightdope.com/t/encoding-mp4s-to-play-on-android-phones/596909>\
**Category:** Factual Questions\
**Created:** [September 20, 2011, 4:52am UTC](https://boards.straightdope.com/t/encoding-mp4s-to-play-on-android-phones/596909 "2011-09-20T04:52:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnClay](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@JohnClay](https://boards.straightdope.com/u/JohnClay)\
**Post date:** [September 20, 2011, 4:52am UTC](https://boards.straightdope.com/t/encoding-mp4s-to-play-on-android-phones/596909/1 "2011-09-20T04:52:20Z")

</div>

Hi,  
I’m working on a project that needs video to be playable on android phones. I’d rather fix the video format than make the user download other video playing software.

Here are videos that work:  
[http://www.archive.org/details/more\_animation](http://www.archive.org/details/more_animation)

The 512kbps video (424x240) works:

The other MPEG4 video (480x272) doesn’t work…

This one also works: (480x270)  
[http://mediaelementjs.com/media/echo-hereweare.mp4](http://mediaelementjs.com/media/echo-hereweare.mp4)

I’m using VidCoder and Handbrake to encode the videos and have researched a lot about them. I’ve tried resizing the videos to the sizes that work but it doesn’t work.

The android phone says:  
“Sorry, this video cannot be played.”

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [September 20, 2011, 6:01am UTC](https://boards.straightdope.com/t/encoding-mp4s-to-play-on-android-phones/596909/2 "2011-09-20T06:01:47Z")

</div>

It may be that the problematic one has different compression or keyframe settings, or some such. There’s a free utility you can get called gspot that will allow you to scrutinise the codec and settings used for a video that works - you should then be able to replicate those settings when you transcode the problem file.\_

---

<div class="post-metadata">

**Author:** ![phaemon](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@phaemon](https://boards.straightdope.com/u/phaemon)\
**Post date:** [September 20, 2011, 11:16am UTC](https://boards.straightdope.com/t/encoding-mp4s-to-play-on-android-phones/596909/3 "2011-09-20T11:16:16Z")

</div>

> [@JohnClay](#):
>
> The 512kbps video (424x240) works:  
> [The Lost Kitten 1938 : Fleischer Studios : Free Download, Borrow, and Streaming : Internet Archive](http://www.archive.org/details/PudgyAndTheLostKitten1938)
> 
> The other MPEG4 video (480x272) doesn’t work…

The 512k video (the one that works), the video stream uses the h264 codec.

The other one (that doesn’t work) uses the MPEG4 video codec.

It might just be that. Are you using a Mac? If so, it may be better for you to use ffmpeg directly from the command line rather than via HandBrake.

---

<div class="post-metadata">

**Author:** ![JohnClay](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@JohnClay](https://boards.straightdope.com/u/JohnClay)\
**Post date:** [September 22, 2011, 8:49am UTC](https://boards.straightdope.com/t/encoding-mp4s-to-play-on-android-phones/596909/4 "2011-09-22T08:49:41Z")

</div>

I don’t have access to an android phone at the moment, but I do have access to android emulators which are part of the android SDK. The videos that worked originally on the phone also work (well the audio does) and the ones that didn’t work don’t work on the emulator. I found this:

> **[Supported media formats  |  Android Developers](https://developer.android.com/guide/topics/media/platform/supported-formats)**

It says “For 3GPP and MPEG-4 containers, the moov atom must precede any mdat atoms.”

I found that this can be done using mp4box… the command is:  
mp4box -hint filename.mp4  
Then the videos started working on the emulator (well the audio did at least).

---

<div class="post-metadata">

**Author:** ![Lips\_Obsession](https://avatars.discourse-cdn.com/v4/letter/l/bbce88/32.png) [@Lips\_Obsession](https://boards.straightdope.com/u/Lips_Obsession)\
**Post date:** [September 23, 2011, 3:30pm UTC](https://boards.straightdope.com/t/encoding-mp4s-to-play-on-android-phones/596909/5 "2011-09-23T15:30:30Z")

</div>

I know when I recode video for my Android phone I have to use the H.264 codec in a MP4 container, and put it to a specific screen resolution (384x288). I use Oxelon for conversion.
