imstkgp / aforge

Automatically exported from code.google.com/p/aforge
Other
0 stars 0 forks source link

BLACKMAGIC DECKLINK CAMERA ISN'T WORKING #363

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.i selected Blackmagic Decklink camera 
2.trying to call start function of Aforge.Net's videocapture device's Start
3.Returned error with Unable to cast COM object of type 'System.__ComObject' to 
interface type 'AForge.Video.DirectShow.Internals.IAMVideoControl'.
This operation failed because the QueryInterface call on the COM component for 
the interface with IID '{6A2E0670-28E4-11D0-A18C-00A0C9118956}' 
failed due to the following error: No such interface supported (Exception from 
HRESULT: 0x80004002 (E_NOINTERFACE))

I can't get frames from this camera at any cost...but it is giving only black 
frmaes

What version of the product are you using?

Please provide any additional information below.

Original issue reported on code.google.com by Jenifer....@mamigoinc.com on 24 Oct 2013 at 7:11

Attachments:

GoogleCodeExporter commented 9 years ago
I am using 2.2.5 version of Aforge

Original comment by Jenifer....@mamigoinc.com on 24 Oct 2013 at 7:11

GoogleCodeExporter commented 9 years ago
Since I don't have this camera to try, cannot debug this issue on my side.

Does it work fine with other software (like Skype, for example)?

Original comment by andrew.k...@gmail.com on 24 Oct 2013 at 7:16

GoogleCodeExporter commented 9 years ago
i have downloaded the project solution for Video.DirectShow and tried to debug 
the code...Let me post that part of code

                Type type = Type.GetTypeFromCLSID( Clsid.CaptureGraphBuilder2 );
                if ( type == null )
                    throw new ApplicationException( "Failed creating capture graph builder" );

                // create capture graph builder
                captureGraphObject = Activator.CreateInstance( type );
                captureGraph = (ICaptureGraphBuilder2) captureGraphObject;

                // get type of filter graph
                type = Type.GetTypeFromCLSID( Clsid.FilterGraph );
                if ( type == null )
                    throw new ApplicationException( "Failed creating filter graph" );

                // create filter graph
                graphObject = Activator.CreateInstance( type );
                graph = (IFilterGraph2) graphObject;

                // set filter graph to the capture graph builder
                captureGraph.SetFiltergraph( (IGraphBuilder) graph );

                // create source device's object
                sourceObject = FilterInfo.CreateFilter( deviceMoniker );
                if ( sourceObject == null )
                    throw new ApplicationException( "Failed creating device object for moniker" );

                // get base filter interface of source device
                sourceBase = (IBaseFilter) sourceObject;

                // get video control interface of the device
                try
                {
                    videoControl = (IAMVideoControl) sourceObject;
                }
                catch(Exception exMsg)
                {
                    MessageBox.Show(exMsg.Message);
                }

this is part of code inside "Workthread" function inside VideoCaptureDevice 
class.hence at the line of this "videoControl = (IAMVideoControl) 
sourceObject;" this Blackmagic device is getting failed giving the error like
"Unable to cast COM object of type 'System.__ComObject' to interface type 
'AForge.Video.DirectShow.Internals.IAMVideoControl'. This operation failed 
because the QueryInterface call on the COM component for the interface with IID 
'{6A2E0670-28E4-11D0-A18C-00A0C9118956}' failed due to the following error: No 
such interface supported (Exception from HRESULT: 0x80004002 
(E_NOINTERFACE))."...But for other devices it is getting passed

Original comment by Jenifer....@mamigoinc.com on 24 Oct 2013 at 9:12

GoogleCodeExporter commented 9 years ago
IAMVideoControl us not needed to have video output. As you can see, the 
original code is:
// get video control interface of the device
try
{
    videoControl = (IAMVideoControl) sourceObject;
}
catch
{
    // some camera drivers may not support IAMVideoControl interface
}

So if you camera does not support IAMVideoControl, it is not a showstopper. The 
issues must be somewhere else. But don't have the camera to debug.

Original comment by andrew.k...@gmail.com on 24 Oct 2013 at 10:50

GoogleCodeExporter commented 9 years ago
Thanks for your reply....Ok...I have added the class i attached ...this is my 
code i have added for test:
        [TestMethod()]
        public void testCameraInterface()
        {
            Assert.AreEqual(true, camDev.Init("DECKLINK VIDEO CAPTURE"));//U2 EE CAM//DECKLINK VIDEO CAPTURE
            camDev.Start();
            System.Threading.Thread.Sleep(4000);
            if (camDev.bitmap != null)
                camDev.bitmap.Save(@"C:\Users\developer\Documents\Mamigo\Test\Sample00.jpg");
            else
                Assert.Fail();
            camDev.Stop();

        }

camDev is the object of Cameradevice class i have attached...Hence i have 
bitmap object which is to grab frame but returns null...I have one more info to 
give...In third party softwares like Flash Media Encoder,Black Magic SDK and 
all work fine only with their own properties like in 
resolution-1920x1080 
video format-HD1080i 59.94-8-bit 4:2:2YUV 
FRMAERATE:29.97
this device dint work with any other configuration...I think now you can figure 
out issue,,,

Original comment by Jenifer....@mamigoinc.com on 24 Oct 2013 at 12:22

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by andrew.k...@gmail.com on 5 Nov 2013 at 1:47

GoogleCodeExporter commented 9 years ago
Have you solved the problem?

Original comment by gdy4m...@gmail.com on 9 Feb 2015 at 2:36

GoogleCodeExporter commented 9 years ago
See the status. Don't have this camera, so not doing anything until then.

Original comment by andrew.k...@gmail.com on 9 Feb 2015 at 3:00

GoogleCodeExporter commented 9 years ago
I have remote access to computer with attached camera. Can I help you to solve 
this problem? For example I can debug source code and write log

Original comment by gdy4m...@gmail.com on 9 Feb 2015 at 3:08

GoogleCodeExporter commented 9 years ago
Hi there
I was thinking that I'm the only one who faced such problem and can't find 
solution.
Andrew, I beg you to help...

I can provide remote access for debugging or everything you need to solve this 
*** problem.

Regards, Mike

Original comment by DieselBY...@gmail.com on 10 Feb 2015 at 9:39