mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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.
|
an input frame was pending processing.
|
||||||
* Query codecs via `MediaCodecList` instead of using
|
* Query codecs via `MediaCodecList` instead of using
|
||||||
`findDecoder/EncoderForFormat` utilities, to expand support.
|
`findDecoder/EncoderForFormat` utilities, to expand support.
|
||||||
|
* Remove B-frame configuration in `DefaultEncoderFactory` because it
|
||||||
|
doesn't work on some devices.
|
||||||
* Muxer:
|
* Muxer:
|
||||||
* Add a new muxer library which can be used to create an MP4 container
|
* Add a new muxer library which can be used to create an MP4 container
|
||||||
file.
|
file.
|
||||||
|
|
|
||||||
|
|
@ -549,10 +549,10 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
||||||
EncoderUtil.findHighestSupportedEncodingLevel(
|
EncoderUtil.findHighestSupportedEncodingLevel(
|
||||||
encoderInfo, mimeType, expectedEncodingProfile);
|
encoderInfo, mimeType, expectedEncodingProfile);
|
||||||
if (supportedEncodingLevel != EncoderUtil.LEVEL_UNSET) {
|
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_PROFILE, expectedEncodingProfile);
|
||||||
mediaFormat.setInteger(MediaFormat.KEY_LEVEL, supportedEncodingLevel);
|
mediaFormat.setInteger(MediaFormat.KEY_LEVEL, supportedEncodingLevel);
|
||||||
mediaFormat.setInteger(MediaFormat.KEY_MAX_B_FRAMES, 1);
|
|
||||||
}
|
}
|
||||||
} else if (Util.SDK_INT >= 26) {
|
} else if (Util.SDK_INT >= 26) {
|
||||||
int expectedEncodingProfile = MediaCodecInfo.CodecProfileLevel.AVCProfileHigh;
|
int expectedEncodingProfile = MediaCodecInfo.CodecProfileLevel.AVCProfileHigh;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue