Android can’t record video with Front Facing Camera, MediaRecorder start failed: -19

I wrestled with this problem a bit today, too. First, make sure that your permissions are set up correctly. Specifically, to record video, you’ll want: <uses-feature android:name=”android.hardware.camera.front” /> <uses-feature android:name=”android.hardware.microphone”/> <uses-permission android:name=”android.permission.CAMERA” /> <uses-permission android:name=”android.permission.RECORD_AUDIO” /> <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” /> Second, and this is the tricky part, this line from the tutorial does not work with … Read more

Record 5 seconds segments of audio using MediaRecorder and then upload to the server

You have to understand how media files are built. It is not only some raw data that can be converted to either audio or video directly. It will depend on the format chosen, but the basic case is that you have what is called metadata which are like a dictionary describing how the file is … Read more

MediaRecorder and VideoSource.SURFACE, stop failed: -1007 (a serious Android bug)

I guess there is no solution so the answer: MediaRecorder/Android is buggy or Mobile companies didn’t care of all Android features while developing their devices Update MediaCodec is also buggy with canvas mSurface = mMediaCodec.createInputSurface(); mSurface.lockHardwareCanvas() It works on much more devices with MediaCodec but still some devices may fail to record video correctly using … Read more

MediaStream Capture Canvas and Audio Simultaneously

Is it possible to create a MediaStream containing MediaStreamTrack instances from two different sources/elements? Yes, you can do it using the MediaStream.addTrack() method. But Firefox will only use the initial stream’s tracks into the Recorder until this bug has been fixed. OP already known how to get all of it, but here is a reminder … Read more

How can I add predefined length to audio recorded from MediaRecorder in Chrome?

This is a chrome bug. FF does expose the duration of the recorded media, and if you do set the currentTimeof the recorded media to more than its actual duration, then the property is available in chrome… var recorder, chunks = [], ctx = new AudioContext(), aud = document.getElementById(‘aud’); function exportAudio() { var blob = … Read more