mediarecorder

Why does the start() method of MediaRecorder throw an IllegalStateException?

戏子无情 提交于 2021-02-07 12:00:28
问题 I am trying to record audio but the start() method of MediaRecorder class throws an IllegalStateException . I use the following code: MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setOutputFile("/sdcard/"); try { recorder.prepare(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e

MediaRecorder setVideoSize shows different behaviour in different devices

落爺英雄遲暮 提交于 2021-02-06 09:15:33
问题 I am using media recorder to record video in an android app. mMediaRecorder.setCamera(mServiceCamera); mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT); mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); //mMediaRecorder.setVideoSize(mPreviewSize.width, mPreviewSize.height); mMediaRecorder.setVideoFrameRate(30); mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT); mMediaRecorder

MediaRecorder setVideoSize shows different behaviour in different devices

时光怂恿深爱的人放手 提交于 2021-02-06 09:12:21
问题 I am using media recorder to record video in an android app. mMediaRecorder.setCamera(mServiceCamera); mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT); mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); //mMediaRecorder.setVideoSize(mPreviewSize.width, mPreviewSize.height); mMediaRecorder.setVideoFrameRate(30); mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT); mMediaRecorder

How to Record the Video through Camera, And Record the SystemTimeStamp over the Video

我的梦境 提交于 2021-02-03 06:12:12
问题 I need to design a app.That when Record the Video through Camera,Show and Record the SystemTimeStamp above the Video. Can it work with current Android Frameworks? If can, How can i do this? Thanks for anybody to read this! 回答1: Follow the procedure below. 1. Capture video byte array (of each frame). 2. Now create bitmap from byte array. 3. Use link below to overlay text over bitmap. 4. Save those bitmaps to create video. Text Overlay bitmap. 回答2: You could follow a two-stage approach. First,

How to Record the Video through Camera, And Record the SystemTimeStamp over the Video

家住魔仙堡 提交于 2021-02-03 06:08:06
问题 I need to design a app.That when Record the Video through Camera,Show and Record the SystemTimeStamp above the Video. Can it work with current Android Frameworks? If can, How can i do this? Thanks for anybody to read this! 回答1: Follow the procedure below. 1. Capture video byte array (of each frame). 2. Now create bitmap from byte array. 3. Use link below to overlay text over bitmap. 4. Save those bitmaps to create video. Text Overlay bitmap. 回答2: You could follow a two-stage approach. First,

How to Record the Video through Camera, And Record the SystemTimeStamp over the Video

有些话、适合烂在心里 提交于 2021-02-03 06:05:29
问题 I need to design a app.That when Record the Video through Camera,Show and Record the SystemTimeStamp above the Video. Can it work with current Android Frameworks? If can, How can i do this? Thanks for anybody to read this! 回答1: Follow the procedure below. 1. Capture video byte array (of each frame). 2. Now create bitmap from byte array. 3. Use link below to overlay text over bitmap. 4. Save those bitmaps to create video. Text Overlay bitmap. 回答2: You could follow a two-stage approach. First,

MediaRecorder output 0 byte file

…衆ロ難τιáo~ 提交于 2021-01-27 10:38:12
问题 I wanna record video and audio using MediaRecorder. It's work. But when i check output file. I can't play output video file. Because, output filesize is 0 byte. also video time is 0 second.. Please check my code. public class Talk extends Activity implements SurfaceHolder.Callback{ Context context; SurfaceView sfv_Preview; private SurfaceHolder holder; private MediaRecorder recorder = null; boolean recording = false; private static final String OUTPUT_FILE = "/sdcard/videooutput.mp4"; private

Android MediaDataSource unexpected behavior

强颜欢笑 提交于 2021-01-07 02:39:18
问题 i was trying to play AAC audio stream in android MediaPlayer, as mentioned here and also here author claimed the problem was ignoring position argument so i made a little setup to test this i will record using recorder and save it to a buffer and feed this buffer to MediaPlayer according to this // parcel pipe: 1: write // 0: read ParcelFileDescriptor[] pfd = ParcelFileDescriptor.createPipe(); // a Good Recorder! final MediaRecorder mMediaRecorder = new MediaRecorder(); mMediaRecorder

Android MediaDataSource unexpected behavior

99封情书 提交于 2021-01-07 02:37:36
问题 i was trying to play AAC audio stream in android MediaPlayer, as mentioned here and also here author claimed the problem was ignoring position argument so i made a little setup to test this i will record using recorder and save it to a buffer and feed this buffer to MediaPlayer according to this // parcel pipe: 1: write // 0: read ParcelFileDescriptor[] pfd = ParcelFileDescriptor.createPipe(); // a Good Recorder! final MediaRecorder mMediaRecorder = new MediaRecorder(); mMediaRecorder

Send MediaRecorder blobs to server and build file on backend

為{幸葍}努か 提交于 2020-11-30 12:15:09
问题 I'm working on a website using nodejs and SailsJs. My objective is send the blobs generated by MediaRecorder.ondataavailable event (which returns small blobs) to the server and after finishing recording build the complete file on the server to store it. On the browser if I push all those small blobs into an array and then do this: var blob = new Blob(recordedBlobs, {type: 'video/mp4'}); I get the complete file blob that can be uploaded to the server easily and is fully playable. I'm sending