Can't Play video in android uploaded from iphone - android

I have upload and play videos on both Android and iPhone devices but video uploaded from iPhone is not working on Android.it's not play in android video player. It's give me error message
"sorry this video can not be played"
video is in mp4 format.

Yes, That's right.
It happens because the android support limited codecs in-built like mp3,mp4,mpeg.
While iphone support most of codecs.
What is the way to resolve this?
MP4 for video and MP3 for audio are widely accepted and work on both platforms.
So you need do some stuff at the server. Implement the ffmpeg library that will convert all the videos to MP4 and audio to MP3.
We are doing same mechanism to resolve this issue.
Find FFMPEG implementation for PHP Here and
Command to convert all videos to MP4 Here
Hope this helps you.
Thanks.

If it is mp4, then you need to check what codecs are used. iPhone usually encodes everything in h264, however, there are different profiles of h264 and high profiles might not be supported on Android, because they are more complex for decoding.
Even apple says in their documentation:
H.264 Baseline Level 3.0, Baseline Level 3.1, Main Level 3.1, and High Profile Level 4.1.
iPad, iPhone 3G, and iPod touch (2nd generation and later) support
H.264 Baseline 3.1. If your app runs on older versions of iPhone or
iPod touch, however, you should use H.264 Baseline 3.0 for
compatibility. If your content is intended solely for iPad, Apple TV,
iPhone 4 and later, and Mac OS X computers, you should use Main Level
3.1.
Baseline profile should be played everywhere.
See the list here - http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles
So if you have control over encoding (if the video is recorded from your iOS application), then you can do it programmatically. I just googled and found a piece of code where the profile is set: http://forums.macrumors.com/archive/index.php/t-1512924.html

Related

When coding in HTML, why does video load on some Android devices and not others?

The video I have included in my app only works on certain devices. For example, it works perfectly on iPhones, the Galaxy S6, Nexus 6, and so on. However, the video loads infinitely on the Note 4. Does anyone have a solution to this?
Here is a snippet of how I am calling the video.
<ion-view view-title="Compensation Philosophy">
<ion-content has-bouncing="false"; overflow-scroll="true" >
<div class="video-container">
<video controls class="videox"
src="VideoResources/Pennacchio_Rewards_Philosophy.mov"
poster="VideoResources/sshot.png"></video>
</div>
I think that should be mostly because of video encoding. You should try with some sample video by searching them from internet and once you find some video which is working and your video is not working, then maybe after comparison, you may be able to get find out which all formats are supported on your phone.
For example, refer:
https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
#Darshak,
Digish was close to the right answer.
From Supported Media Formats | Android Developers
The table below describes the media format support built into the Android platform. Note that any given mobile device may provide support for additional formats or file types not listed in the table.
Note: Media codecs that are not guaranteed to be available on all Android platform versions are accordingly noted in parentheses—for example "(Android 3.0+)".
H.263
H.264 AVC - (Android 3.0+) -
H.265
HEVC - - (Android 5.0+)
MPEG-4 SP
VP8 - (Android 4.3+) (Android 2.3.3+)
VP9 - - (Android 4.4+)
You can see the different formats and when they were supported for encoding and decoding. In addition, some formats require hardware, and as the documentation says, the mobile device may provide support for additional formats or file types.
So to completely answer the question, if the mobile device does not provide a solution for decoding the video, then the browser does not provide a solution; and so the HTML does not provide a solution, when the browser does not have a solution.

Live streaming issue from iOS to Android

We are working on an video streaming application in iOS and Android. We are using Wowza server. Application works fine from iOS to iOS and Android to Android. Means a video published from iOS device can be viewed on iOS device but not on Android device.
I know both Android and iOS support H.264 compression and we are publishing H.264 formatted stream. Here a bit confusion I thin H.264 is a compression technique and further defined by MP4, FLV etc please confirm.
What I think iOS publish stream something like .MOV defined H.264 stream which is not supported by Android that's why I think it doesn't work on Android. Please confirm.
Please suggest any way to play a video stream published through ios app to Android device.
There are two aspects to video files: The container and the encoding (or codec). H.264 is an encoding, and Android can deal with it, but Apple uses the QuickTime container format, which is similar to the MP4 container but apparently just different enough that Android can't handle it. Android can play MP4 files, and there are utilities to convert QuickTime to MP4, if that helps.

How to know which android devices support video playback?

