revVideoGrab for newer Windows webcams (UVC vs VFW)

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
Jim Mac
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 22
Joined: Wed Jun 28, 2006 9:22 pm

revVideoGrab for newer Windows webcams (UVC vs VFW)

Post by Jim Mac » Fri Sep 16, 2016 4:54 pm

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.

Questions:
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.

rblackmore245
Posts: 67
Joined: Fri Jun 12, 2015 9:42 am

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

Post by rblackmore245 » Thu Sep 29, 2016 8:49 am

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 :(

Jim Mac
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 22
Joined: Wed Jun 28, 2006 9:22 pm

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

Post by Jim Mac » Thu Sep 29, 2016 6:31 pm

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.)

J

Jim Mac
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 22
Joined: Wed Jun 28, 2006 9:22 pm

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

Post by Jim Mac » Wed Mar 08, 2017 8:04 pm

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.

rblackmore245
Posts: 67
Joined: Fri Jun 12, 2015 9:42 am

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

Post by rblackmore245 » Mon Apr 10, 2017 9:57 am

Have a look at ffmpeg you can launch this from the shell function it will capture 1080P and also display the preview if required.

Post Reply

Return to “Windows”