Questions tagged [mediarecorder]

Mediarecorder is the Android class used for recording Audio and Video available since API Level 1. (For the Web-API, use the [web-mediarecorder] tag instead.)

994 questions
16
votes
2 answers

MediaRecorder start failed: -38

i searched to check if this question is no dup , i see some has no answer and others did not help. this is my code : private void startRecording() { mRecorder = new MediaRecorder(); …
Robocide
  • 5,430
  • 4
  • 32
  • 37
16
votes
1 answer

Android Mediarecorder recorded video duration different from expected duration

I recorded a video using android Mediarecorder. (Main Problem: I need to know the exact startTime[System time] and endTime[System time] of the video and the [endTime - startTime] must match the duration of the actual…
xiaowoo
  • 2,128
  • 6
  • 31
  • 44
15
votes
1 answer

Updated(reproducible) - Gaps when recording using MediaRecorder API(audio/webm opus)

----- UPDATE HAS BEEN ADDED BELOW ----- I have an issue with MediaRecorder API (https://www.w3.org/TR/mediastream-recording/#mediarecorder-api). I'm using it to record the speech from the web page(Chrome was used in this case) and save it as…
14
votes
2 answers

Camera2 video recording without preview on Android: mp4 output file not fully playable

I am trying to record video from the back camera (the one that faces the face) on my Samsung Galaxy S6 (which supports 1920x1080 at about 30 fps). I do not want to have to use any surface for previewing if I do not have to as this is to just happen…
Mark
  • 1,058
  • 14
  • 20
14
votes
4 answers

Android mediarecorder stop failed

I've faced a very strange behavior: sometimes my mediarecorder crashes with an error "Stop failed" and sometimes it works fine. Is there my fault or it is a bug of the system? I cant't get what is wrong. private void stopRecording(){ …
Alex A. Renoire
  • 261
  • 1
  • 2
  • 19
13
votes
1 answer

How to record the video using camera preview on TextureView

I have been playing with TextureView on some Android 4.0 devices. For example, I tried to develop a simple app, which can record the video and uses TextureView for its preview. However, as far as I read the Android API documents, standard…
13
votes
2 answers

How to record video on Android into Stream

Android MediaRecorder allows to save video to file (file or socket): setOutputFile(FileDescriptor fd); setOutputFile(String path) How to save videodata to OutputStream? It will be used for streaming video recording.
4ntoine
  • 17,607
  • 16
  • 70
  • 175
13
votes
3 answers

Get supported Codec for Android device

Is there a way to ask an Android device what audio and video Codecs it supports for encoding? I found devices that do not support some of the codecs listed as mandatory in http://developer.android.com/guide/appendix/media-formats.html and there seem…
Marcus Wolschon
  • 2,402
  • 1
  • 20
  • 27
12
votes
1 answer

webRTC convert webm to mp4 with ffmpeg.js

I am trying to convert webM files to mp4 with ffmpeg.js. I am recording a video from canvas(overlayer with some information) and recording the audio data from the video. stream = new MediaStream(); var videoElem =…
q-jack
  • 346
  • 2
  • 3
  • 14
12
votes
2 answers

How to know whether a MediaRecorder is in running state or not?

I wrote a code to record audio of call conversation using MediaRecorder. how can i know whether a MediaRecorder is in running state or not, to stop the recording. like boolean running; MediaRecorder mr; //what should i assign to running? …
manidhar mulaparthi
  • 1,052
  • 2
  • 18
  • 30
12
votes
1 answer

In Android, is it possible to change Camera (from front to back) and still keep recording?

That's my question :). If I start recording using the Front Camera with the MediaRecorder and then switch to the back camera, is it possible to keep recording using the same video file? Also, is it possible to record both cameras at the same time?
StackOverflowed
  • 5,486
  • 7
  • 51
  • 105
12
votes
2 answers

Android record video without audio

Is it possible in Android to record video from Camera without audio stream? Goal: to reduce the output file size.
Sergii
  • 1,441
  • 2
  • 24
  • 36
11
votes
2 answers

Need a simple example for audio recording

I am in need of simple audio recording and playing example using AudioRecorder in android. I tried with MediaRecorder, it works fine.
Manikandan
  • 2,421
  • 4
  • 48
  • 88
11
votes
1 answer

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

I want to record user's microphone 5 seconds long segments and upload each to the server. I tried using MediaRecorder and I called start() and stop() methods at 5 seconds time interval, but when I concatenate these recordings there is a "drop" sound…
MM PP
  • 3,712
  • 8
  • 29
  • 55
11
votes
0 answers

MediaRecorder alternative to setNextOutputFile prior to Oreo?

I am using MediaRecorder API prior to Oreo. Problem I am facing is recording happens on one continues big file if recording goes on for 1 or 2 hours. Since Oreo (API level 26) MediaRecorder API has introduced setNextOutputFile() which can be useful…
1
2
3
66 67