Android: Modifying recorded video quality

前端 未结 3 1759
轮回少年
轮回少年 2021-01-13 17:03

I\'m using MediaRecorder to record a video. It isn\'t clear to me what parameters I should be using to change the quality of the image, assuming the size of the video remain

3条回答
  •  不要未来只要你来
    2021-01-13 17:44

    try this one u can solve problem

    mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    mediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT); 
    mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
    mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
    
    String path = Environment.getExternalStorageDirectory() + "/file.mp4";
    mediaRecorder.setOutputFile(path);
    

提交回复
热议问题