3

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.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
Break the Law
  • 217
  • 2
  • 14
  • Consumer grade Webcams (ala Microsoft and Logitech) typically have resolutions of at least 640x480. The higher consumer grade ones go up to 1080p. But the "8 Mega Pixel" claim is typically marketing fodder for the box in which the device came in. If Roman's solution doesn't work for you, I have so old code I could dig up for enumerating and setting the video resolution and bit rate for a DShow graph. – selbie Jan 13 '13 at 23:35

1 Answers1

8

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.

Community
  • 1
  • 1
Roman R.
  • 68,205
  • 6
  • 94
  • 158