Click here to Skip to main content
Licence CPOL
First Posted 20 May 2004
Views 383,585
Bookmarked 174 times

Capture Live Video from various Video Devices.

By | 20 May 2004 | Article
LiveVideo is an application to capture live video from various video capture devices.

Sample Image - LiveVideo.jpg

Introduction

This is an attempt to create an application which captures Live video from a Video capture device and USB attached WebCam all together in the same application. While developing my project, I needed to capture the video from various video devices including TV. Though, I found some source for capturing Video, it was not so efficient. So, that prompted me to develop my own independent application. Initially, “LiveVideo” detects the availability of the Video Capture card and whether WebCam is attached or not. Otherwise, it shows the message. Most of the API functions are used from DirectX SDK.

Steps to Use

  • Create a Dialog based application.
  • Insert a Picture control of size 320x240 pixel.
  • In the properties of the Picture control, set TYPE as ‘Rectangle’ and COLOR as ‘Black’.
  • Add the files “CaptureVideo.cpp” and “CaptureDevice.h” to your project.
  • Add “CaptureVide.h” into your implementation header file.
  • Create an Object of the class “CCaptureVideo” using Class wizard.
  • Link the libraries strmbasd.lib, wmvcore.lib, wmstub.lib in your project settings.

Now, using the object, invoke InitializeVideo(HWND hWnd) function to initialize the video.

HRESULT hr = capVideo.InitializeVideo(hWnd);

Where hWnd is the window handle of the picture control.

  • StartSVideo() - To start capturing from SVideo.
  • StartCompositeVideo() - To start capturing from Composite Video.
  • StartTVTuner() - To start capturing from TVTuner.
  • StartWebcam() - To start capturing from WebCam.

Important:

Don’t forget to uninitialize the Video by using UnInitializeVideo() before destroying your application.

Requirements:

  • Video Capture card. I’ve tested with “WinFast TV2000 XP WDM Video Capture” card. Hope it will work with all video capture cards.
  • USB Cam.
  • You need to install DirectX, which is available freely from Microsoft. You can download DirectX 9.0 from Microsoft.
  • For development, install DirectX 9.0 SDK. You can download DirectX 9.0 SDK from Microsoft.

Conclusion

I hope this article is of some use to you. I would add Configuration settings of the Video features and Video quality in my next version. Feel free to use these classes as you like. Any comments or improvements would be appreciated.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Dillip Kumar Kara

Web Developer

United States United States

Member

Hi Friends.,
 
I am DILLIP working as a Software Engineer in South Korea .
 
My Hobbies:
 
Listening to Music, Net Browsing , watching TV..


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionThanks PinmemberSreerajManayath18:44 5 Feb '12  
Questionmultiple cameras? Pinmemberjleslie488:29 3 Nov '11  
Questionimage capture PinmemberGabriel Punes22:59 13 Jul '11  
GeneralMy vote of 3 PingroupMahdi Nejadsahebi22:09 30 Apr '11  
Generallivevideo exit at RenderStream fuction PinmemberDoubleGhost4:58 26 Apr '11  
GeneralMy vote of 5 PinmemberAshish Tyagi 407:45 21 Apr '11  
QuestionHow to set channel or channel frequency for tv-tuner card ? Pinmemberrjviz3:25 30 Jul '10  
GeneralCompile time error in LiveVideo_demo PinmemberNoushad Ali3:11 9 Mar '10  
GeneralRe: Compile time error in LiveVideo_demo PinmemberNoushad Ali22:14 9 Mar '10  
GeneralPictures squashed Pinmembermathewmefiu0:06 12 Jan '10  
GeneralRe: Pictures squashed Pinmembermathewmefiu0:27 12 Jan '10  
GeneralRe: Pictures squashed PinmemberAric Green3:57 23 Jan '10  
GeneralIR>Thermal Algorithm PinmemberJoel Monet23:34 28 Nov '09  
Generalerror C2143: syntax error : missing ';' before '*' [modified] Pinmemberdillian wong23:15 18 Nov '09  
GeneralCapture image from video stream Pinmemberkokabgujjar17:27 15 Oct '09  
GeneralRe: Capture image from video stream Pinmemberjiaozi1092:21 3 Dec '09  
QuestionFirewire (IEEE1394) Pinmemberloyal ginger6:26 6 Oct '09  
GeneralI need code for video capturing in mpeg format in c#.net Pinmemberthebest12343:13 2 Aug '09  
GeneralRe: I need code for video capturing in mpeg format in c#.net Pinmemberjiaozi1092:22 3 Dec '09  
GeneralRe: I need code for video capturing in mpeg format in c#.net Pinmembernidhijain155520:16 18 Jun '10  
GeneralFLIP and ROTATION livevideo FILTER Pinmembergiuegiu21:08 6 Jul '09  
GeneralRun time error Pinmemberkokabgujjar20:31 22 Jun '09  
QuestionHow to video Capture Application using C++ Pinmembertns_ranjith22:48 19 May '09  
GeneralFlickerless problem PinmemberQuyLV20:33 17 Feb '09  
Questionhow to convert it into C# Pinmembermice3522:55 1 Feb '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 21 May 2004
Article Copyright 2004 by Dillip Kumar Kara
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid