geerlingguy / pi-webcam

Automation to configure a Raspberry Pi as a USB OTG webcam
https://www.youtube.com/watch?v=8fcbP7lEdzY
MIT License
1.4k stars 98 forks source link

camera rotation #16

Closed mdinata closed 3 years ago

mdinata commented 3 years ago

First, thanks for simplifying the process and awesome tutorial on youtube. It works in Pi0W without any problems. I use Pi0 case which position the case in the up-right to get the picture in the right orientation. Physical camera rotation is not possible considering how the camera module is fitted in the case. Would u please share how to rotate the camera orientation from configuration so i can put the camera sideways (USB cable from below).

Thank you

trek2710 commented 3 years ago

I believe adding this line to the file /uvc-gadget/piwebcam just after the other v4l-ctl control options should rotate the picture 90 degrees

/usr/bin/v4l2-ctl -c rotate=90
geerlingguy commented 3 years ago

@trek2710 - If that option works—I wonder if setting rotate=0 would be a good default (so people searching the code for rotate would at least find it and be able to change it to 90, 180, etc.)?

aejrussin commented 3 years ago

The issue is that the user won't know what the rotation is until they plug it in. Are there any edits they can make to the config file?

doctorleach commented 3 years ago

The option does work, BTW.

stale[bot] commented 3 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

Absynth723 commented 3 years ago

I'd vote for including this option somehow in the installation process (either by clearly documenting it or by making it configurable in the playbook). I have a Zero W in the official case and I had exactly this issue. In an ideal world, the camera would notice its own orientation, but that doesn't work in an environment without orientation sensor.

stale[bot] commented 3 years ago

This issue is no longer marked for closure.

stale[bot] commented 3 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 3 years ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.