Skip to content

A133 transcoding issue due to decoder's block size#3

Merged
viralauraframes merged 4 commits intomainfrom
a133_transcode_issue
Apr 1, 2025
Merged

A133 transcoding issue due to decoder's block size#3
viralauraframes merged 4 commits intomainfrom
a133_transcode_issue

Conversation

@viralauraframes
Copy link
Copy Markdown
Collaborator

On A133 there are some video resolutions that would not transcode.
Debugging has revealed the following:

  • at some point in transcoding the decoder outputs a format change specifically a increase in width of the video
  • after the format changes, all new frames decoded are of the new resolution
  • since the encoder was initialized with the width taken from original video, it can no longer encode frames with the new resolution

Couldn't figure out how to change the encoder format to use the new resolution.
Also couldn't figure out stopping + releasing and restarting the encoder as that makes the decoder and out GL surface for color correction out of sync with the new encoder.

Ultimately,
We know that the decoder is going to change the format midway so we can pre calculate what the decoder's format change is going to be by running an experiment with few different resolution videos.
This reveals that the macro block size that decoder ends up using is 32 and the height and width of the video needs to be a multiple of 32.

This PR makes sure the height and width of the output video is taken as the next multiple of 32.

@viralauraframes
Copy link
Copy Markdown
Collaborator Author

This has been pushed to a CX frame that was exhibiting this behavior and seems to have resolved it for them.

Comment thread litr/src/main/java/com/linkedin/android/litr/MediaTransformer.java Outdated
@viralauraframes viralauraframes merged commit e311549 into main Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants