-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set pixel aspect ratio from output media format if set #1371
Conversation
Hi @microkatz have you had the chance to review this? |
f9dbabf
to
a0aabcd
Compare
Rebased after conflict from main. |
Hi @microkatz coming back here after a while, this change looks pretty straightforward, any reason for not merging it? |
Apologies for the delay @dsparano but thank you for following up! Would you be able to add a unit test for your change? You should be able to add a test in I prototyped a unit test with your proposed code change so I know its possible. This also highlighted some bugs in your proposed code. Here was my rough prototyped test.
|
Thanks @microkatz, I think I've made the changes as per for your review and suggested code |
77a925b
to
ddef93b
Compare
I'm going to send this for internal review now. You may see some more commits being added as I make changes in response to review feedback. Please refrain from pushing any more substantive changes as it will complicate the internal review - thanks! |
c50c1d0
to
b16ce6d
Compare
b16ce6d
to
f165473
Compare
Hello @dsparano, Just to warn you, a regression in playback behavior was found subsequently to the introduction of this PR and we had to rollback this commit. This occurred here, 5282fe3. The rollback was pushed into The issue was that for some vertical videos, the provided pixel aspect ratios from a MediaCodec decoder were incorrect and should not have be applied at onOutputFormatChanged. We are still investigating the potential bug in the framework but will keep you posted on the progress. |
Problem
If a video effect is applied to the video, or an "enhancement" such as LCEVC, is applied, the output video may look distorted if the pixel aspect ratio was changed in the post-processing stage.
Root cause
The output pixel aspect ratio is taken from the input Format object, which is a property of the stream and not of the video decoding and post processing applied. Note that this has similarity with what was addressed in #1025.
Proposed solution
If pixel aspect ratio is set in the output MediaFormat object it is taken from there, since it may have been set in the post processing stage, otherwise set it from the Format object as per current behaviour.