Play video on the android recorded from the iPhone - android

I am writing video based social app for iOS and android(WinPhone is under waiting).
I recorded video in mov format using AVFoundation framework on the iPhone and uploaded it to the server.
It can be downloaded and played on the iPhone client.
But on the android device, downloaded video can not be played since it's format is not supported on the android.
What is the best solution of the video record and play for supporting multiple mobile devices platforms?

Blog post #Why Apple Is Winning the Mobile Video Format War...For Now
Android uses the flash plugin, and apple uses HLS
Today’s wide usage of the HLS protocol is a result of iOS success. Apple designated the protocol as the one and only way to stream video to an iOSDevice. No Flash, no Silverlight, no RTP or RTSP.
Q&A post #Best format for Mobile Video states
MPEG-4 will play on all mobile phones (at least those capable)
it also plays while buffers vs .mov which requires the whole movie to download first before playing.
StackOverflow post #Video Format that Works on Mobile Phones
I haven't come a cross one single mobile that doesn't support the MPEG-4 container format, including blackberry.
We tested a variety of Android devices and all of the recent models (Android 2.2/2.3) do support MPEG 4/H.264, the same goes for iPhone and AFAIK the Windows Phone.
Software Product info #Choosing a movie format
If it needs to play back on mobile devices. Choose MPEG-4 format can be played back on iDevices and Android phones.
Alot more info can be found #Choosing a movie format
Acceleration of MPEG-4 applications #FZi Forshcungzentrum INformatik
The whole MPEG-4 encoding/decoding process is partitioned between the standard processor, which is controlling the system and executes control-intensive algorithms, and its XPP coprocessor, which executes the computational-intensive data-flow algorithms and sends the results back to the host processor.
From this information, I suggest you convert to the MPEG-4 format.
MPEG-4 - Wikipedia, the free encyclopedia
MPEG-4.net - The Streaming Media Technology Resource
Mac app-store free video converters:
Miro Video Converter (MVC)
Smart Converter
Any Video Converter Lite
WonTube Free Video Converter

ffmpeg -i infile.mov -vcodec copy outfile.mp4
This will repackage the mov file to mp4 without transcoding. It is very fast. The resulting file is compatible with both android and iphone. Of course the best solution would be to record mp4 on the iphone in the first place. Yes you can do that.

Related

Can't Play video in android uploaded from iphone

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

How to play Red5 streaming at all smart devices?

I have installed red5 server on ubuntu 12.04 lts at AWS instance. I have successfully streamed my live stream using with Adope live encoder and play it with jwplayer on websites. Now I need to play my live stream on all smart devices. I have referred so many forums but I did not get the good solution for this. I have some restriction to play on mobile.
do not play with Flash browser at all smart-device. need to play it's own player when they connected to my website.
Is there any possible to play my live streaming with html5 video Tag
How can I achieve this setup? I know the red5 server only stream RTMP protocol. I want to re-stream to android, iphone, blackberry, Nokia, and also all smart devices and tab.
In practice you need to send the screams in three types:
HLS for IOS/Windows/BB devices
RTMP/RTMPT/RTMPS for browser based Flash clients (or AIR based native apps)
RTSP for Android/BB devices (as HLS should but rarely does work on Android devices)
Additionally there are some vendor specific technologies like Microsoft Smooth Streaming or webM by Google
You can use a streaming CDN like ScaleEngine.com to transcode and supply the necessary bandwidth to have streaming for all devices (RTMP for browsers, HLS for iOS devices and RTSP for Android). If you are inexperienced and you won't have terabytes of traffic, this might fit the bill.
If you are interested in a self hosted solution, a combination of:
Red5/Wowza/nginx-rtmp for recording management
FFmpeg for transcoding
nginx-rtmp for HLS
crtmp-server for RTPS
might do the trick.
There is no all in one solution. The ONLY way to stream live video in iOS is HLS. Some versions of Android may support HLS. I have not idea what formats blackberry and Nokia support. You will need to research this.
If you create your mobile app with Adobe AIR (with either Adobe Flash or Apache Flex), then your mobile app will support live audio/video streaming - on iOS, Android and BlackBerry 10 platforms.
Distribution to mobiles can be done with Wowza rtmp server packetisers for iOS HLS and RTP playback.
But you need to stream in supported formats/codecs.
If you stream with a web based flash broadcasting tool, stream will not be compatible with iOS because Flash does not encode AAC, so you need to transcode it.
Transcoding can be done with Wowza Transcoder addon or ffmpeg as available with VideoWhisper Live Streaming that can produce a HTML5 video for Safari playback (on iOS / desktop).

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.

Can an Android phone decode and play back a *.caf file w/ iLBC codec?

How I can get an audio file recorded via iPhone to play back in Android.
I don't see iLBC codec listed in the decoder section of Android supported media formats
Looking at the iPhone list of supported audio formats: iPhone audio formats, it looks like if you're just going iPhone => Android, then AAC or PCM are your best bets for encoding on iPhone, decoding on Android.
You should record your audio on iPhone with AVAudioRecorder .wav format.
See this thread how to configure AVAudioRecorder to get wav format on iOS.
Good luck
In terms of a built-in capability you can check the documentation as easily as I can.
Assuming no built-in capability, if you have working java, C, or (with caveats) C++ code capable of decoding the file to linear pcm samples and no legal obstacles to using it, then you can write an application to do so.

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