MasayukiSuda / GPUVideo-android

This library apply video filter on generate an Mp4 and on ExoPlayer video and Video Recording with Camera2.
MIT License
658 stars 178 forks source link

Samsung P-600 and several others - broken aspect ratio #8

Open nyarian opened 5 years ago

nyarian commented 5 years ago

Hi!

I've encountered an issue with Samsung P600: attaching screenshots for portrait and landscape rotation (with configuration change on rotation disabled) in the mentioned order:

1 2

I think that the issue is that this device's display has rotation equal to Surface.ROTATION_270 in portrait orientation.

I've tried to add a workaround with a check of device orientation and returning 90 in portrait mode if the rotation is either 90 or 270, but then the aspect ratio will be calculated wrong (1.(7) instead of 0.5625 for 16:9). To work this around the preview shader can be copied and changed with resizing Y instead of X by this value. Still, when the filter is applied and recording is started - all is just broken for preview... If I'll find the solution first - I'll make a fix and PR, but I haven't found it yet.

P.S.: thanks for such an enormous job, for most cases it is awesome

Best Regards, Andrey

pablogeek commented 3 years ago

@nyarian Hi! have you found a work around for this? thanks!

nyarian commented 3 years ago

@pablogeek I didn't :(