Discussion:
Video Capture & Device Drivers Jan 18 2010
(too old to reply)
JRobertJ
2010-01-18 23:01:01 UTC
Permalink
I’ve written an application in VB.NET running on Windows XP using
WM_CAP_SEQUENCE and WM_CAP_SEQUENCE_NOFILE to capture video from a webcam
and it works correctly. The webcam uses the “USB Video Device” video source,
with stream settings of 640x480 resolution, YUY2, 614400 bytes. I can
preview the image, capture to a file, using the callback function I can
capture a frame and convert it from YUY2 to RGB sucessfully.

Using the same software, I’m attempting to do the same using a video capture
device rather than the webcam, and I’m having some troubles. The video
capture device uses the “Microsoft DV Camera and VCR” video source with
stream settings of 720x480 resolution, dvsd, 1036800 bytes. I can
sucessfully capture the video to a file correctly, however I cannot preview
the video, the capture window remains black. Furthermore, when I capture a
single frame using the callback function, I don’t know how to convert it to
RGB.

I observed that when using the webcam, that the size of the frame data was
the same as the size listed in the stream settings, 614400 bytes, however
when using the video capture device, the frame data was only 120000 bytes
although the stream settings specify 1036800 bytes.

The webcam uses the “USB Video Device” driver that comes with Windows,
whereas the video capture device uses the “AVC Compliant DV Tape
Recorder/Player” driver which also comes with Windows. The video capture
device uses IEEE 1394.

So, my questions are:
1) Why doesn’t the preview work when using the “Microsoft DV Camera and VCR”
video source? Is this a device driver issue, or an issue with the video
capture device? Does the preview data come from a different source than the
captured video data?
2) If the inability to preview is an issue with the driver, is there another
driver I can use, or a way to get the driver fixed?
3) Why aren’t the frame size and the stream setting bytes the same when
using the “Microsoft DV Camera and VCR” video source? I’d guess that the
driver is compressing the data, is this correct?
4) What is the format of the frame data, and how can I convert it to RGB? I
know the fccHandler is identified as “dvsd”, but I can’t find a specification
for it, or a way to convert it to RGB.

Thanks.
Alessandro Angeli
2010-01-19 00:56:32 UTC
Permalink
From: "JRobertJ"
Using the same software, I'm attempting to do the same
using a video capture device rather than the webcam, and
I'm having some troubles. The video capture device uses
the "Microsoft DV Camera and VCR" video source with
stream settings of 720x480 resolution, dvsd, 1036800
bytes. I can sucessfully capture the video to a file
correctly, however I cannot preview the video, the
capture window remains black. Furthermore, when I
capture a single frame using the callback function, I
don't know how to convert it to RGB.
DVSD is a standard definition DV-compressed audio+video
stream. It is not a uncompressed (YUV or RGB) video format
that can be drawn by the video card and requires demuxing
and decompression to be converted to RGB. Think of a DVSD
stream as a sequence of interleaved audio and JPEG pictures
(DV is functionally similar to JPEG, but a different
compression format).
I observed that when using the webcam, that the size of
the frame data was the same as the size listed in the
stream settings, 614400 bytes, however when using the
video capture device, the frame data was only 120000
bytes although the stream settings specify 1036800 bytes.
1'036'800 is the size of the uncompressed frame in RGB24.
The webcam uses the "USB Video Device" driver that comes
with Windows, whereas the video capture device uses the
"AVC Compliant DV Tape Recorder/Player" driver which also
comes with Windows. The video capture device uses IEEE
1394.
DV devices commonly use a IEEE 1394 (aka FireWire)
connection.

Windows only comes with a DVSD decoding filter for
DirectShow and not for VFW. If you want to support DVSD
using system components, you must abandon WMM (VFW or MCI)
and use DirectShow. Of course DirectShow supports USB
webcams as well.

http://msdn.microsoft.com/en-us/library/dd388641.aspx
http://msdn.microsoft.com/en-us/library/dd407331.aspx

To use DirectShow in .NET, you need DirectShow.NET:

http://directshownet.sourceforge.net/
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
Continue reading on narkive:
Loading...