HBRecorder icon indicating copy to clipboard operation
HBRecorder copied to clipboard

Fix: Black Bars Around Output Video on Custom Resolutions (#165, #180)

Open AbdulWahab1539 opened this issue 11 months ago • 2 comments

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

  1. Adjusted resolution scaling logic to prevent black bars by introducing setResolution function & WindowUtils utility class.
  2. added documentation for setResolution in Readme file.
  3. Improved aspect ratio handling across different device screen sizes to prevent error.
  4. Tested on multiple resolutions (1080p, 720p, 480p) to ensure consistency.

Related Issues

  1. Fixes #165
  2. 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.

AbdulWahab1539 avatar Feb 07 '25 18:02 AbdulWahab1539

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.

HBiSoft avatar May 28 '25 07:05 HBiSoft

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.

AbdulWahab1539 avatar May 28 '25 07:05 AbdulWahab1539