azeam / camset Goto Github PK
View Code? Open in Web Editor NEWGUI for v4l2-ctl
License: GNU General Public License v3.0
GUI for v4l2-ctl
License: GNU General Public License v3.0
Hi, thanks for the release. I'm currently working on context-aware video encoding which aims at setting different QPs for different area within frame to be encoded according to grayscale saliency map where white areas indicate ROI areas. Now I'm struggling at how to implement context-aware encoding in V4L2. Any advices would be very appritiated.
Love the GUI, just a tweak/enhancement request: could we have the exposure (Absolute) slide bar be confined to values between 0 and 20%? I just need to tweak it throughout the day between 3 and 8%, but can't get fine grained control with the current 0 to 100% scale. Maybe there could be an additional option if folks really need more than 20% exposure. Thanks!
I'm using a Logitech C920. After running camset, or when trying to view the video feed, I get this error:
Traceback (most recent call last):
File "/home/me/build/camset/env/lib/python3.6/site-packages/camset/camset.py", line 231, in on_output_combo_changed
list = get_video_resolution()
File "/home/me/build/camset/env/lib/python3.6/site-packages/camset/camset.py", line 70, in get_video_resolution
fourcode = cv2.VideoWriter_fourcc('{}'.format(pixelformat))
TypeError: Required argument 'c2' (pos 2) not found
When camset tries to get the resolution (the first step in displaying the feed), it doesn't get a fourcc code.
Lines 62 to 71 in ac8140a
After getting the model:
pixelformat = ''
(an empty string) because:
text[0].split(" - ", 1) = ['', '1920x1080']
Manually set the fourcode to:
fourcode = cv2.VideoWriter_fourcc('M','J','P','G')
VIDIOC_S_FMT: failed: Device or resource busy
Traceback (most recent call last):
File "/home/me/build/camset/env/lib/python3.6/site-packages/camset/camset.py", line 232, in on_output_combo_changed
start_camera_feed(list[0], list[1], list[2], list[3])
File "/home/me/build/camset/env/lib/python3.6/site-packages/camset/camset.py", line 30, in start_camera_feed
subprocess.run(['v4l2-ctl', '-d', card, '-v', 'height={0},width={1},pixelformat={2}'.format(vfeedheight, vfeedwidth, pixelformat)], check=True, universal_newlines=True)
File "/usr/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['v4l2-ctl', '-d', '/dev/video0', '-v', 'height=1080,width=1920,pixelformat=']' returned non-zero exit status 255.
Simply adding a try/except around:
Line 30 in ac8140a
For example:
try:
subprocess.run(['v4l2-ctl', '-d', card, '-v', 'height={0},width={1},pixelformat={2}'.format(vfeedheight, vfeedwidth, pixelformat)], check=True, universal_newlines=True)
except subprocess.CalledProcessError:
print("It's okay!")
results in:
VIDIOC_S_FMT: failed: Device or resource busy
It's okay!
Maybe it could check to see if an error occurs, and if it does, not open the video feed.
Also, might be worth considering not opening up the video feed by default on open?
Hey there, the camset Windows doesnt fit on a vertical screen, or better said doesnt crop at all...
What's the name of this application? 😜
Guessing Camtest was a placeholder name when you started developing this?
Lines 218 to 222 in 022cc73
Hello!
So, after many researching I came up to camset that will solve my problems for sure. But as the title says, it is getting stuck at "Installing building dependencies"
I have to tell you also that I am try to install on a Raspberry Pi 3b+. Maybe that is the reason?
Is there any other way? I think the problem is with opencv, but I already have a version installed. Can I ignore on the installation?
Sorry if I asked something stupid, I'm unexperienced on this.
Starting camset via program's menu in linux fails.
This is due to: camset is installed in /home/[[myuser]]/.local/bin/camset. But the program starting file "camset.desktop" has in line 4 something like
Exec=/usr/bin/camset
Changing that line 4 to
Exec=.local/bin/camset
helps.
I use camset to change values of my camera during running video conferences, like changing white balance to manual, etc.
However, when I open camset (and change to my camera) I get an error because the device is already in use since a video stream is running:
If I confirm the dialog, I am able to change the values as needed, adjusting my currently running feed.
It would be great to have a way to start camset with the video streams off by default, like --no-camera-feed-by-default
or something, so that I don't have to confirm the dialog all the time.
Or, even better, it would be nice if camset would just show a passive warning, without me needing to confirm that.
Thanks a lot for camset - I could successfully install it on a debian and really like it.
When trying to install it on a ubuntu machine, I got this:
~$ pip3 install camset
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in
sys.exit(main())
File "/home/sina/.local/lib/python3.5/site-packages/pip/init.py", line 12, in main
from pip._internal.utils.entrypoints import _wrapper
File "/home/sina/.local/lib/python3.5/site-packages/pip/_internal/utils/entrypoints.py", line 4, in
from pip._internal.cli.main import main
File "/home/sina/.local/lib/python3.5/site-packages/pip/_internal/cli/main.py", line 58
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
~$
(I did "pip3 install --upgrade setuptools pip" before, as I needed to do so for my installation on debian)
Configuration is not stored permanently so whenever I have to use the camera I need to open camset and change options.
Could you change Camset so settings are stored forever? Maybe adding a "Store permanently" button.
Steps to reproduce:
Settings went to default :'(
Thanks for the app!
I'm using Ubuntu 23.04, and I have a laptop webacm, Droidcam, and a USB webcam (which is the one I want to configure). When I run camset
I'm unable to use the GUI. This is the output of the command:
Unable to detect what device /dev/media1 is, exiting.
Unable to detect what device /dev/media0 is, exiting.
[ WARN:[email protected]] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[ WARN:[email protected]] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[ WARN:[email protected]] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[ WARN:[email protected]] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[ WARN:[email protected]] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[ WARN:[email protected]] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[ WARN:[email protected]] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[ WARN:[email protected]] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[ WARN:[email protected]] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[ WARN:[email protected]] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
This sure would make it easier to choose the right camera. v4l2 gives this info, and it's shown in camset's title bar after one selects the camera. Yes it will take up more UI space but it would be quite worth it in the time saved -- right now I typically just go through all the devices in the drop-down, hunting for the one I'm using. It would also be super useful if you could filter out, or at least label, the metadata virtual devices, which are not meaningful to use in camset. Thanks for making a free and useful thing!
Attempted install fails with either pip
or pipx
to install on Ubuntu 20.04. I'm using pyenv to manage my user python.
Note: I understand this is an issue with pycairo and not camset however it would benefit users of camset to figure this out and add a workaround or fix to the readme. I've spent a small amount of time attempting to debug the issue (installing dependencies and other ideas I found via Googling). Ended up just using v4l2-ctl
to solve my immedate need but I'd much rather use Camset in the future.
pip(x) install camset
to successfully install application.
kwhatcher@kwhatcher-Precision-7710:~$ pipx install camset
ERROR: Command errored out with exit status 1:
command: /home/kwhatcher/.local/pipx/venvs/camset/bin/python /home/kwhatcher/.local/pipx/shared/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-_q6emlf5/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo
cwd: None
Complete output (38 lines):
Collecting setuptools
Using cached setuptools-50.3.2-py3-none-any.whl (785 kB)
Collecting wheel
Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
Collecting pycairo
Using cached pycairo-1.20.0.tar.gz (344 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
Building wheels for collected packages: pycairo
Building wheel for pycairo (PEP 517): started
Building wheel for pycairo (PEP 517): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /home/kwhatcher/.local/pipx/venvs/camset/bin/python /home/kwhatcher/.local/pipx/shared/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpvwcx2zh3
cwd: /tmp/pip-install-v_y642_k/pycairo
Complete output (15 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/cairo
copying cairo/__init__.py -> build/lib.linux-x86_64-3.8/cairo
copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.8/cairo
copying cairo/py.typed -> build/lib.linux-x86_64-3.8/cairo
running build_ext
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for pycairo
Failed to build pycairo
ERROR: Could not build wheels for pycairo which use PEP 517 and cannot be installed directly
----------------------------------------
ERROR: Command errored out with exit status 1: /home/kwhatcher/.local/pipx/venvs/camset/bin/python /home/kwhatcher/.local/pipx/shared/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-_q6emlf5/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo Check the logs for full command output.
Error installing camset.
kwhatcher@kwhatcher-Precision-7710:~$ pip install camset
Collecting camset
Using cached camset-0.0.11-py3-none-any.whl (66 kB)
Collecting opencv-python
Using cached opencv_python-4.4.0.46-cp38-cp38-manylinux2014_x86_64.whl (49.5 MB)
Collecting PyGObject
Using cached PyGObject-3.38.0.tar.gz (712 kB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: /home/kwhatcher/.pyenv/versions/3.8.3/bin/python3 /home/kwhatcher/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-p9_85o11/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo
cwd: None
Complete output (38 lines):
Collecting setuptools
Using cached setuptools-50.3.2-py3-none-any.whl (785 kB)
Collecting wheel
Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
Collecting pycairo
Using cached pycairo-1.20.0.tar.gz (344 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
Building wheels for collected packages: pycairo
Building wheel for pycairo (PEP 517): started
Building wheel for pycairo (PEP 517): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /home/kwhatcher/.pyenv/versions/3.8.3/bin/python3 /home/kwhatcher/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpz99nsbo4
cwd: /tmp/pip-install-xgfrb23z/pycairo
Complete output (15 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/cairo
copying cairo/__init__.py -> build/lib.linux-x86_64-3.8/cairo
copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.8/cairo
copying cairo/py.typed -> build/lib.linux-x86_64-3.8/cairo
running build_ext
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for pycairo
Failed to build pycairo
ERROR: Could not build wheels for pycairo which use PEP 517 and cannot be installed directly
----------------------------------------
ERROR: Command errored out with exit status 1: /home/kwhatcher/.pyenv/versions/3.8.3/bin/python3 /home/kwhatcher/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-p9_85o11/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo Check the logs for full command output.
I just installed camset and received version 0.0.3, ̶n̶o̶t̶ ̶s̶u̶r̶e̶ ̶w̶h̶y̶ ̶I̶ ̶d̶i̶d̶n̶'̶t̶ ̶g̶e̶t̶ ̶0̶.̶0̶.̶5̶** but that's irrelevant as this would still effect the latest version. After running, I got this error:
Traceback (most recent call last):
File "/home/me/.local/bin/camset", line 11, in <module>
sys.exit(main())
File "/home/me/.local/lib/python3.6/site-packages/camset/camset.py", line 228, in main
check_devices()
File "/home/me/.local/lib/python3.6/site-packages/camset/camset.py", line 197, in check_devices
devices = subprocess.run(['v4l2-ctl', '--list-devices'], check=True, text=True, stdout=subprocess.PIPE)
File "/usr/lib/python3.6/subprocess.py", line 423, in run
with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'text'
The reason for the error was because I was running Python 3.6.9 (so close!) and according to the subprocess docs:
Changed in version 3.7: Added the text parameter, as a more understandable alias of universal_newlines. Added the capture_output parameter.
Either upgrading to Python 3.7+ or doing a find-and-replace on camset.py and changing text=True
to universal_newlines=True
It's stated in the package that it requires Python >=3.7 so I guess this isn't really a bug, but a small change* to using universal_newlines
would allow a load of other people to use this software without running into this.
* I can't believe I'm suggesting this by the way! I'm usually the one shouting "out with the old, in with the new"
** Before 935e750 (version 0.0.4) any Python 3 version was "supported" so I was given the latest version that Pip reckoned I could use
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.