android-mediarecorder

MediaRecorder stop() failed

谁都会走 提交于 2021-01-29 11:05:22
问题 I know there are a few of these on SO already but none of them really were able to help my issue, but when I am running the code and start recording audio and then press my stop button it always fails because it is in the wrong state. I am not sure how I would go about fixing my states for this. Here is my MainActivity.java code: import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content

Record internal audio not working for TV BOX

一世执手 提交于 2020-12-06 16:22:10
问题 I have an app where one device shares his internal audio to another android device using the Sound Capture API (that was introduced in the Android API level 29). This app is working fine on mobile devices. However, when I try the app on an android box (which has access to the Android level 29 API) which is connected to a TV via HDMI, it doesn't seem to receive the audio signal. So either the audio can't be transferred or there is an issue when setting the audio format channel mask. Below is

Android detecting real recording, MediaRecorder has delay

耗尽温柔 提交于 2020-07-18 05:15:08
问题 I would like to synchronize data from phone with elapsed time recording video. I would like to get information (in ms) about elapsed time recording video. I tried resolve it via: 1. Run myself timing. Pseudo: mMediaRecorder.start(); //start recording startTime = System.currentTimeMillis(); //save start recording time timerHandler.postDelayed(timerRunnable, 0); //for save elapsed time and timerHandler.postDelayed(this, 20); for next 20ms but there is problem with MediaRecorder, because real

MediaRecorder get Timestamps while recording

拜拜、爱过 提交于 2020-06-28 04:27:17
问题 In my application I am recording video using MediaRecorder . Is there a way how I can count up a timestamp (as precise as possible) durring recording a video. I need this timestamp in order to synchronize some data with the recorded video afterwards. 回答1: You can get the timestamp by calling to: Long timestamp = System.currentTimeMillis() Just call it after you call start() . 回答2: I think you can get timestamp from SurfaceTextur getTimestamp(). The base time (zero point) will be set by the

preview display in android media recorder

帅比萌擦擦* 提交于 2020-01-24 03:53:26
问题 In android how to show preview surface before media recorder start. my app have video recording functionality,when i navigate to video recording fragment it display black screen,when i start recording using start button camera preview is display and recording start. how to start preview before recording. i have added code that i used in onCreateView() of fragment- surfaceHolder = mySurfaceView.getHolder(); camera = Camera.open(); if(camera!=null){ camera.setDisplayOrientation(90); Camera

screenshot android presentation display/surface

只愿长相守 提交于 2020-01-17 05:48:59
问题 I would like to make "instant" screenshots of an Presentation object in Android. My Presentation normally renders to a virtual display (PRIVATE) which is backed by the surface from a MediaRecorder that is setup to record video. Recording the presentation as a video works great. mMediaRecorder = new MediaRecorder(); mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE); mMediaRecorder.setOutputFormat(MediaRecorder

Android: Video-streaming with Mediarecorder over Sockets using ParcelFileDescriptor

对着背影说爱祢 提交于 2020-01-14 02:43:13
问题 I'm struggling with this quiet long and I decided I need help. The basis idea is described here: Link I want to stream the output from the MediaRecorder directly to my Server over Sockets while recording. (In this specific case I want to see if this is possible without using any streaming protocol just via a HTTP-POST.) The error of my current approach is: E/MediaRecorder: start failed: -2147483648 - RuntimeException Before I had an error pointing me to this topic mediarecorder-issue-on