cmauri / eviacam

webcam based mouse emulator
GNU General Public License v3.0
146 stars 39 forks source link

cvCreateCameraCapture doesn't support legacy API anymore. #22

Open l29ah opened 4 years ago

l29ah commented 4 years ago

When i run eviacam against opencv-4.1.2 the following occurs

[ WARN:0] global /var/tmp/portage/media-libs/opencv-4.1.2-r1/work/opencv-4.1.2/modules/videoio/src/videoio_c.cpp (15) cvCreateCameraCapture cvCreateCameraCapture doesn't support legacy API anymore.

and eviacam exits.

adrianmay commented 4 years ago

I get that too

cmauri commented 4 years ago

It seems that newer opencv does not support cvCreateCameraCapture function anymore.

In this post you'll find an example of how to capture video using the new API

You can also try changing viacamcontroller.cpp:252 from this:

CCamera* cam = CCameraEnum::getCamera(1, camId);

to this:

CCamera* cam = CCameraEnum::getCamera(0, camId);

skozlovski commented 4 years ago

That stopped the error, but the application still does not run.

skozlovski commented 4 years ago

Let me add some more details. I have used this app under Ubuntu 19.10 just from apt-get and it worked great. After 20.04 update the application had to be reinstalled and it is now generates the error about the Legacy API no supported (as per title of the thread). I have downloaded the code and compiled it with the suggested changes. While the application does not throw this error, it doesn't run and just exits. I have tried to compile from code under 19.10 and the build works there. So, I am asking if the support for Ubuntu 20.04 can be integrated as 19.10 has only few weeks of life cycle left, and any new installes will no longer be able use this app. Thank you.

SergeyRom-23 commented 4 years ago

I faced a similar problem too. linux-mint 20 xfce. I install from the repository, but on startup it writes an error: (eviacam:26084): Gtk-CRITICAL **: 19:09:00.290: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar [ WARN:0] global ../modules/videoio/src/videoio_c.cpp (15) cvCreateCameraCapture cvCreateCameraCapture doesn't support legacy API anymore. I did a debug, and I attach it in a file. debag.txt This is the program I want, but I cannot run it. As you said to do this I did not find where it is. And I am not a strong expert on this code. _ If you can tell me how to fix it, thanks in advance. This program can help people with disabilities, and more than one. thank.

Marty commented 3 years ago

