4

Is there any sample project use DirectShow.NET library to capture image and capture video in the same project?

skink
  • 5,133
  • 6
  • 37
  • 58
user1301587
  • 455
  • 4
  • 11
  • 23

2 Answers2

2

Yep, there are actually many, but here is one that got me started years ago.

http://www.codeproject.com/Articles/10248/Motion-Detection-Algorithms

  • 1
    Hi Bryan thanks for your time. Can you please provide me some more links. May be i could get better idea about it. – user1301587 Nov 15 '12 at 17:39
  • 2
    Welcome to Stack Overflow! Link-only answers are usually frowned upon here. What does your link point to? Can you describe it in a somewhat concise manner? A rule of thumb is that your answer should continue to be helpful even if the linked material disappears. You can edit your question to add more context. – Emil Vikström Nov 15 '12 at 17:58
1

A typical problem you are to face is that video capture devices are exclusive use resources. If you are capturing video, you cannot capture stills separately, you need to grab individual video frames out of the running pipeline (i.e. snapshots) and they are your images/stills. This certainly assumes that you are interested in capturing from the same hardware, otherwise nothing prevents from using independent devices simultaneously, via the same or different APIs.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Yes Roman, i am using web cams but i am able to do only one thing at a time either i can take the snapshot or can capture the video. But what i wants that my project should be able to accomplish both things in one project. I have gone through lots of samples but so far i did not found any project which are doing both the tasks in the same project. I don't know much about directshow.net library but in the expression encoder 4.0 i can do both the tasks in one project. Please clear my doubts. – user1301587 Nov 15 '12 at 18:43
  • That's what EE does: it creates video capture pipeline and when it comes to still image capture, it digs an individual frame out of video stream. There has been a lot of discussions on this, e.g. http://stackoverflow.com/questions/11102241/grab-frame-from-mov-file-using-directshow-net – Roman R. Nov 15 '12 at 18:50
  • Please clear my doubts- Is there any way to do both the things or using directshow we can do only one thing at a time i.e either we can capture image or we can capture video? – user1301587 Nov 15 '12 at 18:58
  • Yes, if you build a single graph for both. Or no if you fail to do so. As you noticed EE does, so you can too. Moreover, you can spy over EE's graph and see what they are actually doing. – Roman R. Nov 15 '12 at 19:02
  • Ok Thanks a lot for your time.. Roman. I don't know how to create graph for both....but let me try it out. – user1301587 Nov 15 '12 at 19:06