mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Remove B-frame setting from DefaultEncoderFactory
This setting is buggy on some devices (for example sm-n960f) PiperOrigin-RevId: 529712770
This commit is contained in:
parent
511b1358cd
commit
30957df635
2 changed files with 4 additions and 2 deletions
|
|
@ -121,6 +121,8 @@
|
|||
an input frame was pending processing.
|
||||
* Query codecs via `MediaCodecList` instead of using
|
||||
`findDecoder/EncoderForFormat` utilities, to expand support.
|
||||
* Remove B-frame configuration in `DefaultEncoderFactory` because it
|
||||
doesn't work on some devices.
|
||||
* Muxer:
|
||||
* Add a new muxer library which can be used to create an MP4 container
|
||||
file.
|
||||
|
|
|
|||
|
|
@ -549,10 +549,10 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
|||
EncoderUtil.findHighestSupportedEncodingLevel(
|
||||
encoderInfo, mimeType, expectedEncodingProfile);
|
||||
if (supportedEncodingLevel != EncoderUtil.LEVEL_UNSET) {
|
||||
// Use the highest supported profile and use B-frames.
|
||||
// Use the highest supported profile. Don't configure B-frames, because it doesn't work on
|
||||
// some devices.
|
||||
mediaFormat.setInteger(MediaFormat.KEY_PROFILE, expectedEncodingProfile);
|
||||
mediaFormat.setInteger(MediaFormat.KEY_LEVEL, supportedEncodingLevel);
|
||||
mediaFormat.setInteger(MediaFormat.KEY_MAX_B_FRAMES, 1);
|
||||
}
|
||||
} else if (Util.SDK_INT >= 26) {
|
||||
int expectedEncodingProfile = MediaCodecInfo.CodecProfileLevel.AVCProfileHigh;
|
||||
|
|
|
|||
Loading…
Reference in a new issue