这是indexloc提供的服务,不要输入任何密码
Skip to content

[Transformer] Question about the default strategy of adjusting profile level h264 encoder could cause compatible issue #2603

@ninh-huynh

Description

@ninh-huynh

First, thanks for the awesome library.

Our application is using androidx.media3:media3-transformer:1.6.0 for processing video before upload/sharing with others (the output video should be at most HD 720p using h264 codec). Recently, we received user feedback from an iOS device that they cannot save the video after it is transcoded from Android (for example, the receiver receives the video in the chat box, can play it normally, but then the user fails to save it locally).

After checking the output video metadata (which is transcoded from the transformer library), we saw it use profile High, level 6.0 (which is probably the root cause of the failure when saving in iOS due to it video requirements 1.3).

Image

My question is, when we try to pick the highest supported level for the AVC profile high (see DefaultEncoderFactory.java#L338), can it guarantee the compatibility with other devices/platforms?

adjustMediaFormatForH264EncoderSettings(format.colorInfo, encoderInfo, mediaFormat);

Device used for the test:

  • Samsung Z Fold 5 - Android 15 (for recording video and transcoding)
  • iPhone 15 Pro Max - iOS 18.5 (for receiving video and saving)

Input:

  • Input video: FullHD/4K/8K - 30 FPS - HEVC
  • Requested width x heigth: 480 x 848 (SD)
  • Requested video bitrate 1.300.000
  • Requested video mime: h264
  • Requested bitrate mode: VBR

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions