changing directshow capture dimension

hello,

i am using directshow to capure live video on pocket pc (QTEK 9100).

the captured frames have dimension 144*176. the other possible media types have dimension 288*352 etc

I would like to know if/how it is possible to change the camera properties to make it capture in one of the standard formats 176*144 (QCIF) , 352*288 (CIF) etc

many thanks

deji

[635 byte] By [deji101] at [2007-12-25]
# 1
So you want to rotate 90 degrees?
ChrisP. at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 2

The list of supported capabilities is returned by IAMStreamConfig::GetStreamCaps. You can change the settings with IAMStreamConfig::SetFormat.

LGS at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 3
Is there a directshow method for doing a 90 degrees rotation?
thanks

deji

deji101 at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 4
Hello,

From the list of supported formats i get dimesions 144*176 , 288*352, and multiples
i do not have 176*144 as one of the supported formats.

can i give any abritrary dimension to set dimensions? I have errors when i do setFormat(176,144).

many thanks

deji101 at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 5

You generally can't use arbitrary dimensions no. What is listed as the possible media types is usually all that is available.

So do I surmise that you video is in a portrait 3x4 configuration or that the image is sideways (90 degree rotation)?

Do you check for any hardware settings? Sometimes there is an option to use the device in landscape mode which may also rotate the camera.

ChrisP. at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 6
thanks so much for your replies. i believe u taking me closer to the resolution of this problem.
this is my first experience with directshow and COM.
How do I check the hardware settings? and how do I change to landscape mode

deji

deji101 at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 7

IImagingFactory *pImgFactory;

IImage *pImage;

IBasicBitmapOps *pBasicBitmapOps;

CComPtr<IBitmapImage> pBitmapImage;

RECT rc = { 0, 0, 130, 88};

ImageInfo imageInfo;

IBitmapImage* newBitmap = NULL;

UINT anchura = 15;

UINT altura = 10;

CoInitializeEx(NULL, COINIT_MULTITHREADED);

// Create the imaging factory.

if (SUCCEEDED(CoCreateInstance (CLSID_ImagingFactory,

NULL,

CLSCTX_INPROC_SERVER,

IID_IImagingFactory,

(void **)&pImgFactory)))

{

if (SUCCEEDED(pImgFactory->CreateImageFromFile(

TEXT("Storage Card/test.bmp"),

&pImage)))

{

// Draw the image.

pImage->Draw(pDC->m_hDC,&rc,NULL);

pImage->GetImageInfo(&imageInfo);

if (SUCCEEDED(pImgFactory->CreateBitmapFromImage(

pImage, imageInfo.Width, imageInfo.Height,

PixelFormatDontCare, InterpolationHintDefault,

&pBitmapImage)))

{

pBitmapImage->QueryInterface(IID_IBasicBitmapOps,

(void**)&pBasicBitmapOps);

if (SUCCEEDED(pBasicBitmapOps->Resize(anchura,altura,

PixelFormatDontCare, InterpolationHintDefault,

&newBitmap)))

{

pImage->Release();

newBitmap->QueryInterface(IID_IImage, (void**)(&pImage));

pImage->Draw(pDC->m_hDC,&rc,NULL);

AfxMessageBox(L"Imagen modificada con exito");

}

// Codigo para rotar una imagen

/* pBasicBitmapOps->Rotate(90, InterpolationHintNearestNeighbor,

&newBitmap);

pImage->Release();

newBitmap->QueryInterface(IID_IImage, (void**)(&pImage));

pImage->Draw(pDC->m_hDC,&rc,NULL);

*/}

}

pBasicBitmapOps->Release();

newBitmap->Release();

pImgFactory->Release();

}

CoUninitialize();

Megara at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...

Software Development for Windows Vista

Site Classified