diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-02-18 20:56:48 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-02-18 20:56:48 +0100 |
commit | 5814744dca19a956a91020745b67cbb3b8191b6b (patch) | |
tree | 5104bdacffb6cf20be234ad435c367be826422cd | |
parent | 150f035d3fd6b5092234deb7c4c7c1a8ef2c03a3 (diff) |
explicitly set profile+level for encoder
some modern Androids (namely my Xiaomi Mi A1 after the update to Andorid 9) seem to require that
-rw-r--r-- | libs/android-transcoder/src/main/java/net/ypresto/androidtranscoder/format/AndroidStandardFormatStrategy.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/android-transcoder/src/main/java/net/ypresto/androidtranscoder/format/AndroidStandardFormatStrategy.java b/libs/android-transcoder/src/main/java/net/ypresto/androidtranscoder/format/AndroidStandardFormatStrategy.java index 7783f731a..61d9d06fd 100644 --- a/libs/android-transcoder/src/main/java/net/ypresto/androidtranscoder/format/AndroidStandardFormatStrategy.java +++ b/libs/android-transcoder/src/main/java/net/ypresto/androidtranscoder/format/AndroidStandardFormatStrategy.java @@ -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; } |