inmotion-health / vidcontrol Goto Github PK
View Code? Open in Web Editor NEWCross platform multi-webcam video capture utility.
License: MIT License
Cross platform multi-webcam video capture utility.
License: MIT License
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.
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.
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.
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:
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?
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:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.