Page 1 of 1

revVideoGrab for newer Windows webcams (UVC vs VFW)

Posted: Fri Sep 16, 2016 4:54 pm
by Jim Mac
I'm using a webcam to capture images that I then analyze for type, location and legibility of certain features. The system has to run on Windows for the foreseeable future.

I need higher resolution than the 720p webcam I started with in order to have enough resolution to analyze some items I'm looking for so I ordered a nice 5 Meg USB ELP Mini cam from Amazon. It turns out I didn’t do enough due diligence and it uses UVC rather than VFW (which supposedly is now obsolete?). It works using VLC (though I haven't figured out how to change the cam's framerate... a requirement to increase the resolution)

For what I'm doing...... This means the revInitializeVideoGrabber command doesn't actually do what I need it to do. I just get a black image instead of an image from the cam. Ii tried the obvious (and stupid)... replacing "VFW" with "UVC" and killed Livecode. Should have known better. (revInitializeVideoGrabber the short name of this stack, "uvc",the rect of this stack)

While I will probably be able to figure out how able to use a different tool to capture and store the image which I can then open from LC, I'd much prefer to have everything self-contained in my LC app.

1) Has anyone developed an external that interfaces with a UVC camera?
2) Are there any plans to update the revVideo library to work with UVC?
3) Has anyone dealt with this issue before and have any pointers?
4) With the move to AVFoundation on LC for OSX, is QT a dead-end? I have control over the machines I'm using so could theoretically install whatever I need (QT) but: 1) this isn't going t ohelp with this particular cam I don't think and 2) if QT is going away then that's not a long term solution.

Re: revVideoGrab for newer Windows webcams (UVC vs VFW)

Posted: Thu Sep 29, 2016 8:49 am
by rblackmore245
I had to create a application recently using one of these high res china camera's and record @ 1080P livecode could not handle the request.

In the end I had to switch back to a old favourite, ( adobe Director ) and the free xtra DirectShow, created a capture filter in graphedit and was easy able to record and preview live 1080P footage from the USB camera.

LiveCode seems to lack these simple features :(

Re: revVideoGrab for newer Windows webcams (UVC vs VFW)

Posted: Thu Sep 29, 2016 6:31 pm
by Jim Mac
Thanks for the input. I'm very limited in the toolset I can apply so Director is right out.

I'm still working this issue but have a working solution. Just thought I'd share in case someone might be interested. I downloaded a windows app from the camera supplier's website. It allows me to capture both video and still images. I set the preferences to capture the photo at the highest resolution and store it in a specific folder. In Livecode, I have a button that:
1) Reads the list of files from the photo capture folder
2) Launches the cam's capture app
3) Presents a dialog box to "Click" here when photo captured (or Cancel)
4) When clicked, kills the capture app and Re-reads the list of files in the capture folder
5) Grabs the most recent "new" file and loads it into Livecode for analysis.
Definitely would prefer to not have to launch a capture app but this is workable. If an image isn't taken, I know and can react accordingly.

Was thinking of not presenting a dialog for the operator to click when the image is captured and instead just poll the photo folder contents, but decided I should let hem take multiple images until satisfied (in case the cam focus needed to be shifted, etc.)


Re: revVideoGrab for newer Windows webcams (UVC vs VFW)

Posted: Wed Mar 08, 2017 8:04 pm
by Jim Mac
Am back looking at this again. Am very confused @ DirectShow, etc. Has anyone connected to a modern digital microscope through LC on Windows?
I'm left using LC to launch amcap.exe, having the operator "Capture the image" to a known directory, then opening the most recent image in that folder w/Livecode.
Not how it should be.

Re: revVideoGrab for newer Windows webcams (UVC vs VFW)

Posted: Mon Apr 10, 2017 9:57 am
by rblackmore245
Have a look at ffmpeg you can launch this from the shell function it will capture 1080P and also display the preview if required.