Page 1 of 1

COM exception during ConvertFrame function

PostPosted: Tue Dec 11, 2018 12:18 pm
by sunil_sjb
Hi,

I'm using C# code provided in the SDK as example and I'm getting an error while capturing still

Solution: StillsCSharp
Issue In Function :
public Bgra32VideoFrame ConvertFrame(IDeckLinkVideoFrame srcFrame)
{
Bgra32VideoFrame dstFrame;

// Check whether srcFrame is already bmdFormat8BitBGRA
if (srcFrame.GetPixelFormat() == _BMDPixelFormat.bmdFormat8BitBGRA)
dstFrame = (Bgra32VideoFrame)srcFrame;

else
{
dstFrame = new Bgra32VideoFrame(srcFrame.GetWidth(), srcFrame.GetHeight(), srcFrame.GetFlags());
m_deckLinkConversion.ConvertFrame(srcFrame, (IDeckLinkVideoFrame)dstFrame);
}

return dstFrame;
}

Issue in line:
dstFrame = (Bgra32VideoFrame)srcFrame;

Exception:
Unable to cast COM object of type 'System.__ComObject' to class type 'StillsCSharp.Bgra32VideoFrame'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.

Windows OS:
Windows 10

Please help me in resolving the issue

Re: COM exception during ConvertFrame function

PostPosted: Wed Mar 27, 2019 12:47 am
by cristhiangr
Hello, I have the same problem, could you solve it?

Re: COM exception during ConvertFrame function

PostPosted: Wed Mar 27, 2019 11:26 pm
by Cameron Nichols
Hi Cristhian,

Please download the latest Desktop Video SDK 11.0, this issue was resolved in this release.

Kind Regards
Cameron

Re: COM exception during ConvertFrame function

PostPosted: Tue Apr 02, 2019 8:34 pm
by cristhiangr
Thank you Cameron
I already have it but now I have another problem in this new SDK in Strill.cs in the VideoFrameArrived method in the code "if (m_captureCountdown! = Null)
m_captureCountdown.Signal (); "I missed the following error" System.InvalidOperationException: 'Invalid attempt to reduce the count of the event below zero'. "