I have the following specified with my MediaRecorder implementation:
const getMediaRecorderOptions = function () {
var options = { mimeType: "video/webm;codecs=vp8" }; // 9 was lagggy, cpu-intensive
if (!MediaRecorder.isTypeSupported(options.mimeType)) {
logger.recorderLog(options.mimeType + " is not Supported");
options = { mimeType: "video/webm;codecs=vp8" };
if (!MediaRecorder.isTypeSupported(options.mimeType)) {
logger.recorderLog(options.mimeType + " is not Supported");
options = { mimeType: "video/webm" };
if (!MediaRecorder.isTypeSupported(options.mimeType)) {
logger.recorderLog(options.mimeType + " is not Supported");
options = { mimeType: "" };
}
}
}
return options;
}
Obviously, this is just for webm which isn't supported on iOS Safari or MacOS. I'm trying to avoid doubling our storage and introducing encoding complexity. Is there any way MediaRecorder on Chrome can record directly to a cross-platform container format, from any platform?
android.media.MediaRecorder. Used to record audio and video. The recording control is based on a simple state machine (see below).
Media Recorder records both audio and video recordings and save them into many different formats of your liking with just a few simple taps! All recordings will automatically appear on the Files app.
You should be able to record to webm/h.264
var options = {mimeType: 'video/webm;codecs=h264'};
media_recorder = new MediaRecorder(stream, options);
So you have the right cross platform video format (H.264) in a WebM container.
Now you could try ffmpeg.js and just change the container from WebM to mp4 - coping the H.264 stream - no transcoding (-vcodec copy).
I recorded to webm/h.264 in Chrome but I didn't try re-wrapping it with ffmpeg.js.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With