Click here to Skip to main content
11,413,961 members (71,380 online)
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

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)

Share

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

 
QuestionA new experiment ! Pin
Member 11020981, 19-Aug-14 2:06
memberMember 1102098119-Aug-14 2:06 
SuggestionI would like to recommend my new Camera_Net Library [modified] Pin
free5lot, 29-Dec-13 22:20
memberfree5lot29-Dec-13 22:20 
QuestionLive video display from camera in c# .net Pin
Member 9004857, 11-Jul-12 19:39
memberMember 900485711-Jul-12 19:39 
Questionwatermarking video Pin
lototfi, 11-Jun-12 15:15
memberlototfi11-Jun-12 15:15 
QuestionThanks Pin
SreerajManayath, 5-Feb-12 19:44
memberSreerajManayath5-Feb-12 19:44 
Questionmultiple cameras? Pin
jleslie48, 3-Nov-11 9:29
memberjleslie483-Nov-11 9:29 
AnswerRe: multiple cameras? [modified] Pin
free5lot, 29-Dec-13 22:21
memberfree5lot29-Dec-13 22:21 
Questionimage capture Pin
Gabriel Punes, 13-Jul-11 23:59
memberGabriel Punes13-Jul-11 23:59 
GeneralMy vote of 3 Pin
Mahdi Nejadsahebi, 30-Apr-11 23:09
groupMahdi Nejadsahebi30-Apr-11 23:09 
Generallivevideo exit at RenderStream fuction Pin
DoubleGhost, 26-Apr-11 5:58
memberDoubleGhost26-Apr-11 5:58 
GeneralMy vote of 5 Pin
Ashish Tyagi 40, 21-Apr-11 8:45
memberAshish Tyagi 4021-Apr-11 8:45 
QuestionHow to set channel or channel frequency for tv-tuner card ? Pin
rjviz, 30-Jul-10 4:25
memberrjviz30-Jul-10 4:25 
GeneralCompile time error in LiveVideo_demo Pin
Noushad Ali, 9-Mar-10 4:11
memberNoushad Ali9-Mar-10 4:11 
GeneralRe: Compile time error in LiveVideo_demo Pin
Noushad Ali, 9-Mar-10 23:14
memberNoushad Ali9-Mar-10 23:14 
GeneralPictures squashed Pin
mathewmefiu, 12-Jan-10 1:06
membermathewmefiu12-Jan-10 1:06 
GeneralRe: Pictures squashed Pin
mathewmefiu, 12-Jan-10 1:27
membermathewmefiu12-Jan-10 1:27 
GeneralRe: Pictures squashed Pin
Aric Green, 23-Jan-10 4:57
memberAric Green23-Jan-10 4:57 
GeneralIR>Thermal Algorithm Pin
Joel Monet, 29-Nov-09 0:34
memberJoel Monet29-Nov-09 0:34 
Generalerror C2143: syntax error : missing ';' before '*' [modified] Pin
dillian wong, 19-Nov-09 0:15
memberdillian wong19-Nov-09 0:15 
GeneralCapture image from video stream Pin
kokabgujjar, 15-Oct-09 18:27
memberkokabgujjar15-Oct-09 18:27 
GeneralRe: Capture image from video stream Pin
jiaozi109, 3-Dec-09 3:21
memberjiaozi1093-Dec-09 3:21 
QuestionFirewire (IEEE1394) Pin
loyal ginger, 6-Oct-09 7:26
memberloyal ginger6-Oct-09 7:26 
GeneralI need code for video capturing in mpeg format in c#.net Pin
thebest1234, 2-Aug-09 4:13
memberthebest12342-Aug-09 4:13 
GeneralRe: I need code for video capturing in mpeg format in c#.net Pin
jiaozi109, 3-Dec-09 3:22
memberjiaozi1093-Dec-09 3:22 
GeneralRe: I need code for video capturing in mpeg format in c#.net Pin
nidhijain1555, 18-Jun-10 21:16
membernidhijain155518-Jun-10 21:16 
GeneralFLIP and ROTATION livevideo FILTER Pin
giuegiu, 6-Jul-09 22:08
membergiuegiu6-Jul-09 22:08 
GeneralRun time error Pin
kokabgujjar, 22-Jun-09 21:31
memberkokabgujjar22-Jun-09 21:31 
QuestionHow to video Capture Application using C++ Pin
tns_ranjith, 19-May-09 23:48
membertns_ranjith19-May-09 23:48 
GeneralFlickerless problem Pin
QuyLV, 17-Feb-09 21:33
memberQuyLV17-Feb-09 21:33 
Questionhow to convert it into C# Pin
mice35, 1-Feb-09 23:55
membermice351-Feb-09 23:55 
Questionhow to convert it into C# ? / need help!!! Pin
mice35, 27-Jan-09 12:54
membermice3527-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 Pin
chen_zd, 26-Sep-08 17:38
memberchen_zd26-Sep-08 17:38 
Generalvideo capture Pin
Phoody, 6-Apr-08 23:09
memberPhoody6-Apr-08 23:09 
GeneralRe: video capture Pin
alhambra-eidos, 20-May-08 23:05
memberalhambra-eidos20-May-08 23:05 
GeneralRe: video capture Pin
chasoknight, 23-Jul-08 0:08
memberchasoknight23-Jul-08 0:08 
GeneralRe: video capture Pin
Aric Green, 23-Jan-10 4:59
memberAric Green23-Jan-10 4:59 
GeneralI want code and windown form of C# for application of listening music Pin
milkpig86, 4-Apr-08 21:12
membermilkpig864-Apr-08 21:12 
GeneralRe: I want code and windown form of C# for application of listening music Pin
alhambra-eidos, 20-May-08 23:04
memberalhambra-eidos20-May-08 23:04 
GeneralI wants to get a snap from C# Application, of a person sitting in front of a WebCam. Pin
Member 3331842, 5-Dec-07 0:28
memberMember 33318425-Dec-07 0:28 
GeneralI wants to get a snap from C# Application, of a person sitting in front of a WebCam. Pin
Member 3331842, 5-Dec-07 0:26
memberMember 33318425-Dec-07 0:26 
QuestionHelp!! Pin
swlan, 7-Aug-07 17:52
memberswlan7-Aug-07 17:52 
GeneralWebcam for engineering project Pin
ang_ks, 9-Jul-07 21:20
memberang_ks9-Jul-07 21:20 
GeneralNeed help Pin
yaminisridaran, 12-Jul-07 0:09
memberyaminisridaran12-Jul-07 0:09 
QuestionPicture control Pin
tyagineha, 14-Jun-07 2:51
membertyagineha14-Jun-07 2:51 
Generaltwo web cameras! Pin
windlfs, 12-Apr-07 20:20
memberwindlfs12-Apr-07 20:20 
QuestionHow can it has sound ? Pin
ngochuy, 23-Feb-07 1:17
memberngochuy23-Feb-07 1:17 
QuestionConvert into C# Pin
Member #2775824, 20-Feb-07 5:48
memberMember #277582420-Feb-07 5:48 
QuestionConvert into C# Pin
Member #2775824, 20-Feb-07 5:48
memberMember #277582420-Feb-07 5:48 
QuestionConvet in C# Pin
Member #2775824, 20-Feb-07 5:45
memberMember #277582420-Feb-07 5:45 
GeneralSave Image Pin
sprmat84, 8-Feb-07 12:16
membersprmat848-Feb-07 12:16 

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
Web03 | 2.8.150427.2 | Last Updated 21 May 2004
Article Copyright 2004 by Dillip Kumar Kara
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid