dge8 / CameraRotateTool

An interactive Powershell script for rotating UVC camera feeds (e.g. USB webcams) on Windows 10
MIT License
10 stars 3 forks source link

CameraRotateTool

What is CameraRotateTool?

CameraRotateTool is an unimaginatively named interactive PowerShell script for rotating UVC video feeds on Windows 10. It works by setting keys in the registry that tell the Windows UVC camera pipeline to rotate the camera feed, and so should work for most modern Windows apps using without requiring any running software in the background.

How do I use it?

Download the latest release file on the right, and Right-Click > Run with PowerShell. It should automatically request escalation to admin privileges.

Will it work for me?

Maybe. Some apps (especially older ones) ignore rotation information provided by Windows with the camera feed and/or use different Windows APIs for video and/or just do their own thing.

It's been tested with the Windows Camera app and Zoom on Windows 10 2004 and 20H2 64-bit and the following cameras:

If it doesn't work for you, feel free to create a new issue. I will probably not be able to help you, but someone else may have a similar issue and be able to help. Perhaps there are KSCATEGORYs that are used by different cameras/software that have been missed.

How does it work? Can I rotate my camera without using this script?

Yes, you need to create one or more FSSensorOrientation registry keys as per this Microsoft doc. The FSSensorOrientation registry key is a DWORD value with decimal 0, 90, 180, or 270 corresponding to the camera correction. Deleting the key also corresponds to 0 degrees.

Start by navigating to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\ in the Registry Editor. Look inside the following keys in turn (your camera may not appear in all of them):

Look through subkeys (two levels) of these to find the 'Device Parameters' key containing a FriendlyName with your camera name. If you have multiple subkeys with the same FriendlyName you can instead match the path to the InstanceID of your camera in the Device Manager. Create the FSSensorOrientation key adjacent to the FriendlyName key. Then repeat for the other KSCATEGORY keys above.

Roadmap and Contributions

CameraRotateTool is already essentially feature-complete, but if you know of other registry keys that cause Windows to do useful things to the camera pipeline please feel free to suggest them in an issue or via email.

License

CameraRotateTool is released under the MIT license, see LICENSE.