Click here to Skip to main content
13,147,383 members (34,079 online)
Click here to Skip to main content
Add your own
alternative version


201 bookmarked
Posted 20 May 2004

Capture Live Video from various Video Devices.

, 20 May 2004
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..

You may also be interested in...


Comments and Discussions

GeneralRe: I need code for video capturing in mpeg format in Pin
jiaozi1093-Dec-09 2:22
memberjiaozi1093-Dec-09 2:22 
GeneralRe: I need code for video capturing in mpeg format in Pin
nidhijain155518-Jun-10 20:16
membernidhijain155518-Jun-10 20:16 
GeneralFLIP and ROTATION livevideo FILTER Pin
giuegiu6-Jul-09 21:08
membergiuegiu6-Jul-09 21:08 
GeneralRun time error Pin
kokabgujjar22-Jun-09 20:31
memberkokabgujjar22-Jun-09 20:31 
QuestionHow to video Capture Application using C++ Pin
tns_ranjith19-May-09 22:48
membertns_ranjith19-May-09 22:48 
GeneralFlickerless problem Pin
QuyLV17-Feb-09 20:33
memberQuyLV17-Feb-09 20:33 
Questionhow to convert it into C# Pin
mice351-Feb-09 22:55
membermice351-Feb-09 22:55 
Questionhow to convert it into C# ? / need help!!! Pin
mice3527-Jan-09 11:54
membermice3527-Jan-09 11:54 
Questionthe video quality showed by LiveVideo is worse than that showed by the Demo, which is provided together with the capture card Pin
chen_zd26-Sep-08 16:38
memberchen_zd26-Sep-08 16:38 
Generalvideo capture Pin
Phoody6-Apr-08 22:09
memberPhoody6-Apr-08 22:09 
GeneralRe: video capture Pin
alhambra-eidos20-May-08 22:05
memberalhambra-eidos20-May-08 22:05 
GeneralRe: video capture Pin
chasoknight22-Jul-08 23:08
memberchasoknight22-Jul-08 23:08 
GeneralRe: video capture Pin
Aric Green23-Jan-10 3:59
memberAric Green23-Jan-10 3:59 
GeneralI want code and windown form of C# for application of listening music Pin
milkpig864-Apr-08 20:12
membermilkpig864-Apr-08 20:12 
GeneralRe: I want code and windown form of C# for application of listening music Pin
alhambra-eidos20-May-08 22:04
memberalhambra-eidos20-May-08 22:04 
GeneralI wants to get a snap from C# Application, of a person sitting in front of a WebCam. Pin
Member 33318424-Dec-07 23:28
memberMember 33318424-Dec-07 23:28 
GeneralI wants to get a snap from C# Application, of a person sitting in front of a WebCam. Pin
Member 33318424-Dec-07 23:26
memberMember 33318424-Dec-07 23:26 
QuestionHelp!! Pin
swlan7-Aug-07 16:52
memberswlan7-Aug-07 16:52 
GeneralWebcam for engineering project Pin
ang_ks9-Jul-07 20:20
memberang_ks9-Jul-07 20:20 
GeneralNeed help Pin
yaminisridaran11-Jul-07 23:09
memberyaminisridaran11-Jul-07 23:09 
QuestionPicture control Pin
tyagineha14-Jun-07 1:51
membertyagineha14-Jun-07 1:51 
Generaltwo web cameras! Pin
windlfs12-Apr-07 19:20
memberwindlfs12-Apr-07 19:20 
QuestionHow can it has sound ? Pin
ngochuy23-Feb-07 0:17
memberngochuy23-Feb-07 0:17 
QuestionConvert into C# Pin
Member #277582420-Feb-07 4:48
memberMember #277582420-Feb-07 4:48 
QuestionConvert into C# Pin
Member #277582420-Feb-07 4:48
memberMember #277582420-Feb-07 4:48 
QuestionConvet in C# Pin
Member #277582420-Feb-07 4:45
memberMember #277582420-Feb-07 4:45 
GeneralSave Image Pin
sprmat848-Feb-07 11:16
membersprmat848-Feb-07 11:16 
GeneralRe: Save Image Pin
tanvon malik25-Sep-07 2:41
membertanvon malik25-Sep-07 2:41 
GeneralRe: Save Image Pin
ricox7824-Mar-08 9:41
memberricox7824-Mar-08 9:41 
QuestionIs it Possible in Web Applications Pin
Anandhveera24-Jan-07 18:01
memberAnandhveera24-Jan-07 18:01 
QuestionSave in Hard Disk Directly [] Pin
maghaei20-Nov-06 23:21
membermaghaei20-Nov-06 23:21 
QuestionSave in Hard Disk Directly Pin
maghaei20-Nov-06 23:20
membermaghaei20-Nov-06 23:20 
GeneralSave Captured Video Pin
shital_harode@rediffmail.com6-Nov-06 23:37
membershital_harode@rediffmail.com6-Nov-06 23:37 
QuestionVideo quality issue Pin
pr0digy130-Oct-06 10:12
memberpr0digy130-Oct-06 10:12 
AnswerRe: Video quality issue Pin
SreerajManayath29-Mar-12 23:12
memberSreerajManayath29-Mar-12 23:12 
GeneralICaptureGraphBuilder2 Pin
vkvk25-Oct-06 3:09
membervkvk25-Oct-06 3:09 
Generaldshow [modified] Pin
tahinn5-Oct-06 19:17
membertahinn5-Oct-06 19:17 
GeneralDocuments.obj Pin
Chris J7-Sep-06 13:12
memberChris J7-Sep-06 13:12 
General"fatal error LNK1136: invalid or corrupt file" Pin
Chris J6-Sep-06 8:02
memberChris J6-Sep-06 8:02 
GeneralRe: "fatal error LNK1136: invalid or corrupt file" Pin
Big-Ben14-Mar-07 4:54
memberBig-Ben14-Mar-07 4:54 
GeneralBuilder6 please help Pin
marsianinek10-Jul-06 2:09
membermarsianinek10-Jul-06 2:09 
GeneralNetwork Streaming Pin
charfeddine_ahmed23-Jun-06 22:24
membercharfeddine_ahmed23-Jun-06 22:24 
GeneralWM ASF Writer Filter.... dont want to write file Pin
Aniket Salunkhe7-Jun-06 20:40
memberAniket Salunkhe7-Jun-06 20:40 
GeneralWME Streaimg using DirectX (ASF Writter Filter)?, IWMWriterNetworkSink interface? [modified] Pin
Aniket Salunkhe6-Jun-06 21:39
memberAniket Salunkhe6-Jun-06 21:39 
Questionerror LNK2001 and fatal error LNK1120 Pin
malgosiamarek18-May-06 10:57
membermalgosiamarek18-May-06 10:57 
AnswerRe: error LNK2001 and fatal error LNK1120 Pin
yaminisridaran12-Jul-07 3:08
memberyaminisridaran12-Jul-07 3:08 
QuestionHow to get a sample in memory Pin
maloe9-May-06 14:21
membermaloe9-May-06 14:21 
GeneralError after debugging Pin
Studist22-Mar-06 21:26
memberStudist22-Mar-06 21:26 
GeneralDoesn't work with multiport capture cards Pin
dimavs1-Mar-06 17:46
memberdimavs1-Mar-06 17:46 
QuestionCan it work with other USB video capture devices? Pin
Paralax_rus6-Feb-06 19:36
memberParalax_rus6-Feb-06 19:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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 | Terms of Use | Mobile
Web02 | 2.8.170915.1 | Last Updated 21 May 2004
Article Copyright 2004 by Dillip Kumar Kara
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid