android.media.MediaRecorder.setMaxFileSize()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(212)

本文整理了Java中android.media.MediaRecorder.setMaxFileSize()方法的一些代码示例,展示了MediaRecorder.setMaxFileSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MediaRecorder.setMaxFileSize()方法的具体详情如下:
包路径:android.media.MediaRecorder
类名称:MediaRecorder
方法名:setMaxFileSize

MediaRecorder.setMaxFileSize介绍

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

@Test
public void testMaxFileSize() throws Exception {
 assertThat(shadowMediaRecorder.getMaxFileSize()).isNotEqualTo(512000L);
 mediaRecorder.setMaxFileSize(512000);
 assertThat(shadowMediaRecorder.getMaxFileSize()).isEqualTo(512000L);
}

代码示例来源:origin: florent37/CameraFragment

videoRecorder.setMaxFileSize(configurationProvider.getVideoFileSize());
videoRecorder.setOnInfoListener(this);

代码示例来源:origin: stackoverflow.com

recorder.setOutputFile("/sdcard/videocapture_example.mp4");
recorder.setMaxDuration(50000); // 50 seconds
recorder.setMaxFileSize(5000000); // Approximately 5 megabytes

代码示例来源:origin: florent37/CameraFragment

videoRecorder.setMaxFileSize(configurationProvider.getVideoFileSize());

代码示例来源:origin: guoxiaoxing/phoenix

mMediaRecorder.setMaxFileSize(cameraConfigProvider.getVideoFileSize());
mMediaRecorder.setOnInfoListener(this);

代码示例来源:origin: guoxiaoxing/phoenix

mMediaRecorder.setMaxFileSize(cameraConfigProvider.getVideoFileSize());

代码示例来源:origin: stackoverflow.com

mediaRecorder.setMaxFileSize(50000000); // Set max file size 50Mb

代码示例来源:origin: stackoverflow.com

recorder.setOutputFile("/sdcard/videocapture_example.mp4");
recorder.setMaxDuration(50000); // 50 seconds
recorder.setMaxFileSize(5000000); // Approximately 5 megabytes

代码示例来源:origin: cn.leancloud.android/avoscloud-push

private void initRecorder() {
 mediaRecorder = new MediaRecorder();
 mediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
 mediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
 mediaRecorder.setProfile(this.profile);
 mediaRecorder.setOutputFile(this.localPath);
 mediaRecorder.setMaxDuration(this.maxDuration); // seconds
 mediaRecorder.setMaxFileSize(this.maxFileSize); // Approximately 5 megabytes
 SurfaceHolder holder = this.surfaceView.getHolder();
 holder.addCallback(this);
 holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}

代码示例来源:origin: stackoverflow.com

MediaRecorder mediaRecorder = new MediaRecorder(); 
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); 
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
 CamcorderProfile camcorderProfile_HQ = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);
mediaRecorder.setProfile(camcorderProfile_HQ);
 mediaRecorder.setOutputFile("/sdcard/myvideo.mp4");
 mediaRecorder.setMaxDuration(60000); // Set max duration 60 sec. 
mediaRecorder.setMaxFileSize(5000000); // Set max file size 5M

代码示例来源:origin: stackoverflow.com

Camera mCamera = getCameraInstance();
 // adjust the camera the way you need
 mCamera.setDisplayOrientation(90);
 MediaRecorder recorder = new MediaRecorder();
 recorder.setCamera(mCamera);
 recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
 recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
 recorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
 recorder.setOutputFile(filePath);
 // add any limits
 recorder.setMaxDuration(50000); // 50 seconds
 recorder.setMaxFileSize(5000000); // Approximately 5 megabytes

代码示例来源:origin: dalong982242260/SmallVideoRecording

mediaRecorder.setOnErrorListener(this);
mediaRecorder.setMaxFileSize(maxSize);
mediaRecorder.setMaxDuration(maxTime);
mediaRecorder.setPreviewDisplay(mSurfaceHolder.getSurface());

代码示例来源:origin: zx391324751/weChatDemo

private void initRecorder() {
  recorder = new MediaRecorder();
  camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_BACK);
  if (camera != null) {
    camera.setDisplayOrientation(90);//摄像图旋转90度
    camera.unlock();
    recorder.setCamera(camera);
  }
  recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
  recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
  recorder.setOrientationHint(90); //旋转90度
  //480的清晰度,相当于高清视频与标清视频之间水准,10秒大概5mb左右
  CamcorderProfile cpHigh = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
  recorder.setProfile(cpHigh);
  recorder.setOutputFile(VIDEO_PATH); //文件名先随便写吧,毕竟只是demo
  recorder.setMaxDuration(10000); // 10 seconds
  recorder.setMaxFileSize(5000000); // Approximately 5 megabytes
}

代码示例来源:origin: lizhifeng-sky/VideoEdit

mMediaRecorder.setMaxFileSize(captureInterface.maxAllowedFileSize());
mMediaRecorder.setOnInfoListener(new MediaRecorder.OnInfoListener() {
  @Override

代码示例来源:origin: chengzichen/KrGallery

session.configureRecorder(1, recorder);
recorder.setOutputFile(path.getAbsolutePath());
recorder.setMaxFileSize(1024 * 1024 * 1024);
recorder.setVideoFrameRate(30);
recorder.setMaxDuration(0);

代码示例来源:origin: stackoverflow.com

recorder.setOutputFile("/sdcard/videocapture_example.mp4");
recorder.setMaxDuration(50000); // 50 seconds
recorder.setMaxFileSize(5000000); // Approximately 5 megabytes

代码示例来源:origin: stackoverflow.com

recorder.setOutputFile("/sdcard/videocapture_example.mp4");
recorder.setMaxDuration(50000); // 50 seconds
recorder.setMaxFileSize(5000000); // Approximately 5 megabytes

代码示例来源:origin: stackoverflow.com

recorder.setOutputFile("/sdcard/videocapture_example.mp4");
recorder.setMaxDuration(50000); // 50 seconds
recorder.setMaxFileSize(5000000); // Approximately 5 megabytes

代码示例来源:origin: stackoverflow.com

recorder.setOutputFile("/sdcard/videocapture_example.mp4");
recorder.setMaxDuration(50000); // 50 seconds
recorder.setMaxFileSize(5000000); // Approximately 5 megabytes

代码示例来源:origin: stackoverflow.com

recorder.setOutputFile("/sdcard/videocapture_example.mp4");
recorder.setMaxDuration(50000); // 50 seconds
recorder.setMaxFileSize(5000000); // Approximately 5 megabytes

相关文章