Video clarity with my code is bit low as compared to recording with Android camera

StackOverflow https://stackoverflow.com/questions/8146962

  •  02-03-2021
  •  | 
  •  

문제

In my application I recorded a video and then playing. For recording a video I used the below code

    mediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
    mediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);

    mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); 
    mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); 
    mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);



    File MyMedia=new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM),"Directory");
    mediaRecorder.setOutputFile(MyMedia.getAbsolutePath()+"/filename.mp4");

It is working fine but video clarity is bit low compare with another video which is recorded by native recorder. Please tell me the solution for how to set video clarity same as native recorder.

도움이 되었습니까?

해결책

Set frameRate and videoSize.

recorder.setVideoFrameRate();
recorder.setVideoSize();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top