Break the Law
Break the Law

Reputation: 217

Video recording resolution using DirectShow

How do i change the screen resolution of a video while recording in directshow? because I have a 8 Mega-pixel web camera, which I use for video recording but after the video is saved, when I view the video, it plays like it was recorded using a 1.3Megapixel camera.

Upvotes: 3

Views: 5834

Answers (1)

Roman Ryltsov
Roman Ryltsov

Reputation: 69632

You need to use IAMStreamConfig interface. Some MSDN leads for you:

Configure the Video Output Format (Windows):

To configure a capture device's output format, an application should use the AM_MEDIA_TYPE structure returned by IAMStreamConfig::GetFormat in the pmt parameter.

IAMStreamConfig::GetFormat method (Windows):

If the pin is connected, this method returns the format that the pin is currently using. Otherwise, the method returns the pin's preferred format for the next pin connection. If you have already called the IAMStreamConfig::SetFormat method to set the format, GetFormat returns the same format. If not, it returns the first format in the pin's list of preferred formats, as determined by the IPin::EnumMediaTypes method.

More:

Also, your webcam might have lower resolution for video streaming, and high for taking still thanks to post-processing capabilities.

Upvotes: 8

Related Questions