explicitly set profile+level for encoder
some modern Androids (namely my Xiaomi Mi A1 after the update to Andorid 9) seem to require that
This commit is contained in:
parent
150f035d3f
commit
5814744dca
1 changed files with 4 additions and 0 deletions
|
@ -76,6 +76,10 @@ class AndroidStandardFormatStrategy implements MediaFormatStrategy {
|
|||
format.setInteger(MediaFormat.KEY_FRAME_RATE, 30);
|
||||
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 3);
|
||||
format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
format.setInteger(MediaFormat.KEY_PROFILE ,MediaCodecInfo.CodecProfileLevel.AVCProfileBaseline);
|
||||
format.setInteger(MediaFormat.KEY_LEVEL, MediaCodecInfo.CodecProfileLevel.AVCLevel13);
|
||||
}
|
||||
return format;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue