Google/HTC Android G1 preset - Official support request

Discuss encoding for devices and presets.
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
rch2
Posts: 22
Joined: Fri Jan 30, 2009 5:33 am

Google/HTC Android G1 preset - Official support request

Post by rch2 »

Hi folks,

I searched the forums and there seems to be several sporadic activities to encode movies in the Google/HTC Android G1 format. Example of the discussion and another example.

I have used Handbrake successfully to convert movies to G1 format. The file sizes in my config are not as good as once I can get with ffmpeg -- probably some suboptimal config issues. Handbrake on Ubuntu Linux is working well for me. I really want to make G1 support "production-worthy". What's most important, I am volunteering to test it on my G1 until works extremely reliably.

Quick G1 specs.
  • H.264: works in "Baseline Profile"
  • Desired resolution: 480 x 320.
  • Desired aspect ratio: 1.5
  • Preferred way to treat "standard" 1.33 resolution: resize to 426x320 (424x320 OK too) and pad with left and right black margins
  • Audio: AAC
  • Container format: mp4.
  • Reportedly, the phone also supports 3GP format, but that's beyond the scope of the current topic.
refulgentis
Bright Spark User
Posts: 342
Joined: Mon Apr 14, 2008 5:08 am

Re: Google/HTC Android G1 preset - Official support request

Post by refulgentis »

rch2 wrote:Hi folks,

I searched the forums and there seems to be several sporadic activities to encode movies in the Google/HTC Android G1 format. Example of the discussion and another example.

I have used Handbrake successfully to convert movies to G1 format. The file sizes in my config are not as good as once I can get with ffmpeg -- probably some suboptimal config issues. Handbrake on Ubuntu Linux is working well for me. I really want to make G1 support "production-worthy". What's most important, I am volunteering to test it on my G1 until works extremely reliably.

Quick G1 specs.
  • H.264: works in "Baseline Profile"
  • Desired resolution: 480 x 320.
  • Desired aspect ratio: 1.5
  • Preferred way to treat "standard" 1.33 resolution: resize to 426x320 (424x320 OK too) and pad with left and right black margins
  • Audio: AAC
  • Container format: mp4.
  • Reportedly, the phone also supports 3GP format, but that's beyond the scope of the current topic.
ffmpeg has suboptimal config issues with x264 -- x264 and ffmpeg developers alike highly recommend using presets as a result of this
is this any different than the iPhone preset? It doesn't seem so to me
rch2
Posts: 22
Joined: Fri Jan 30, 2009 5:33 am

Re: Google/HTC Android G1 preset - Official support request

Post by rch2 »

refulgentis wrote: ffmpeg has suboptimal config issues with x264 -- x264 and ffmpeg developers alike highly recommend using presets as a result of this
is this any different than the iPhone preset? It doesn't seem so to me
Is this any different than the iPhone preset? Who knows -- I am actually proposing a project. For example, the default size for a DVD movie is 480x368 (from 720x576 - why not 480x360 for 4x3 aspect ratio and not 480x384 to preserve the DVD sizes? Not sure). G1 will play video with this resolution, but it scales it to 418(or so)x320 for playback. So, why not define a present to encode in this resolution?
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: Google/HTC Android G1 preset - Official support request

Post by jbrjake »

Because we don't own Android phones and thus cannot test or support encodes for them? There has not been a single time we've offered presets for devices we, the developers, don't personally use, and *not* gotten burned by the experience.
rch2
Posts: 22
Joined: Fri Jan 30, 2009 5:33 am

Re: Google/HTC Android G1 preset - Official support request

Post by rch2 »

I wish I could share one with you, but I can't. I think you fully answered my question.
refulgentis
Bright Spark User
Posts: 342
Joined: Mon Apr 14, 2008 5:08 am

Re: Google/HTC Android G1 preset - Official support request

Post by refulgentis »

rch2 wrote:
refulgentis wrote: ffmpeg has suboptimal config issues with x264 -- x264 and ffmpeg developers alike highly recommend using presets as a result of this
is this any different than the iPhone preset? It doesn't seem so to me
Is this any different than the iPhone preset? Who knows -- I am actually proposing a project. For example, the default size for a DVD movie is 480x368 (from 720x576 - why not 480x360 for 4x3 aspect ratio and not 480x384 to preserve the DVD sizes? Not sure). G1 will play video with this resolution, but it scales it to 418(or so)x320 for playback. So, why not define a present to encode in this resolution?
I should have been more forceful -- this isn't any different from the iPhone preset. There may be additional H.264 features that the G1 supports, but I doubt it. If you can provide any more documentation, we could probably see.
amiliv
Posts: 10
Joined: Sun Sep 09, 2007 5:36 am

