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

Aspect ratio set #232

Closed
nagyrobi opened this issue Jan 5, 2022 · 5 comments
Closed

Aspect ratio set #232

nagyrobi opened this issue Jan 5, 2022 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@nagyrobi
Copy link
Contributor

nagyrobi commented Jan 5, 2022

Please add an option to enforce card's aspect ratio, similar to HA's picture entity card.

My Hikvision camera's substream has an aspect ratio of 4:3 while the video itself is actually 16:9, and it appears vertically stretched.

If we could set the card height not to reszize automatically to video's aspect, but instead, with optional parameter allow setting a custom card aspect ratio (for 16:9 this is 1.78) it would be great.

VLC displays the stream correctly but I'm sure there's a glitch in the stream itself. No way to fix it in the camera (could use the main stream of 2K resolution, that has the correct ratio, but it's too much for Lovelace, useless here. Substream is enough.)

@nagyrobi
Copy link
Contributor Author

nagyrobi commented Jan 5, 2022

I've got partial results with:

  • set object-fit: fill; in the CSS of the video (here)
  • set height: 70%; for ha-card

@AlexxIT AlexxIT added the duplicate This issue or pull request already exists label Jan 8, 2022
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 8, 2022

Same as #21
If you know JS enough, you can propose the fix. I'm not JS expert

@AlexxIT AlexxIT closed this as completed Jan 8, 2022
@nagyrobi
Copy link
Contributor Author

nagyrobi commented Jan 8, 2022

Me neither. The problem is that the two changes above do the correct ratio, but in Lovelace bottom of the card remains black. Card height is not correctly adjusted.

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 8, 2022

So we waiting some JS guru :)

@nagyrobi
Copy link
Contributor Author

nagyrobi commented Jan 9, 2022

Posted something to #21 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants