openDsh / dash

Join us on Slack! https://join.slack.com/t/opendsh/shared_invite/zt-la398uly-a6eMH5ttEQhbtE6asVKx4Q
GNU General Public License v3.0
238 stars 69 forks source link

Camera scaling #157

Open SkidrowH opened 3 months ago

SkidrowH commented 3 months ago

Hello.

As I understand the camera code currently selects the highest resolution which fits the screen instead of selecting highest that the camera supports and scaling it down. Issue with it is that my cameras full resolution is 1920x1080 but my screen resolution is 1024x600 which basically means that the code currently selects 640x480 and I only get a small part of the camera display.

Right now I'm using v4l2loopback to create a fake video device where I set the fake video device resolution a bit smaller than code selects as display resolution and use command gst-launch-1.0 v4l2src device=/dev/video0 ! "image/jpeg,width=1920,height=1080,framerate=25/1" ! jpegdec ! videoconvert ! videoscale ! tee name=t ! queue ! v4l2sink device=/dev/video5 to take camera full resolution and scale it down to fake video device sinks resolution. As the application also uses gstreamer pipeline I thought that maybe it could be done in code also.

I might have this issue because I use a AHD to USB converter board and digital cameras might do their own scaling if you select a lower resolution.

rsjudka commented 2 months ago

hmm yeah I can see how that's unoptimal here.. definitely something we'll want to look into!