Re: Google/HTC Android G1 preset - Official support request

Post by amiliv »

I'm chiming in a bit late in this discussion (was searching for Android), so this may already be the common knowledge.

The iPod hi-rez presets from 0.9.2 do not work on HTC G1 phones. I have some videos encoded using those, and while iPhone displays them perfectly, G1 displays black screen.

Searching the web, I found that G1 might need (at least) no-dct-decimate=1, which is not set by any of the iPod or iPhone presets. Haven't tested this myself yet.

Another thing to note. HTC G1 has hardware h.264 decoder, and it seems all current Android video players are limited to what this hardware decoder supports. In other words, different Android based phones (I found news on Samsung and Motorola working on Android-based phones) may need different presets. I don't think there is any video player that implements decoding of h.264 in software yet.
rch2
Posts: 22
Joined: Fri Jan 30, 2009 5:33 am

Re: Google/HTC Android G1 preset - Official support request

Post by rch2 »

refulgentis wrote: I should have been more forceful -- this isn't any different from the iPhone preset. There may be additional H.264 features that the G1 supports, but I doubt it. If you can provide any more documentation, we could probably see.
It surely took me longer to reply to this, so please accept my apologies.

Here is the (seemingly) most definite set of presets for an Android device. It was recently integrated into MeGUI.

Link: http://forum.doom9.org/showthread.php?t=145137

Code: Select all

<?xml version="1.0"?>

<GenericProfileOfx264Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <Name>Device-Android G1</Name>

  <Settings>

    <EncodingMode>9</EncodingMode>

    <BitrateQuantizer>20</BitrateQuantizer>

    <KeyframeInterval>250</KeyframeInterval>

    <NbBframes>0</NbBframes>

    <MinQuantizer>12</MinQuantizer>

    <MaxQuantizer>51</MaxQuantizer>

    <Turbo>false</Turbo>

    <V4MV>false</V4MV>

    <QPel>false</QPel>

    <Trellis>false</Trellis>

    <CreditsQuantizer>40</CreditsQuantizer>

    <Logfile>.stats</Logfile>

    <VideoName />

    <CustomEncoderOptions />

    <FourCC>0</FourCC>

    <MaxNumberOfPasses>3</MaxNumberOfPasses>

    <NbThreads>0</NbThreads>

    <QuantizerCRF>20.0</QuantizerCRF>

    <EncodeInterlaced>false</EncodeInterlaced>

    <NoDCTDecimate>false</NoDCTDecimate>

    <PSNRCalculation>true</PSNRCalculation>

    <noFastPSkip>false</noFastPSkip>

    <NoiseReduction>0</NoiseReduction>

    <MixedRefs>false</MixedRefs>

    <X264Trellis>0</X264Trellis>

    <NbRefFrames>1</NbRefFrames>

    <AlphaDeblock>1</AlphaDeblock>

    <BetaDeblock>0</BetaDeblock>

    <SubPelRefinement>7</SubPelRefinement>

    <MaxQuantDelta>4</MaxQuantDelta>

    <TempQuantBlur>0</TempQuantBlur>

    <BframePredictionMode>0</BframePredictionMode>

    <VBVBufferSize>2500</VBVBufferSize>

    <VBVMaxBitrate>2500</VBVMaxBitrate>

    <METype>2</METype>

    <MERange>12</MERange>

    <MinGOPSize>25</MinGOPSize>

    <Profile>0</Profile>

    <Level>7</Level>

    <IPFactor>1.4</IPFactor>

    <PBFactor>1.3</PBFactor>

    <ChromaQPOffset>0</ChromaQPOffset>

    <VBVInitialBuffer>0.9</VBVInitialBuffer>

    <BitrateVariance>1.0</BitrateVariance>

    <QuantCompression>0.6</QuantCompression>

    <TempComplexityBlur>20</TempComplexityBlur>

    <TempQuanBlurCC>0.5</TempQuanBlurCC>

    <SCDSensitivity>40</SCDSensitivity>

    <BframeBias>0</BframeBias>

    <PsyRDO>1.0</PsyRDO>

    <PsyTrellis>0</PsyTrellis>

    <Deblock>true</Deblock>

    <Cabac>false</Cabac>

    <WeightedBPrediction>false</WeightedBPrediction>

    <NewAdaptiveBFrames>1</NewAdaptiveBFrames>

    <BFramePyramid>false</BFramePyramid>

    <ChromaME>true</ChromaME>

    <MacroBlockOptions>2</MacroBlockOptions>

    <P8x8mv>true</P8x8mv>

    <B8x8mv>true</B8x8mv>

    <I4x4mv>true</I4x4mv>

    <I8x8mv>false</I8x8mv>

    <P4x4mv>false</P4x4mv>

    <AdaptiveDCT>false</AdaptiveDCT>

    <SSIMCalculation>true</SSIMCalculation>

    <Lossless>false</Lossless>

    <QuantizerMatrix>Flat (none)</QuantizerMatrix>

    <QuantizerMatrixType>0</QuantizerMatrixType>

    <DeadZoneInter>21</DeadZoneInter>

    <DeadZoneIntra>11</DeadZoneIntra>

    <AQmode>1</AQmode>

    <AQstrength>1.0</AQstrength>

  </Settings>

