Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Webcam Livestreaming On MFC

Posted on 2004-04-17
9
Medium Priority
?
12,051 Views
Last Modified: 2013-11-20
Has anyone done a program that obtain images from webcam ?
Or does anyone know how to do it ? i need to write a c++ application that can connect to a webcam and then show the images from the webcam on the viewing area of the program. anyone who has information or can direct me to the place with the appropriate solution for my problem...
0
Comment
Question by:itsharis999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 4

Expert Comment

by:bkfirebird
ID: 10851543
you should use directx to capture video .... its pretty easy to use .... and there is a very good directshow example with source code which does that
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 250 total points
ID: 10851957
This is surprisingly easy:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_using_video_capture.asp

Go step-by-step and you can can get results in a few minutes.
You can use also CapTest MSDN sample. It contains a lot of code, but 90% of it is building of user-interface using API. Webcam-related stuff is simple.
0
 

Author Comment

by:itsharis999
ID: 10852886
Thanks for your comment Alex, but can u tell me one more thing, that from where i can download this CapTest MSDN Sample. and how can i integrate that in my own program... kindly help me... its urgent..
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 48

Expert Comment

by:AlexFM
ID: 10852906
Just type CapTest in the MSDN Library index. MSDN article "CapTest: AVICap Capture Window Class" contains download link.

0
 
LVL 48

Expert Comment

by:AlexFM
ID: 10852907
I don't think you can integrate this sample into your own program. It contains a lot of code, most of it is not related to video capturing. But you can use it as reference.
Using link from my first post you can do this without problems.
0
 

Author Comment

by:itsharis999
ID: 10852931
Thanks for your comment Alex, but can u tell me one more thing, that from where i can download this CapTest MSDN Sample. and how can i integrate that in my own program... kindly help me... its urgent...
0
 

Author Comment

by:itsharis999
ID: 10852970
The link you specified in your first ever comment have got some steps for capturing video. if i put the same code in the MFC class then will it work for me or i have to do something else, as there is no proper way written that how to use those samples in my own application... waiting for ur response...

.har!s.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 10853008
Suppose you have MFC dialog-based application. Add member:

HWND m_hCaptureWnd;

to the dialog class.

To connect to first available capture driver write:

    CAPSTATUS CapStatus;
    capDriverConnect(m_hCaptureWnd, 0);

Creating of capture window:

    m_hCaptureWnd = capCreateCaptureWindow(
        _T(""),
        WS_CHILD,
        0,
        0,
        CapStatus.uiImageWidth,
        CapStatus.uiImageHeight,
        m_hWnd,
        ID_CAPTURE_WND);

To set preview rate and start preview write:

    capPreviewRate(m_hCaptureWnd, 100);
    capPreview(m_hCaptureWnd, TRUE);'
0
 

Author Comment

by:itsharis999
ID: 10853141
Nothing is working for me, it is still giving too many errors too handle... im really new in MFC Windows Programming and it is scaring me alot... Can you email me any specific program's source-code or any of your self-made program that do just this function, like showing the stream from cam on the MFC interface...? or just provide me the link to it...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question