Reputation: 4993
We want to create a video that can be played on all Android devices. How should we specify the format of the video, such that it will play on pretty much all Android devices?
The production company that we are working with has proposed:
Container = QuickTime Movie
Frame Size = 1280 x 720
Frame Rate = 30 fps
Codec = ProRes HQ (if alpha channel is needed, use ProRes 4444)
Audio = PCM - 48khz, 16bit (if needed)
I think that is completely wrong. They clearly know nothing whatever about Android, and are merely proposing things that have worked for them with iOS. .Mov files don't play on Android at all.
I think this is the universal format, including specifically "will play on Android":
container format = .mp4 (MPEG4)
codec = "H.263",
audio codec = AAC-LC
Can anyone who has practical experience of video on Android give their guidance on this? Thank you, Peter
Upvotes: 0
Views: 1239
Reputation: 25584
There is quite a bit of detail here and here.
Summary:
Upvotes: 1
Reputation: 620
1280 * 720 is a big resolution for the any android devices and it will not work in all the devices...I use 640*480 , and its working in all the devices I will check.. here is my code
this.mediaRecorder = new MediaRecorder(); this.mediaRecorder.setCamera(this.camera);
this.mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
this.mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
this.mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
this.mediaRecorder.setMaxDuration(10000);
this.mediaRecorder.setOutputFile(this.initFile().getAbsolutePath());
this.mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
this.mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
this.mediaRecorder.setVideoSize(640,480);
this.mediaRecorder.setVideoFrameRate(12);
try {
this.mediaRecorder.setPreviewDisplay(this.cameraPreview.getHolder().getSurface());
this.mediaRecorder.prepare();
// start the actual recording
// throws IllegalStateException if not prepared
this.mediaRecorder.start();
Toast.makeText(this, R.string.recording, Toast.LENGTH_SHORT).show();
// enable the stop button by indicating that we are recording
this.toggleButtons(true);
} catch (Exception e) {
Log.wtf(TAG, "Failed to prepare MediaRecorder", e);
Toast.makeText(this,"record nathi thatu...", Toast.LENGTH_SHORT).show();
this.releaseMediaRecorder();
}
}
Upvotes: 1