</GenericProfileOfx264Settings>
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: Google/HTC Android G1 preset - Official support request

Post by jbrjake »

(Perfect example of why we don't support user-provided presets for devices none of us own.)
amiliv wrote:I found that G1 might need (at least) no-dct-decimate=1
rch2 wrote: Here is the (seemingly) most definite set of presets for an Android device.

snip

<NoDCTDecimate>false</NoDCTDecimate>
rch2
Posts: 22
Joined: Fri Jan 30, 2009 5:33 am

Re: Google/HTC Android G1 preset - Official support request

Post by rch2 »

Don't appreciate the sarcasm. I would be glad to personally test the configurations that you are concerned about. The problem that amiliv found might have existed with the older version of Android, but it's no longer present. With Android Cupcake on my device, I can play movies with DCT decimate just fine, so the flags are actually right.

Android, just like most baseline profile hardware decoders, can't digest CABAC, B-frames and 8x8 DCT Spatial Transform.
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: Google/HTC Android G1 preset - Official support request

Post by TedJ »

Sorry, but I don't believe that was sarcasm. Without access to hardware to test on, we're dependent on user reports and/or google to determine compatible settings. This information is often out of date, if not downright contradictory. We have been bitten by this on several occasions now, so you can understand us being a little shy.

Nobody has any objection to the community at large creating presets for the HTC G1, we're just a little leery about making it an "official" preset. Considering that we're currently working on preset export/import functionality this may not be a major issue.
amiliv
Posts: 10
Joined: Sun Sep 09, 2007 5:36 am

Re: Google/HTC Android G1 preset - Official support request

Post by amiliv »

This evening I finally had some time to actually make few tests on HTC G1 (I did indicate in my previous post that the info was what I gathered from the web, not what I tested myself).

The "iPhone & iPod Touch" preset worked just fine on my G1. Which is great news. It might be that no-dct-decimate was needed in older versions of software, but does not seem to be the case anymore.

The old "iPod Legacy" preset does not work at all on my G1. I even attempted few variations (checking/unchecking various options, changing bitrate), but no luck. Which was a bit disappointing (640x480 at 1500 kbps is acceptable compromise for both portable devices and not-too-large TV screen). I don't know if this is due to hardware limitations of HTC G1/G2 or Android OS. Wherever limitation is coming from, I hope it will be lifted either in one of upcoming Android based phones and/or the OS itself. Or, who knows, maybe it was just me not hitting the right buttons in Handbrake 8-)
rch2
Posts: 22
Joined: Fri Jan 30, 2009 5:33 am

Re: Google/HTC Android G1 preset - Official support request

Post by rch2 »

Thank you all for your response.

@TedJ: Import/export of presets is a good compromise it seems.

@amiliv: Android screen is 480x320. The hardware decoder does not display anything bigger than 480x352 (which it scales down during playback). IMHO the ideal size for the 4:3 video on Android is 432x320.
amiliv
Posts: 10
Joined: Sun Sep 09, 2007 5:36 am

Re: Google/HTC Android G1 preset - Official support request

Post by amiliv »

rch2 wrote:Android screen is 480x320. The hardware decoder does not display anything bigger than 480x352 (which it scales down during playback). IMHO the ideal size for the 4:3 video on Android is 432x320.
In case of Android, you should really reference hardware if you speak about "ideal resolution". Google makes only Android OS, not the hardware. AFAIK, there's nothing preventing cell phone manufacturers (you know, companies like HTC, Motorola, Samsung, etc) to make new Android-based device with different screen pixel count or aspect ratio. Even in the case of iPhone, while Apple so far kept screen resolution unchanged, I'm not sure if it's set in stone.

Optimizing resolution of video to match hardware to the last pixel is kind of pointless exercise, unless you want to re-encode all of your videos every so often. It makes more sense to say "OK, for sharp image I need this many DPI, mobile devices are about this size (give or take few inches), so this resolution should look crisp on all of them". In that light, there's really no need for special HTC G1/G2 profile. Or even an special iPhone profile. I think there should be few generic "mobile devices" profiles (say with 320, 480 and 640 horizontal resolutions), and comments may include list of devices they were tested with or known not to work with.

The reason I was disappointed with G1 not being able to play back videos that are up to 640x480 was simply because iPhone was able to play them back. While resolution was a bit of an overkill for an iPhone (which supports it only so that people can watch content from iTunes Store), it looked OK on my not-too-big TV screen. So it used to be perfect choice for me (I've 16GB iPhone, so I wasn't much concerned with larger file sizes). Now that I'm thinking about switching to one of Android based phones, I'm faced with having to re-encode a bunch of stuff.
Only Loki
Posts: 1
Joined: Thu Oct 01, 2009 8:03 pm

Re: Google/HTC Android G1 preset - Official support request

Post by Only Loki »

amiliv wrote:
rch2 wrote:Android screen is 480x320. The hardware decoder does not display anything bigger than 480x352 (which it scales down during playback). IMHO the ideal size for the 4:3 video on Android is 432x320.
In case of Android, you should really reference hardware if you speak about "ideal resolution". Google makes only Android OS, not the hardware. AFAIK, there's nothing preventing cell phone manufacturers (you know, companies like HTC, Motorola, Samsung, etc) to make new Android-based device with different screen pixel count or aspect ratio. Even in the case of iPhone, while Apple so far kept screen resolution unchanged, I'm not sure if it's set in stone.
Actually you both are half right and half wrong. Android as an operating system can only display 480x320 that is why the hardware thus far only supports that size, but supposedly when 2.0 (eclair) comes out higher resolutions should be supported.
Last edited by TedJ on Thu Oct 01, 2009 11:19 pm, edited 1 time in total.
Reason: Fixed munged quote blocks
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: Google/HTC Android G1 preset - Official support request

Post by TedJ »

I believe that support for different resolutions besides HVGA is being rolled out with the 1.6 "Donut" build as we speak.
tlunde
Posts: 31
Joined: Fri Dec 15, 2006 9:52 pm

Re: Google/HTC Android G1 preset - Official support request

Post by tlunde »

amiliv (or anyone else with access to a Android 1.6 or 2.0 device) -

Could you please test the Universal profile from 0.9.3 and/or current SVN?

I'm sitting on the fence looking at Verizon's DROID and it'd be nice to know that my current collection of encodes will work.

Thanks
ethan1013
Posts: 1
Joined: Tue Nov 24, 2009 5:31 am

Re: Google/HTC Android G1 preset - Official support request

Post by ethan1013 »

I can confirm the iphone preset works great on the Droid.
aea414
Posts: 1
Joined: Wed Dec 02, 2009 2:12 am

Re: Google/HTC Android G1 preset - Official support request

Post by aea414 »

tlunde wrote:amiliv (or anyone else with access to a Android 1.6 or 2.0 device) -

Could you please test the Universal profile from 0.9.3 and/or current SVN?

I'm sitting on the fence looking at Verizon's DROID and it'd be nice to know that my current collection of encodes will work.

Thanks
I just performed a quick test of the 23 sec "Lionsgate" intro and the Universal Apple preset worked(Using 0.9.4 and x264 1 pass) on my Moto Droid running Android 2.0, I used Act 1 Video Player Trial. Overall looked good, I did notice a few hiccups the first play through but i played it back two more times and did not notice any additional skipping.

I also tried the iPod and iPhone & iPod touch presets both worked with out issue.

Hope that helps.
Let me know if you want me to test anything else, I will try to get back to you ASAP. (Please note I will use short clips to save time, please no long term test cases.)
Also let me know if you know of a better, preferably FREE, video player for the DROID!
Post Reply