Closed FidanBacaj closed 5 years ago
Hi @FidanBacaj :
You can find the default video recorder config here:
As you can see, the default video format & codec is:
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
So the problem is that the video player your phone provided may not support the H264
codec, so it cannot play the video for you.
There are two ways to solve the issue:
H264
codec.Photographer.MediaRecorderConfigurator
object when you calling Photographer.startRecording(MediaRecorderConfigurator configurator)
, and set another video codec which your currently using video player supported:mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263); // for example
You may find these two classes helpful:
Thank you @duanhong169 for quick answer !
@FidanBacaj Always welcome! BTW, it will be fine if you give this project a star, then more people can reach here! 😊
When I make a video with this library (
com.github.duanhong169:camera:1.0.3
) and when i click to play this video ,video not played just voice and writes "video codec not supported"Can you help me for this problem how to fix ?