Fix: Black Bars Around Output Video on Custom Resolutions (#165, #180)
This PR fixes an issue where selecting a custom resolution preset from settings results in black bars or padding around the output video on various devices. The fix ensures that the video maintains the correct aspect ratio without unwanted padding.
Changes
- Adjusted resolution scaling logic to prevent black bars by introducing setResolution function & WindowUtils utility class.
- added documentation for setResolution in Readme file.
- Improved aspect ratio handling across different device screen sizes to prevent error.
- Tested on multiple resolutions (1080p, 720p, 480p) to ensure consistency.
Related Issues
- Fixes #165
- Fixes #180
Testing
Verified on multiple devices with different aspect ratios. Here is the list
- Oppo CPH2557 - 34
- Samsung S23 Ultra - 34
- Motorolla G20 - 31 (Android 11)
- Google 9 Pro XL - 34 - (Android 14)
- Google Pixel 4a 5G - 34 - (Android 14)
- Google Pixel 7 - 33 - Android 13
- Lenovo Tab P12 - 30 (Android 10)
Ensured recorded videos match the selected resolution without additional padding/black bars.
Let me know if you need refinements! 🚀. I hope my PR gets merged.
Thank you for this. I will review it today, test it on my side, and then implement it. I'm sorry for only responding now.
Thank you for getting back to me! I really appreciate it. I’m glad to hear you’ll be reviewing it soon. If there are any changes or improvements you’d like to see, I’d be happy to update the contribution accordingly.