Giter VIP home page Giter VIP logo

focusuf's Introduction

FocusUF

Command line tool for locking the focus of a Microsoft® LifeCam HD-5000 webcam any webcam that supports IAMCameraControl control interface from DirectShowLib.

The LifeCam HD-5000 webcam is a decent webcam with an annoying feature. The autofocus keeps shifting the focus around if you move your head slightly. When you are in a video chat with someone, this can get annoying for the other viewers. Your face will shift in and out of focus.

FocusUF uses the DirectShowLib library library to provide easy access to the focus control of the webcam. The DirectShowLib library maps the DirectShow Interfaces for use from a .NET app. The app is hard coded to connect to a LifeCam HD-5000, but it would be easy enough to change the code for other webcam. You can now specify the webcam by name or partial name.

The code was written with Visual Studio 2017 and revised with Visual Studio 2019, it has not been tested with any other compiler.

Note

I have added a Windows command line executable, in a zip file in the win32 folder. This exe is not supported, it's supplied as is.

How to use

Launch the app that will be using the webcam. Wait until it is in focus and then run FocusUF. It will detect the webcam and flip the autofocus setting to manual and lock it to the current focus setting. The setting will persist until the webcam is reset or another app changes the focus setting.

Thanks to the changes submitted by @cainhopwood, we have command line options to that let you select a webcam by name or partial name. You also have the ability to set the exposure and focus by value. Use the --list-cameras to get the list of webcams and the values supported for focus and exposure.

Usage: FocusUF [--help | -?] [--list-cameras | -l]
               [--focus-mode-manual | -fm] [--focus-mode-auto | -fa]
               [--set-focus <value> | -f <value>]
               [--exposure-mode-manual | -em] [--exposure-mode-auto | -ea]
               [--set-exposure <value> | -e <value>]
               [--camera-name <name> | -n <name>]

I added to the change making the camera name case insensitive. The code will skip over virtual web cams.

The name "FocusUF" is a tip of the hat to the YouTube channel AvE, where the host uses the phrase "Focus You F@*&" whenever his video camera loses focus.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.