How should I choose a video format to be played on Web, Android & iOS?

后端 未结 2 1901
逝去的感伤
逝去的感伤 2021-01-30 15:04

I am working on a video sharing project and wonder what if there\'s a video format that is compatible with most players on Web, Android & iOS.

The app will work like

2条回答
  •  感动是毒
    2021-01-30 15:25

    Adding more info from Andrew T.'s answer.

    To set the parameters from Andrew's conclusion:

    // To Set Audio Encoder: AAC
    mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
    
    // To set Video Encoder: H264
    mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
    
    // To set Output Video format: mp4
    mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    

    Hope it helps...!!!

提交回复
热议问题