Skip to content
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

Video Aspect Ratio is not correct #48

Closed
ktprograms opened this issue Apr 5, 2022 · 3 comments
Closed

Video Aspect Ratio is not correct #48

ktprograms opened this issue Apr 5, 2022 · 3 comments
Milestone

Comments

@ktprograms
Copy link

Describe the bug
When streaming using HaishinStudio, the stream has a resolution of 640x360, but the resolution in Camera2Source is 640x480. I looked at the code, and it seems like the resolution variable is never set in Camera2Source, so the stream resolution isn't set either. Even if I manually set the stream resolution to be equal to the source resolution, the video still has the wrong aspect ratio.

I'm testing this with commit 513e551, since the next commit seems to have broken video streaming (only the audio is available in VLC).

To Reproduce
Steps to reproduce the behavior:

  1. Run HaishinStudio
  2. Open the stream in VLC
  3. See wrong aspect ratio

Expected behavior
The video has the correct aspect ratio.

I don't actually understand how/where the "correct" aspect ratio comes from, the variable setting seems a bit circular to me.

Screenshots

(The object in frame is a cube)

On Phone In VLC

Desktop (please complete the following information):

  • OS: macOS 11.6
  • VLC media player 3.0.12.1 Vetinari (revision 3.0.12.1-0-g170157402b)

Smartphone (please complete the following information):

  • Device: Samsung Galaxy A02
  • OS: Android 11
@shogo4405
Copy link
Owner

Thank you fedback. I fixed it.

ViewSize

Before After
スクリーンショット 2022-04-10 15 36 21 スクリーンショット 2022-04-10 15 02 36

shogo4405 added a commit that referenced this issue Apr 10, 2022
@ktprograms
Copy link
Author

Thanks! It's working great!

@ktprograms
Copy link
Author

Sorry, it's still broken.

When I put cameraSource.resolution = Size(480, 640) in the onResume() method of the example app's CameraTabFragment, both the view on the phone and the stream are stretched.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants