Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I programmatically interact with a camera (photo/video) in an MS Windows environment?

Posted on 2014-11-15
6
Medium Priority
?
396 Views
Last Modified: 2014-12-03
Hi:

I'm new to the use of a Camera in the Windows operating system.
I've been tasked with writing a library to interact with a windows based camera.

What is the best api/library/pattern/solution for interacting with a camera in a windows environment?

Ideally, we'd like something that is common across Windows 7, Windows 8, Windows Surface, and Windows based
phones (tablets?).

Is there something that is consistent across all the windows flavours mentioned above?

I've seen some mention of "Media Foundation" in several posts.
Is that the current standard for camera/video interaction?

Thanks,
JohnB
0
Comment
Question by:jxbma
  • 3
  • 3
6 Comments
 
LVL 84

Expert Comment

by:David Johnson, CD, MVP
ID: 40445720
using direct-x with the windows sdk is the most common method using the amcap library.
http://msdn.microsoft.com/en-us/library/dd373424%28VS.85%29.aspx

it is not included with the latest versions of the sdk but available from http://amcap.en.softonic.com/download (watch out for additional installers and decline them)
0
 
LVL 1

Author Comment

by:jxbma
ID: 40446275
::> David Johnson ::>

Will this approach work across all windows devices including windows mobile devices?

JB
0
 
LVL 1

Author Comment

by:jxbma
ID: 40446342
::> David Johnson ::>

I'm new to this and a little confused. Please be patient with my questions.
I'm assuming that in one form another, I'll be coding against the Windows SDK
either directly or using some other 3rd party library.

1) In your comment, are you referring to "Direct-X" or "DirectShow"?

2) I've downloaded AMCap (which is that actual capture application).
    Is there an AMCap library which I can program against to control/access the camera
    and images (still & streaming)?

3) Is your suggestion to download/examine the AMCap sample and then use that as
    as the basis for accessing the camera?

Thanks,
JohnB
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 84

Accepted Solution

by:
David Johnson, CD, MVP earned 2000 total points
ID: 40446449
directshow is part of direct-x .. use the sample as a base for creating your application to access the camera
0
 
LVL 1

Author Comment

by:jxbma
ID: 40453765
I've been doing some additional digging around and there seem to be 2 camps as how to best to proceed.
I looked @ openCV, which looks like it uses Media Foundation under the covers.

The choices seem to be to go with either Media Foundation or DirectX.
Media Foundation being the newer of the two and being supported on Windows 7 and forward.
DirectX  is the older technology/approach (was MF intended to replace DirectX?).

Can anyone shed some light on the pros/cons of using DirectX vs Media Foundation?

All we really want to do is to capture video frames from a USB/Device Camera feed.
In turn we perform analysis on each frame received (so we're not just piping the frame to
a windows control)

Is one better to use than the other in terms of performance/ease of use (api)/support moving forward?

As an aside, what would be the best strategy for capturing Camera output from a web page?
(Microsoft stack or other)

Thanks in advance,
JohnB
0
 
LVL 84

Expert Comment

by:David Johnson, CD, MVP
ID: 40479769
capturing camera output from a webpage .. depends on the methodology used i.e. flash, media streaming.. you could use vlc
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
It is a real story and is one of my scariest tech experiences. Most users think that IT experts like us know how to fix all computer problems. However, if there is a time constraint and you MUST not fail the task or you will lose your job, a simple …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

926 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