Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6023839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:03:55+00:00 2026-05-23T04:03:55+00:00

Theoretically both IOS and ANDROID will play h.264 files, but I can’t figure out

  • 0

Theoretically both IOS and ANDROID will play h.264 files, but I can’t figure out a setting to encode them so they actually work cross platform. Does anybody know how to encode for both Android and IOS using one file?

p.s. I know all about html5 video and the fallback sources, I just don’t want to encode and host a new video for every device that comes down the pike.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:03:56+00:00Added an answer on May 23, 2026 at 4:03 am

    Here’s the ffmpeg command line we use to transcode to MPEG-4 h.264 in our production environment. We’ve tested the output on several Android devices, as well as iOS. You can use this as a starting point, just tweaking things like frame size/frame rate and qfactor.

    ffmpeg -y 
    -i #{input_file} 
    -s 432x320 
    -b 384k 
    -vcodec libx264 
    -flags +loop+mv4 
    -cmp 256 
    -partitions +parti4x4+parti8x8+partp4x4+partp8x8 
    -subq 6 
    -trellis 0 
    -refs 5 
    -bf 0 
    -flags2 +mixed_refs 
    -coder 0 
    -me_range 16 
    -g 250 
    -keyint_min 25 
    -sc_threshold 40 
    -i_qfactor 0.71 
    -qmin 10 -qmax 51 
    -qdiff 4 
    -acodec libfaac 
    -ac 1 
    -ar 16000 
    -r 13 
    -ab 32000 
    -aspect 3:2 
    #{output_file}
    

    Some of the important options affecting Android compatibility are:

    -coder 0      Uses CAVLAC rather than CABAC entropy encoding (CABAC not supported on Android)
    -trellis 0    Should be shut off, requires CABAC
    -bf 0         Turns off B-frames, not supported on Android or other h.264 Baseline Profile devices
    -subq 6       Determines what algorithms are used for subpixel motion searching. 7 applies to B-frames, not supported on Android.
    -refs 5       Determines how many frames are referenced prior to the current frame.  Increasing this number could affect compatibility
    

    After we encode our video with this ffmpeg recipe, we also pass the video through qt-faststart. This step rechunks the video for streaming. We stream it over HTTP to an embedded VideoView within our Android app. No problems streaming to any Android device we’re aware of.

    Update 2013-06-17: I just wanted to add a note that it’s best to stick with “baseline” profile for H.264 encoding for maximum compatibility across all Android devices. The above command line doesn’t explicitly specify an H.264 profile, but ffmpeg does have a -profile command line flag that is useful if you are using its presets. You probably shouldn’t mess with -profile. I have encoded videos for my ASUS Transformer 300 tablet (Android 4.2) using “main” rather than “baseline” profile (via Handbrake). The “main” profile gave problems with audio getting out of sync with video on playback.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get them theoretically, but I'm grappling with gzipping files in practice. How should
Theoretically, the end user should never see internal errors. But in practice, theory and
Let's say I play a stereo WAV file with 317,520,000 samples, which is theoretically
Can sha1sum return the same results for two files that are different ? I
It appears that we can - theoretically - build a single static library that
We have 2 web-servers which are theoretically identical, but are producing different results when
I'm considering writing an app for both platforms, but the iPhone app must be
The question can be seen as both practical and theoretical. I am designing a
Theoretically, it is possible to embed ads into a winforms app running on a
I need to increase the max_allowed_packet param, to fit some theoretically very large items.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.