GithubHelp home page GithubHelp logo

inmotion-health / vidcontrol Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 65 KB

Cross platform multi-webcam video capture utility.

License: MIT License

Python 98.19% Makefile 1.81%
ffmpeg-wrapper imageio python webcam-capture

vidcontrol's People

Contributors

derklinke avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vidcontrol's Issues

Issue with multithreaded access

When accessing a frame of one video source from concurrently executing threads, we get thread race issues. To fix this, we need to implement a locking mechanism.

Crash when trying to open Face Time HD Camera with closed lid

When going over all available cameras, the inbuilt MacBook camera is being detected, but when we try to open it, vidcontrol crashes. How can we handle this more gracefully?

One idea could be to instead of raising an error to quietly accept the camera as not existing and remove it from our list? But then what happens when we open the lid while being used? We then would lose access.

Make webcam detection on macOS more robust

Currently, we are using the FFmpeg command and are parsing its command line output for a list of available webcams and resolutions, this feels more like a hack and not very reliable long term.

Maybe instead can strive to find a more permanent solution, such as directly interfacing with FFmpeg from c++ or talking to AVFoundation.

Test on multiple macOS & Windows Versions

We need to verify that this tool is not just working on the current OS but also older versions. Can we verify this, maybe also through automated testing?

Versions we should test:

  • macOS 10.15 and upwards
  • Windows 8 and upwards

Error when using a specific older webcam

When using an older webcam model, we sometimes get pixel format issues, but not always. We need to investigate this further and find a solution, hard-coding a pixel format seems like a hack.

File "/usr/local/lib/python3.11/site-packages/imageio/v2.py", line 293, in get_reader
    return image_file.legacy_get_reader(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/imageio/core/legacy_plugin_wrapper.py", line 116, in legacy_get_reader
    return self._format.get_reader(self._request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/imageio/core/format.py", line 221, in get_reader
    return self.Reader(self, request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/imageio/core/format.py", line 312, in _init_
    self._open(**self.request.kwargs.copy())
  File "/usr/local/lib/python3.11/site-packages/imageio/plugins/ffmpeg.py", line 343, in _open
    self._initialize()
  File "/usr/local/lib/python3.11/site-packages/imageio/plugins/ffmpeg.py", line 486, in _initialize
    raise IndexError(
IndexError: No (working) camera at <video0>.

Could not load meta information
=== stderr ===

ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.8)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-appkit --enable-avfoundation --enable-coreimage --enable-audiotoolbox
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[avfoundation @ 0x7fea9d808200] Selected pixel format (yuv420p) is not supported by the input device.
[avfoundation @ 0x7fea9d808200] Supported pixel formats:
[avfoundation @ 0x7fea9d808200]   uyvy422
[avfoundation @ 0x7fea9d808200]   yuyv422
[avfoundation @ 0x7fea9d808200]   nv12
[avfoundation @ 0x7fea9d808200]   0rgb
[avfoundation @ 0x7fea9d808200]   bgr0

What webcam model does this fail on? Which version of FFmpeg are we using?

Make resolution and FPS detection more robust

While currently we have a working automatic detection of the resolution and frame rate we want to use for the stream via a preferred height, we need to make this more robust and handle more edge cases:

  • what do we do when the preferred height does not exist? We could get the closest available and throw a warning
  • we should also be able to set a preferred frame rate

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.