Click here to Skip to main content
Click here to Skip to main content

Capture Live Video from various Video Devices.

, 20 May 2004 CPOL
Rate this:
Please Sign up or sign in to vote.
LiveVideo is an application to capture live video from various video capture devices.

Sample Image - LiveVideo.jpg


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.


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


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


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.


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
Hi Friends.,
I am DILLIP working as a Software Engineer in South Korea .
My Hobbies:
Listening to Music, Net Browsing , watching TV..

Comments and Discussions

GeneralFLIP and ROTATION livevideo FILTER Pinmembergiuegiu6-Jul-09 22:08 
GeneralRun time error Pinmemberkokabgujjar22-Jun-09 21:31 
QuestionHow to video Capture Application using C++ Pinmembertns_ranjith19-May-09 23:48 
GeneralFlickerless problem PinmemberQuyLV17-Feb-09 21:33 
Questionhow to convert it into C# Pinmembermice351-Feb-09 23:55 
Questionhow to convert it into C# ? / need help!!! Pinmembermice3527-Jan-09 12:54 
Questionthe video quality showed by LiveVideo is worse than that showed by the Demo, which is provided together with the capture card Pinmemberchen_zd26-Sep-08 17:38 
Generalvideo capture PinmemberPhoody6-Apr-08 23:09 
GeneralRe: video capture Pinmemberalhambra-eidos20-May-08 23:05 
GeneralRe: video capture Pinmemberchasoknight23-Jul-08 0:08 
GeneralRe: video capture PinmemberAric Green23-Jan-10 4:59 
GeneralI want code and windown form of C# for application of listening music Pinmembermilkpig864-Apr-08 21:12 
GeneralRe: I want code and windown form of C# for application of listening music Pinmemberalhambra-eidos20-May-08 23:04 
GeneralI wants to get a snap from C# Application, of a person sitting in front of a WebCam. PinmemberMember 33318425-Dec-07 0:28 
GeneralI wants to get a snap from C# Application, of a person sitting in front of a WebCam. PinmemberMember 33318425-Dec-07 0:26 
QuestionHelp!! Pinmemberswlan7-Aug-07 17:52 
GeneralWebcam for engineering project Pinmemberang_ks9-Jul-07 21:20 
GeneralNeed help Pinmemberyaminisridaran12-Jul-07 0:09 
QuestionPicture control Pinmembertyagineha14-Jun-07 2:51 
Generaltwo web cameras! Pinmemberwindlfs12-Apr-07 20:20 
QuestionHow can it has sound ? Pinmemberngochuy23-Feb-07 1:17 
QuestionConvert into C# PinmemberMember #277582420-Feb-07 5:48 
QuestionConvert into C# PinmemberMember #277582420-Feb-07 5:48 
QuestionConvet in C# PinmemberMember #277582420-Feb-07 5:45 
GeneralSave Image Pinmembersprmat848-Feb-07 12:16 
GeneralRe: Save Image Pinmembertanvon malik25-Sep-07 3:41 
GeneralRe: Save Image Pinmemberricox7824-Mar-08 10:41 
QuestionIs it Possible in Web Applications PinmemberAnandhveera24-Jan-07 19:01 
QuestionSave in Hard Disk Directly [] Pinmembermaghaei21-Nov-06 0:21 
QuestionSave in Hard Disk Directly Pinmembermaghaei21-Nov-06 0:20 
GeneralSave Captured Video Pinmembershital_harode@rediffmail.com7-Nov-06 0:37 
QuestionVideo quality issue Pinmemberpr0digy130-Oct-06 11:12 
AnswerRe: Video quality issue PinmemberSreerajManayath30-Mar-12 0:12 
GeneralICaptureGraphBuilder2 Pinmembervkvk25-Oct-06 4:09 
Generaldshow [modified] Pinmembertahinn5-Oct-06 20:17 
GeneralDocuments.obj PinmemberChris J7-Sep-06 14:12 
General"fatal error LNK1136: invalid or corrupt file" PinmemberChris J6-Sep-06 9:02 
GeneralRe: "fatal error LNK1136: invalid or corrupt file" PinmemberBig-Ben14-Mar-07 5:54 
GeneralBuilder6 please help Pinmembermarsianinek10-Jul-06 3:09 
GeneralNetwork Streaming Pinmembercharfeddine_ahmed23-Jun-06 23:24 
GeneralWM ASF Writer Filter.... dont want to write file PinmemberAniket Salunkhe7-Jun-06 21:40 
GeneralWME Streaimg using DirectX (ASF Writter Filter)?, IWMWriterNetworkSink interface? [modified] PinmemberAniket Salunkhe6-Jun-06 22:39 
Questionerror LNK2001 and fatal error LNK1120 Pinmembermalgosiamarek18-May-06 11:57 
AnswerRe: error LNK2001 and fatal error LNK1120 Pinmemberyaminisridaran12-Jul-07 4:08 
QuestionHow to get a sample in memory Pinmembermaloe9-May-06 15:21 
GeneralError after debugging PinmemberStudist22-Mar-06 22:26 
GeneralDoesn't work with multiport capture cards Pinmemberdimavs1-Mar-06 18:46 
QuestionCan it work with other USB video capture devices? PinmemberParalax_rus6-Feb-06 20:36 
GeneralGrabbing Bitmaps from the Live Video Pinmember_bk_14-Nov-05 22:07 
GeneralRe: Grabbing Bitmaps from the Live Video Pinmemberwhitesail6-Dec-05 14:10 

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.

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