SvenVD / rpisurv

Raspberry Pi surveillance
https://community.rpisurv.net
GNU General Public License v2.0
610 stars 101 forks source link

Maintaining the aspect ratio of the video feeds #137

Closed UntouchedWagons closed 2 years ago

UntouchedWagons commented 2 years ago

I have a Pi 3 with the 7" touchscreen, it has a resolution of 800x480. I want to have two video feeds with aspect ratios of 4:3 displayed side but rpisurv stretches the video feeds to take up the full 480 pixels of height. How do I tell rpisurv to prioritize maintaining the aspect ratio of the feeds?

This is my display1.yml:

essentials:
  screens:
    - camera_streams:
        - url: "rtmp://homeassistant.untouchedwagons.site:1935/live/front_door"
          probe_timeout: 20
        - url: "rtmp://homeassistant.untouchedwagons.site:1935/live/side_door"
          probe_timeout: 20
      nr_of_columns: 2

Would I have to use the force_coordinates directives?

SvenVD commented 2 years ago

Would I have to use the force_coordinates directives?

Yes

or use following trick:

You can configure some dummy image streams ( even local images on sdcard) so that the autocalculation is forced to take them into account and so it also needs to resize the stream you want to have resized to fit everything on the monitor This is not specifically maintaining the aspect ratio, but practically this can be more fast then starting to calculate the coordinates for each stream and still giving a somewhat correct aspect ratio if not the correct aspect ratio.

UntouchedWagons commented 2 years ago

Okay