Author Topic: Live Video  (Read 8265 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Live Video
« on: October 05, 2015, 04:53:56 AM »
This control will show a live video from a webcam or video capture device. It has been tested using a GrabBee Deluxe to display from a composite video source.

The control is based on DirectShow.net library, so it takes a few extra steps to install.

- Download the DirectShowLib-2005.dll library from here:
https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/Misc

- In Solution Explorer, right click AdvancedHMIControls\Support directory and select Add->Existing Item
- Change the filter to All Files (*.*)
- Browse to and select DirectShowLib-2005.dll
- In Solution Explorer, Right Click the AdvancedHMIControls project and select Add->Reference
- Browse to AdvancedHMIControls\Support and select DirectShowLib-2005.dll

- Download the attached LiveVideo.vb file
- In Solution Explorer, Right Click AdvancedHMIControls\PurchasedControls and select Add->Existing Item
- Browse to and select LiveVideo.vb
- Build the solution

You will now have a LiveVideo control in your Toolbox that can be added to the form.

If your PC has more than one video device and the display is from the wrong device, increment the VideoDeviceIndex property until you get the right video feed.
« Last Edit: October 05, 2015, 05:00:45 AM by Archie »

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Live Video
« Reply #1 on: October 07, 2015, 08:45:51 PM »
It has been tested using a GrabBee Deluxe to display from a composite video source.

I just tried it with a cheapie Conexant Polaris USB audio/video capture with a really cheap EBay bullet camera.

Good color picture & not too hard to setup.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Live Video
« Reply #2 on: October 07, 2015, 09:17:24 PM »
I just tried it with a cheapie Conexant Polaris USB audio/video capture with a really cheap EBay bullet camera.

Good color picture & not too hard to setup.
Where can you get the capture device? I did a quick Google search and didn't see any supplier for it.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Live Video
« Reply #3 on: October 07, 2015, 09:41:54 PM »
BestBuy.com

Just looked at it & although it shows as "Conexant Polaris" the label says Diamond Multimedia VC500

http://www.bestbuy.com/site/diamond-multimedia-vc500-one-touch-video-capture-device/1306800097.p?id=mp1306800097&skuId=1306800097

Actually I got 2, one for each desktop. And I didn't pay $38.00 for them when I bought them.

TomaT

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Live Video
« Reply #4 on: October 18, 2015, 04:53:28 PM »
Can I draw some graphics over video, e.g. "scale grid", or "crosshair"?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Live Video
« Reply #5 on: October 18, 2015, 05:28:36 PM »
Can I draw some graphics over video, e.g. "scale grid", or "crosshair"?
Yes, but it will require getting in depth with some code writing. You can download some sample projects for the DirectShowNet library here:

http://sourceforge.net/projects/directshownet/files/

There is a project named DxLogoVB that shows how to insert a bitmap over a video.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Live Video
« Reply #6 on: October 18, 2015, 09:57:47 PM »
Couldn't you just put vertical & horizontal BarLevels on top of the video?

#1 2 pixels wide X height of video screen, set to be full value w/out any PLC comm data

#2 2 pixels high X width of video, set same as above.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Live Video
« Reply #7 on: October 18, 2015, 10:04:29 PM »
Couldn't you just put vertical & horizontal BarLevels on top of the video?

#1 2 pixels wide X height of video screen, set to be full value w/out any PLC comm data

#2 2 pixels high X width of video, set same as above.
The DirectShow is quite a complex library. I tried to override the paint event and draw lines, but apparently the video playback overwrites whatever is painted.

TomaT

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Live Video
« Reply #8 on: October 19, 2015, 04:18:37 PM »
Thanx a lot, Archie. I'll try to understand... ^)
I tried to override the paint event and draw lines, but apparently the video playback overwrites whatever is painted.

I tried too... with the same result...

Godra

  • Hero Member
  • *****
  • Posts: 1437
    • View Profile
Re: Live Video
« Reply #9 on: May 06, 2020, 02:18:38 AM »
A modified version of this control can be found here:

https://www.advancedhmi.com/forum/index.php?topic=2589.0