Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Video compatibility issue: android recorded video not played in 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 recored video and able to play in android well but unable to play on iphone.

if if use this code for recording

         // 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 records video compatible.with iphone well. but this records 30 seconds video about 47 mbs on samsung note2.

Any help?

like image 470
shailesh Avatar asked Apr 16 '13 13:04

shailesh


People also ask

Why won't my iPhone play my recorded videos?

Just clear your unnecessary data or reduce video size to free up the memory. App Caches/Cookies/History/Data is another representative cause for iPhone won't play videos online issue. Don't forget to periodically clear them to speed up your iPhone. Sometimes, video playback issue is caused by outdated apps.

Why is my recorded video not playing?

Your Android's operating system isn't up to date. You may have downloaded any untrustworthy software on your mobile phone. The video may not have downloaded completely from the source web portal. The media player present in your handset is outdated.

Can iPhone receive videos from Android?

To move photos and videos from your Android device to your iPhone, iPad, or iPod touch using a computer: Connect your Android to your computer and find your photos and videos. On most devices, you can find these files in DCIM > Camera. On a Mac, install Android File Transfer, open it, then go to DCIM > Camera.

Why does my iPhone not play videos on my Android?

As we know, iPhone videos' default format is MOV, which cannot be supported by Android. If you want to play iPhone videos on Android without extra apps or codecs installed, you need to convert MOV to common formats such as MP4, AVI, MKV, etc.


1 Answers

The iPhone supports video in MPEG-4 video format, and at a resolution not larger than 640x480

try this mediaRecorder.setVideoSize(640, 480);

MORE INFO: to play video on iphone

Video Format: MP4, MOV, M4V

Video Size: up to 640x480

Video Framerate: up to 30fps

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

Audio: AAC up to 160Kbps, 48kHz

like image 200
oops.objective Avatar answered Oct 12 '22 15:10

oops.objective