PDA

View Full Version : Recording from DFK 41BF02 AVI video with codec YUY2@7.5fps



Cesar
June 7, 2010, 23:41:54
I am trying to record from one DFK 41BF02 an AVI Video file at YUY2@7.5fps.
The following function works with some Codecs but if I use "YUY2" the system stop.
I also try to use a word as Codec like "airplane" and I have the same error as I used "YUY2". It looks like the software does not find the CODEC.

Maybe there is an error of the YUY2 installation but using the "IC Capture 2.1 TIS" works fine to record AVI-YUY2@7.5fps.

Any help I will appreciate.

Best Regards,

Cesar



private void btnStartCapture_Click(object sender, System.EventArgs e) {
icImagingControl1.LiveStop();
icImagingControl1.AviStartCapture("video.avi", "MJPEG Compressor");
btnStartCapture.Enabled = false;
btnStopCapture.Enabled = true;
}

Stefan Geissler
June 8, 2010, 12:23:02
Hello,

Please make sure, the video format of the camera is "YUY2" and nothing else, because there is not conversion from any video format to "YUY2" available. I think this is your problem.

Cesar
June 9, 2010, 03:49:11
Dear Stefan :

I can choose only "BY8", "Y800" or "UYVY". I choose "UYVY" and in the software I select to record with the codec "UYVY". If I use MJPEG or other compress codec I do not have problems.

The error is :

TIS.Imaging.ICException was unhandled

Message="Internal error"

Source="ImagingControl3"

ErrorCode=-2146828286

StackTrace:

at TIS.Imaging.ICImagingControl.AviStartCapture(Strin g filename, String AviCompressorName)

at Save_AVI.Form1.btnStartCapture_Click(Object sender, EventArgs e) in C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 3.0\snippets\CS\Save AVI - C#\Form1.cs:line 141

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)

at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)

at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.Run(Form mainForm)

at Save_AVI.Form1.Main() in C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 3.0\snippets\CS\Save AVI - C#\Form1.cs:line 123

at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()

at System.Threading.ThreadHelper.ThreadStart_Context( Object state)

at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

InnerException: System.Runtime.InteropServices.COMException

Message="Exception from HRESULT: 0x800A0002"

Source="Interop.ICImagingControl3"

ErrorCode=-2146828286

StackTrace:

at ICImagingControl3.IICImagingControl.AviStartCaptur e(String Filename, String Compressor)

at AxICImagingControl3.AxICImagingControl.AviStartCap ture(String filename, String compressor)

at TIS.Imaging.ICImagingControl.AviStartCapture(Strin g filename, String AviCompressorName)

InnerException:



Best Regards,

Cesar

Stefan Geissler
June 9, 2010, 08:28:30
Dear Cesar,

Please try the same with IC Capture.

I am not sure, how do you set the UYVY codec. However, it must be done as MEDIASUBTYPE_UYVY, not as string "UYVY" to the sink creation function


icImagingControl1.AviStartCapture("video.avi", MEDIASUBTYPE_UYVY );

Cesar
June 10, 2010, 03:25:34
Dear Stefan:

Thank you very much for your help.
IC Capture 2.1 TIS" always works fine to record AVI-UYVY@7.5fps from 4 cameras at same time.
You are correct, MEDIASUBTYPE_UYVY has to be the solution.
I am new in .NET programming and I will appreciate any tip to declare in the.cs file the MEDIASUBTYPE_UYVY.
I know it has to be something like
public static Guid MEDIASUBTYPE_UYVY = new Guid(0x59565955, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);


Best Regards,

Cesar

Stefan Geissler
June 11, 2010, 13:08:10
Hello,

the GUID is already defined in IC Imaging Control. You can use it, without defining it on your own.