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

Support arbitrary aspect-ratio cameras #71

Closed
2 tasks done
mt0321 opened this issue Sep 9, 2021 · 15 comments · Fixed by #83
Closed
2 tasks done

Support arbitrary aspect-ratio cameras #71

mt0321 opened this issue Sep 9, 2021 · 15 comments · Fixed by #83
Assignees
Labels
bug Something isn't working

Comments

@mt0321
Copy link

mt0321 commented Sep 9, 2021

First, thank you for this awesome custom Lovelace card!

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue: 1.0.1

Last working release (if known): N/A

Browser and Operating System: Firefox and Chrome on Windows 10; Android Mobile App on Google Pixel 3

Description of problem: I have one camera with a vertical orientation, with its height taller than its width. This video gets cut off in the Lovelace card display.

Additionally, the bottom video bar (with play/pause and full-screen buttons) is cut off as well.

In full screen mode, I can see the full video. However, because the bottom bar is cut off, on Windows desktop I have to double-click to enter full screen mode. On Android I have not been able to find a way to show the full video as double-tap does not work.

I've attached an image showing the rendering.
frigate-card

Javascript errors shown in the web inspector (if applicable): N/A

Additional information:

For reference, the built-in Picture Entity card shows the camera stream (from the ONVIF integration) at full height. This may help figure out how to produce the same behavior in the custom Frigate card.
onvif-in-picture-entity-card

@mt0321 mt0321 added the bug Something isn't working label Sep 9, 2021
@dermotduffy
Copy link
Owner

dermotduffy commented Sep 9, 2021

[Quick response] Some parts of the card (e.g. the gallery) have no fixed size, so to keep the card consistently sized, it's all currently held to 16/9. Almost certainly this is your issue.

What resolution & aspect ratio is your video?

Can you "scroll down" when it's cut off? (Not suggesting that's acceptable, just making sure I understand the behavior)

@mt0321
Copy link
Author

mt0321 commented Sep 10, 2021

Thanks for the reply! That makes sense; I was not sure whether to call this a bug or a feature request. :)

What resolution & aspect ratio is your video?

The one displayed in the Frigate card is a lower-resolution stream right now: 480 x 704 (width x height). For clips the full high-resolution stream is being used, 2160 x 3840, which is a 9/16 ratio.

Can you "scroll down" when it's cut off?

Nope - there's no scrolling.

@summitbri
Copy link

Love the work here. I have a vertical camera (doorbell) with similar issue however I am able to scroll the image within the frame. For my other cameras, the aspect ratio must be slightly different than 16x9 as those images require just a bit of scrolling up and down within the frame. This makes it a bit challenging to scroll through my list of cameras on my phone with a simple swipe.

@dermotduffy
Copy link
Owner

dermotduffy commented Sep 10, 2021

Thanks @summitbri -- I would have expected scrolling like you describe. Would you mind checking the resolution / aspect-ratio of the camera in question? I'd like to come up with a solution that can work more generally that 16 / 9 (so even your 'little scrolling' would ideally be eliminated)

@mt0321
Copy link
Author

mt0321 commented Sep 10, 2021

Ah - correction: There's no scroll bar, but I realized you are right. I can in fact scroll with a mouse wheel on the desktop, or by swiping on the phone. Hope that helps.

@dermotduffy dermotduffy self-assigned this Sep 10, 2021
@summitbri
Copy link

@dermotduffy my cameras are 4:3 (Amcrest). 2592x1944

@dermotduffy
Copy link
Owner

@mt0321 I just noticed your usecase actually has two different aspect ratios in a single camera. I think you're saying your live is 480x704 (really?) and your clips are classic 16/9. Is that right? That fundamentally breaks the assumption there's a single aspect ratio the card can lock to -- what behavior would you expect here? Either the card needs to physically change size (thus pushing other cards around on your dashboard) or we'll need some deadspace in the card for this to be possible to work together.

@dermotduffy dermotduffy changed the title Vertical-oriented camera videos get cut off Support arbitrary aspect-ratio cameras Sep 10, 2021
@mt0321
Copy link
Author

mt0321 commented Sep 10, 2021

Oh, interesting call out.

Within a given card, I think using a single aspect ratio for both live view and clips is a totally fair assumption. I did not mean to ask for the size to change dynamically between the live and clips views. I can definitely see that would increase the scope/effort required.

The main request is to not have to scroll when the height of the video exceeds its width.

your live is 480x704 (really?) and your clips are classic 16/9

Yeah, that is 704x480 D1 resolution rotated 90 degrees, which is a thing Amcrest supports. However I just looked and I think I will be able to change it to one that is the same aspect ratio as the clips (e.g. 1280x720).

@dermotduffy
Copy link
Owner

dermotduffy commented Sep 19, 2021

Quick update on this: This is very much not forgotten, but I'm going to do #78 first, which will make this one easier. My thoughts on this bug are to implement something that either allows the aspect ratio to be forced manually, or (by default) get the aspect ratio dynamically from loaded media (default 16:9 if none is available) -- and use that to control the aspect-ratio of the non-media views (e.g. clips & snapshots gallery).

So, for example, in the very tall screenshot provided at the start of this bug, it would all "just work" and the gallery would also take advantage of the 'tallness' so the card would stay the same size.

@summitbri
Copy link

summitbri commented Sep 19, 2021 via email

@dermotduffy
Copy link
Owner

FYI: This functionality is now pre-released as part of v1.1.0 . Any help to test and report bugs is much appreciated!

@utkarshjain00
Copy link

I can confirm putting aspect_ratio_mode: unconstrained makes the camera view correct. Clicking full screen, however, shows only a portion of the view with a scroll bar.

@dermotduffy
Copy link
Owner

dermotduffy commented Sep 29, 2021

@utkarshjain00

Does the default behavior work? (i.e. aspect_ratio_mode omitted entirely or dynamic).unconstrained should not be necessary, it's more to allow the gallery (and the camera) to expand as much as it wants, but any aspect ratio camera should also "just work" out of the box.

For the fullscreen issue, sounds like a bug -- would you mind reporting it with a screenshot of before/after fullscreen mode, and the OS/browser you're using? Thanks!

@utkarshjain00
Copy link

utkarshjain00 commented Sep 29, 2021 via email

@dermotduffy
Copy link
Owner

Definitely an issue then, dimensions should be autodetected. Please file an issue with enough details so I can try to reproduce, thank you!

@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
4 participants