I just found this wonderful tool and get the same error :(

adrianmay commented 3 years ago

I wrote a separate program on the same principle but this approach of using a Haar cascade results in loads of jitter. You can't really work that way.

I also tried sucking the motion vectors out of the mpeg which was even worse.

I'm now wearing a crash-test-dummy-style headband which works very well and also caters for a lot of amusement in video calls.

On Fri, 23 Jul 2021 at 10:35, Martin McFly @.***> wrote:

I just found this wonderful tool and get the same error :(

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cmauri/eviacam/issues/22#issuecomment-885519049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARMR4AXT366D2FJ7YBDUTTZEZXNANCNFSM4JU4AUXA .

rlopes528 commented 3 years ago

I'm desperately needing to use this I hope this can be fixed because many people like me are in need of a way to use their computers hands-free

adrianmay commented 3 years ago

My thing only works on Linux with Nvidia, and even then you'd have to tweak it and make a headband. I'll try to find some time to polish it up.

On Thu, 29 Jul 2021, 13:57 rlopes528, @.***> wrote:

I'm desperately needing to use this I hope this can be fixed because many people like me are in need of a way to use their computers hands-free

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cmauri/eviacam/issues/22#issuecomment-889120501, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARMR3TRRUR7CV7OWC52QDT2FF23ANCNFSM4JU4AUXA .

l29ah commented 3 years ago

I'm desperately needing

You may like https://www.bountysource.com/ then.

rlopes528 commented 3 years ago

anybody with that kind of money screw up

I'm desperately needing

You may like https://www.bountysource.com/ then.

Right, if I had that kind of money

rlopes528 commented 3 years ago

My thing only works on Linux with Nvidia, and even then you'd have to tweak it and make a headband. I'll try to find some time to polish it up.

This is great, you should publish it

adrianmay commented 3 years ago

Why do you need to use it hands-free? Is this an impairment? If so, please give details cos people need to know what alternatives you'd also be impaired from using.

On Thu, 29 Jul 2021, 13:57 rlopes528, @.***> wrote:

I'm desperately needing to use this I hope this can be fixed because many people like me are in need of a way to use their computers hands-free

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cmauri/eviacam/issues/22#issuecomment-889120501, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARMR3TRRUR7CV7OWC52QDT2FF23ANCNFSM4JU4AUXA .

rlopes528 commented 3 years ago

that's right, I have very limited movement in my arms and I can't use my fingers to click. using head movements will be perfect.

adrianmay commented 3 years ago

Would it be practical for you to print out an image I define and stick it on a headband or hat?

On Fri, 30 Jul 2021, 13:20 rlopes528, @.***> wrote:

that's right, I have very limited movement in my arms and I can't use my fingers to click. using head movements will be perfect.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cmauri/eviacam/issues/22#issuecomment-889855805, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARMRZEDHGPY2FUWGB5U4DT2KKIZANCNFSM4JU4AUXA .

adrianmay commented 3 years ago

For clicking, I use keyboard mappings, which obviously wouldn't work for you. I'm thinking about lip gestures, e.g., you'd mouth "ee" for a left click and "oo" for a right click, but I suspect you're using speech recognition on this computer already so that wouldn't be an option. Right?

On Sat, 31 Jul 2021, 09:43 Adrian May, @.***> wrote:

Would it be practical for you to print out an image I define and stick it on a headband or hat?

On Fri, 30 Jul 2021, 13:20 rlopes528, @.***> wrote:

that's right, I have very limited movement in my arms and I can't use my fingers to click. using head movements will be perfect.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cmauri/eviacam/issues/22#issuecomment-889855805, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARMRZEDHGPY2FUWGB5U4DT2KKIZANCNFSM4JU4AUXA .

rlopes528 commented 3 years ago

Would it be practical for you to print out an image I define and stick it on a headband or hat? On Fri, 30 Jul 2021, 13:20 rlopes528, @.***> wrote: that's right, I have very limited movement in my arms and I can't use my fingers to click. using head movements will be perfect. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#22 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARMRZEDHGPY2FUWGB5U4DT2KKIZANCNFSM4JU4AUXA .

For sure! Anything that works is very welcome

rlopes528 commented 3 years ago

For clicking, I use keyboard mappings, which obviously wouldn't work for you. I'm thinking about lip gestures, e.g., you'd mouth "ee" for a left click and "oo" for a right click, but I suspect you're using speech recognition on this computer already so that wouldn't be an option. Right? On Sat, 31 Jul 2021, 09:43 Adrian May, @.> wrote: Would it be practical for you to print out an image I define and stick it on a headband or hat? On Fri, 30 Jul 2021, 13:20 rlopes528, @.> wrote: > that's right, I have very limited movement in my arms and I can't use my > fingers to click. > using head movements will be perfect. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <#22 (comment)>, or > unsubscribe > https://github.com/notifications/unsubscribe-auth/AAARMRZEDHGPY2FUWGB5U4DT2KKIZANCNFSM4JU4AUXA > . >

Yes, I'm using Voice Rec now. It's a Chrome extension, but it obviously only works with Chrome.

adrianmay commented 3 years ago

Can you wink with both eyes independently?

On Sat, 31 Jul 2021, 13:46 rlopes528, @.***> wrote:

For clicking, I use keyboard mappings, which obviously wouldn't work for you. I'm thinking about lip gestures, e.g., you'd mouth "ee" for a left click and "oo" for a right click, but I suspect you're using speech recognition on this computer already so that wouldn't be an option. Right? On Sat, 31 Jul 2021, 09:43 Adrian May, @.

> wrote: … <#m-8183585021475224919> Would it be practical for you to print out an image I define and stick it on a headband or hat? On Fri, 30 Jul 2021, 13:20 rlopes528, @.> wrote: > that's right, I have very limited movement in my arms and I can't use my > fingers to click. > using head movements will be perfect. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <#22 (comment) https://github.com/cmauri/eviacam/issues/22#issuecomment-889855805>, or

unsubscribe > https://github.com/notifications/unsubscribe-auth/AAARMRZEDHGPY2FUWGB5U4DT2KKIZANCNFSM4JU4AUXA . >

Yes, I'm using Voice Rec now. It's a Chrome extension, but it obviously only works with Chrome.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cmauri/eviacam/issues/22#issuecomment-890343302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARMRZ647HSXGODURZA4J3T2PWD5ANCNFSM4JU4AUXA .

adrianmay commented 3 years ago

It just occurred to me that there's a completely different approach to this: attach a smartphone to your head using some kind of hat and use its accelerometer and gyroscope. They seem to be very accurate. Does that sound practical?

On Sat, 31 Jul 2021, 14:04 Adrian May, @.***> wrote:

Can you wink with both eyes independently?

On Sat, 31 Jul 2021, 13:46 rlopes528, @.***> wrote:

For clicking, I use keyboard mappings, which obviously wouldn't work for you. I'm thinking about lip gestures, e.g., you'd mouth "ee" for a left click and "oo" for a right click, but I suspect you're using speech recognition on this computer already so that wouldn't be an option. Right? On Sat, 31 Jul 2021, 09:43 Adrian May, @.

> wrote: … <#m_3248679360202238638m-8183585021475224919_> Would it be practical for you to print out an image I define and stick it on a headband or hat? On Fri, 30 Jul 2021, 13:20 rlopes528, @.> wrote: > that's right, I have very limited movement in my arms and I can't use my > fingers to click. > using head movements will be perfect. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <#22 (comment) https://github.com/cmauri/eviacam/issues/22#issuecomment-889855805>, or > unsubscribe > https://github.com/notifications/unsubscribe-auth/AAARMRZEDHGPY2FUWGB5U4DT2KKIZANCNFSM4JU4AUXA

. >

Yes, I'm using Voice Rec now. It's a Chrome extension, but it obviously only works with Chrome.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cmauri/eviacam/issues/22#issuecomment-890343302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARMRZ647HSXGODURZA4J3T2PWD5ANCNFSM4JU4AUXA .

rlopes528 commented 3 years ago

Can you wink with both eyes independently? On Sat, 31 Jul 2021, 13:46 rlopes528, @.**> wrote: For clicking, I use keyboard mappings, which obviously wouldn't work for you. I'm thinking about lip gestures, e.g., you'd mouth "ee" for a left click and "oo" for a right click, but I suspect you're using speech recognition on this computer already so that wouldn't be an option. Right? On Sat, 31 Jul 2021, 09:43 Adrian May, @. > wrote: … <#m-8183585021475224919> Would it be practical for you to print out an image I define and stick it on a headband or hat? On Fri, 30 Jul 2021, 13:20 rlopes528, @.*> wrote: > that's right, I have very limited movement in my arms and I can't use my > fingers to click. > using head movements will be perfect. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <#22 (comment) <#22 (comment)>>, or > unsubscribe > https://github.com/notifications/unsubscribe-auth/AAARMRZEDHGPY2FUWGB5U4DT2KKIZANCNFSM4JU4AUXA > . > Yes, I'm using Voice Rec now. It's a Chrome extension, but it obviously only works with Chrome. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#22 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARMRZ647HSXGODURZA4J3T2PWD5ANCNFSM4JU4AUXA .

yes I can do that

rlopes528 commented 3 years ago

It just occurred to me that there's a completely different approach to this: attach a smartphone to your head using some kind of hat and use its accelerometer and gyroscope. They seem to be very accurate. Does that sound practical? On Sat, 31 Jul 2021, 14:04 Adrian May, @.> wrote: Can you wink with both eyes independently? On Sat, 31 Jul 2021, 13:46 rlopes528, @.> wrote: > For clicking, I use keyboard mappings, which obviously wouldn't work for > you. I'm thinking about lip gestures, e.g., you'd mouth "ee" for a left > click and "oo" for a right click, but I suspect you're using speech > recognition on this computer already so that wouldn't be an option. Right? > On Sat, 31 Jul 2021, 09:43 Adrian May, @. > > > wrote: … <#m_3248679360202238638m-8183585021475224919_> Would it be > practical for you to print out an image I define and stick it on a headband > or hat? On Fri, 30 Jul 2021, 13:20 rlopes528, @.> wrote: > that's > right, I have very limited movement in my arms and I can't use my > fingers > to click. > using head movements will be perfect. > > — > You are receiving > this because you commented. > Reply to this email directly, view it on > GitHub > <#22 (comment) > <#22 (comment)>>, > or > unsubscribe > > https://github.com/notifications/unsubscribe-auth/AAARMRZEDHGPY2FUWGB5U4DT2KKIZANCNFSM4JU4AUXA > > . > > > Yes, I'm using Voice Rec now. It's a Chrome extension, but it obviously > only works with Chrome. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <#22 (comment)>, or > unsubscribe > https://github.com/notifications/unsubscribe-auth/AAARMRZ647HSXGODURZA4J3T2PWD5ANCNFSM4JU4AUXA > . >

I'm really impressed with the ideas that you come with ! I would never have thought about this. unfortunately that's not possible for me because there is an issue with EMF. I have studied the subject and I think it will be very harmful to have your phone on your head

Samoticha commented 3 years ago

I have the same error @ Ubuntu 20.04 and need it to control my computer! Can anyone help?

sanity commented 2 years ago

Same error on Ubuntu 21.10 :(

steven2308 commented 1 year ago

Also on Ubuntu 22.04. What a pity :cry:

[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x00980001, name = 'User Controls'
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A0001, name = 'Camera Controls', type = 6
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A0001, name = 'Camera Controls'
[ WARN:0] global ./modules/videoio/src/videoio_c.cpp (15) cvCreateCameraCapture cvCreateCameraCapture doesn't support legacy API anymore.
gantheaume commented 1 year ago

This commit: https://github.com/cmauri/eviacam/commit/a4032ed9c59def5399a93e74f5ea84513d2f42b1 actually solves the problem of the opencv legacy API not being supported anymore. Sadly, it wasn't in my Debian (Bullseye - stable) repository (which is totally normal - setting it up in backports would be a cool thing to do, but I'm not competent enough yet).

So I compiled and installed from source. Under is what I did, if it can help someone (on Debian and maybe Ubuntu). I'm not saying it's the best way of doing it, but it works for me ;) (especially as there are specific instructions to create a .deb install package in the INSTALL file in source. But I kept having errors: "gpg2 command not found" - then after I created a symlink "rm: cannot remove 'po/stamp-po'" and "dpkg-buildpackage: error: failed to sign .dsc file").

So I decided to do it the classical way. First, I needed a few things: sudo apt install git gcc checkinstall #checkinstall is not mandatory, but allows a cleaner install. You may need more packages, what I needed was mostly already installed for me.

Then the dependencies specific to compiling eviacam: sudo apt install libopencv-dev libpng-dev libv4l-dev libwxgtk3.0-gtk3-dev libgtk-3-dev libxtst-dev Just in case, if dependencies are still missing, you could do: sudo apt build-dep eviacam It normally installs all packages needed to build the package.

Then in my working folder, I did:

git clone https://github.com/cmauri/eviacam
cd eviacam

I then followed the basic instructions in the "INSTALL" file in the directory, except for the last step, which allows me to create a deb package to install and easy to remove if needed, instead of installing directly. It's thus much cleaner: https://wiki.debian.org/CheckInstall

./autogen.sh
./configure
make
sudo checkinstall --install=no #this is the special step

--install=no is to instruct it not to install the deb package automatically, but you can skip that.

Then I followed the on-screen instructions: I asked if I wanted to create package docs, it asked for a few description lines, I added those even if I guess I could have skipped. I then had the "Warning: The package version is not a debian policy compliant one. Please specify an alternate one" showing me a weird identical 11 lines version number. So I entered as a version number 2.1.4-1.1 Then enter, and it created the .deb package. I then installed it: sudo apt install ./eviacam_2.1.4-1.1-1_amd64.deb Eviacam now worked !

As I had this error: "bash: /usr/bin/eviacam: No such file or directory" I created a symlink to the binary where it had installed (found it with whereis eviacam) sudo ln -s /usr/local/bin/eviacam /usr/bin/eviacam You may need to manually add the program in your start menu to see it there too, but it should now start from any terminal.

If you messed up the version number you may need to set eviacam from the distribution repo on hold, to avoid having your custom install overwritten the next time the computer updates. Use with care as when there is the proper update, you won't get it. sudo apt-mark hold eviacam But in my case it wasn't needed.

If you need to learn a bit more on how to compile from source on debian, there is a great wiki page: https://wiki.debian.org/BuildingTutorial And more in detail I guess: https://www.debian.org/doc/manuals/maint-guide/index.en.html Or rather: https://www.debian.org/doc/manuals/debian-handbook/index.en.html