Click here to Skip to main content
5,787,682 members and growing! (19,224 online)
Email Password   helpLost your password?
Multimedia » DirectX » General     Intermediate License: The Code Project Open License (CPOL)

Capture Live Video from various Video Devices.

By Dillip Kumar Kara

LiveVideo is an application to capture live video from various video capture devices.
VC6, VC7, VC7.1, C++Windows, Win2K, WinXP, Win2003, MFC, DirectX, VS6, Visual Studio, Dev

Posted: 20 May 2004
Updated: 20 May 2004
Views: 212,544
Bookmarked: 109 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
41 votes for this Article.
Popularity: 7.07 Rating: 4.39 out of 5
1 vote, 2.4%
1
3 votes, 7.3%
2
2 votes, 4.9%
3
4 votes, 9.8%
4
31 votes, 75.6%
5

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


Hi Friends.,

I am DILLIP working as a Software Engineer in South Korea .

My Hobbies:

Listening to Music, Net Browsing , watching TV..

Occupation: Web Developer
Location: United States United States

Other popular DirectX articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 163 (Total in Forum: 163) (Refresh)FirstPrevNext
Questionthe video quality showed by LiveVideo is worse than that showed by the Demo, which is provided together with the capture cardmemberchen_zd17:38 26 Sep '08  
Generalvideo capturememberPhoody23:09 6 Apr '08  
GeneralRe: video capturememberalhambra-eidos23:05 20 May '08  
GeneralRe: video capturememberchasoknight0:08 23 Jul '08  
GeneralI want code and windown form of C# for application of listening musicmembermilkpig8621:12 4 Apr '08  
GeneralRe: I want code and windown form of C# for application of listening musicmemberalhambra-eidos23:04 20 May '08  
GeneralI wants to get a snap from C# Application, of a person sitting in front of a WebCam.memberMember 33318420:28 5 Dec '07  
GeneralI wants to get a snap from C# Application, of a person sitting in front of a WebCam.memberMember 33318420:26 5 Dec '07  
QuestionHelp!!memberswlan17:52 7 Aug '07  
GeneralWebcam for engineering projectmemberang_ks21:20 9 Jul '07  
GeneralNeed helpmemberyaminisridaran0:09 12 Jul '07  
QuestionPicture controlmembertyagineha2:51 14 Jun '07  
Generaltwo web cameras!memberwindlfs20:20 12 Apr '07  
GeneralHow can it has sound ?memberngochuy1:17 23 Feb '07  
QuestionConvert into C#member5:48 20 Feb '07  
QuestionConvert into C#member5:48 20 Feb '07  
QuestionConvet in C#member5:45 20 Feb '07  
GeneralSave Imagemembersprmat8412:16 8 Feb '07  
GeneralRe: Save Imagemembertanvon malik3:41 25 Sep '07  
GeneralRe: Save Imagememberricox7810:41 24 Mar '08  
QuestionIs it Possible in Web ApplicationsmemberAnandhveera19:01 24 Jan '07  
QuestionSave in Hard Disk Directly [abbasmoh56@yahoo.com]membermaghaei0:21 21 Nov '06  
QuestionSave in Hard Disk Directlymembermaghaei0:20 21 Nov '06  
GeneralSave Captured Videomembershital_harode@rediffmail.com0:37 7 Nov '06  
QuestionVideo quality issuememberpr0digy111:12 30 Oct '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 20 May 2004
Editor: Smitha Vijayan
Copyright 2004 by Dillip Kumar Kara
Everything else Copyright © CodeProject, 1999-2009
Web09 | Advertise on the Code Project