Reputation: 4448
I am capturing a video on my android device, the video format is .mp4
.
When i'm trying to play the video on an iPhone device the video just won't play but any other video that was captured on the iPhone device plays just fine.
Is there any type of video and audio encoding
that is both suitable for android and iPhone?
This is the Java code I set the Audio/video encoders :
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
Upvotes: 2
Views: 415
Reputation: 2113
try just like:
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
Upvotes: 1