1

我想在我们的应用程序中实现慢动作功能。这是我使用的代码。它使视频移动缓慢但不流畅。我们想要默认相机应用程序中的慢动作功能。是否可以这样做?

mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE);
mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
if (mNextVideoAbsolutePath == null || mNextVideoAbsolutePath.isEmpty()) {
    mNextVideoAbsolutePath = getVideoFilePath(getActivity());
}
mMediaRecorder.setOutputFile(mNextVideoAbsolutePath);

CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);
mMediaRecorder.setVideoEncodingBitRate(profile.videoBitRate);
mMediaRecorder.setCaptureRate(profile.videoFrameRate / 0.25f);
mMediaRecorder.setVideoFrameRate(profile.videoFrameRate);
mMediaRecorder.setVideoSize(mVideoSize.getWidth(), mVideoSize.getHeight());
mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.HEVC);
mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
4

0 回答 0