I've made an app to view vine videos on Android devices. These are basically .mp4 videos being loaded into a VideoView. From the following documentation (http://developer.android.com/guide/appendix/media-formats.html), mp4 video playback is supported on Android version 3+ devices.
I've already added a android:minSdkVersion="11" to the manifest file to filter out older android versions from downloading the app, but I'm still getting feedback from users running newer versions of Android (eg. 4.1, 4.2) that complain about getting a "Video cannot be played" error message.
Since there's no way (that I know of, please correct me if I'm wrong) to test video playback using the emulator, I can't really know what's going on.
Is there any way to check for a device's ability to do video playback or at least get the emulator to play videos, so I can correctly fix this issue?
pd. for those interested, here's a link to my app in Google Play. As you can see, I'm being crushed by negative reviews: https://play.google.com/store/apps/details?id=com.thirtymatches.vineflow
If you look at the Google compatibility matrix closely, you'll see that support for MP4/H264 encoding started with the Android 3.0 release. Playback of MP4/H.264 has been supported by all Android devices back to Android 1.0, so there's no need for you to limit availability to newer releases of Android (unless you have other API compatibility needs).
Via VideoView, the video playback on all these devices is done using the hardware decoder provided by the phone's chipset. So to guarantee compatibility, the video has to be encoded to lowest-common denominator. Google provides "Video Encoding Recommendations" at the bottom of the page you linked; I also wrote an answer describing how we transcoded to a form of MP4/H264 that plays across all Android devices.
Not knowing what Vine is doing with their video clips, it might be that the videos aren't all encoded with uniform encoder parameters. They might be taking the videos straight off handsets and streaming them without any additional server-side processing to ensure wide compatibility; I don't know. If that's the case, you might find it challenging to develop an Android app that can show the content without a) implementing your own software codec (as apps like RockPlayer, MX Player or VLC do) or b) transcoding the videos on a server (which probably will run afoul of Vine's terms of service).

Android video streaming not valid on some device

I use a VideoView to display on the device a mp4 video file. It work very well on all device but on other such as : galaxy next, LG P500 it display this message "the video is not valid for streaming on this device ?"
Why ?? Thanks
Wether an android device can show the video depends on which video-codecs the device manufacturer has compiled in.
You can ask the CamcorderProfile api if your device supports the requested video format.
The Android Supported Media Formats show you wich codecs should be supported .
Make sure your MP4 is encoded with the H.264 baseline profile. Make sure it is being served up with an HTTP 1.1 response. And also run it through MP4Box. We had numerous device-specific playback issues and doing all of the above has resolved them.
This post may also be helpful: Cannot play certain videos

Which audio format can be recorded and played back by iPhone and Android?

I am designing an app that can record short audio files on iPhone and Android that can be played back on both platforms, as well as hopefully any other smartphone.
Right now I'm using *.caf with the iLBC codec, as I know the iPhone does not encode mp3.
Is there a file format/codec that I should use in this case?
It used to be that there were no common audio encoding formats for Android and iPhone.
iPhone: iPhone audio encoding supported formats
Android: Android supported media formats
But Android 2.3.3 adds support for AMR-WB and AAC: Android Audio Encoder AAC
See Media Framework at Android 2.3.3 API changes
So I believe AAC is your format choice if you want interop between Android and iPhone devices and can handle the Android 2.3.3 limitation.
Otherwise, just pick from the list for widest coverage (AMR-NB on Android) or plan on converting the recorded audio to a suitable format.
A quick check shows that AMR is patented and I assume AAC would have some patent coverage as well. PCM is decodable on iPhone and Android and most cellphones at the expense of larger filesize.
All smartphones can play WAV files (even Android as of 2.2). These are known as "Linear PCM" in iOS and "PCM/WAVE" in Android.
Try modifying the file type in your ios version file to be .wav and you should be able to listen to this audio file on an Android phone, as well as a Windows operating system.
You'll find that mp3 has hardware decoding in all recent iOS devices and most Android mobile phones as well (but not cheap tablets, budget phones, etc).
As explained above by typo.pl, the generally compatible format is AMR or WAVE(PCM), but in practice, we prefer a progressive solution:
produce AAC on iOS and Android 2.3.3+, but fallback to produce AMR (WB)
on Android pre-2.3.3. Both formats are playable on all platforms.
I guess it's a fairly easy solution for better compatibility and audio quality.

Categories

Resources