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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
- Blog post @Why Apple Is Winning the Mobile Video Format War...For Now
- Android uses the
flash
plugin, and apple usesHLS
- 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
. NoFlash
, noSilverlight
, noRTP
orRTSP
.
- Android uses the
- 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.
- I haven't come a cross one single mobile that doesn't support the
- 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
- If it needs to play back on mobile devices. Choose
- 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.
- The whole
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
回答2:
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.