Video compatibility issue: recorded video in android does not play on iphone

I am recording a video in android like this

List<Camera.Size> list = myCamera.getParameters().getSupportedPictureSizes(); Parameters parameters = myCamera.getParameters(); parameters.setColorEffect(coloreffects.get(index_color_effect)); myCamera.setParameters(parameters); mediaRecorder = new MediaRecorder(); myCamera.unlock(); mediaRecorder.setCamera(myCamera); mediaRecorder.setOrientationHint(90); mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER); mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); mediaRecorder.setAudioEncoder(AudioEncoder.HE_AAC); mediaRecorder.setVideoEncoder(VideoEncoder.H264); mediaRecorder.setOutputFile(Constants.videourl); mediaRecorder.setMaxDuration(30000); // Set max duration 60 sec. mediaRecorder.setVideoFrameRate(24); mediaRecorder.setVideoFrameRate(30); mediaRecorder.setVideoSize(720, 480); mediaRecorder.setPreviewDisplay(myCameraSurfaceView.getHolder().getSurface()); 

This is a reconstructed video and the ability to play well in Android, but is unable to play on the iphone.

if you use this code for writing

  // work two { mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER); mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)); mediaRecorder.setOutputFile(videourl); mediaRecorder.setMaxDuration(30000); // Set max duration 60 sec. } 

THIS video recording is compatible. with iphone is good. but it records video in 30 seconds about 47 mb on samsung note2.

Any help?

+6
source share
1 answer

iPhone supports video in MPEG-4 video format and with a resolution of no more than 640x480

try this mediaRecorder.setVideoSize (640, 480);

MORE INFO: for playing videos on iphone

Video Format: MP4, MOV, M4V

Video Size: Up to 640x480

Video clip: up to 30 frames per second

Video bitrate: up to 1.5 Mbps for H.264 or 2.5 Mbps for MPEG-4

Audio: AAC up to 160 Kbps, 48 ​​kHz

+1
source

All Articles