VideoCog FAQ
Last Updated : February 15, 2007
1. Installation, Licensing, & Distribution
1.1. How is the VideoCog licensed?
1.2. Do I have to pay for a license for each copy I distribute?
1.3. Why do I get a license error when I attempt to add the control to my form?
1.4. Do I need to ship the license file with the VideoCog when I distribute the application?
1.5. How do I add the VideoCog to my project?
1.6. Can I install multiple versions of the VideoCog?
1.7. What versions of Visual Studio .NET are supported?
1.8. How do I update to the latest version?
1.9. License Error when VideoCog is not on the main form?
2. VideoCog Programming
2.1. Can I capture multiple cameras simultaneously?
2.2. Do you have a list of compatible capture devices?
2.3. How do I recompress a file?
3. Image Processing / DVizion
3.1. How do I get an image for processing?
3.2. How do I add an image overlay?
1. Licensing And Installation
1.1. How is the VideoCog licensed?
The VideoCog uses the standard .NET Component licensing mechanism. This means it looks for a license at design time, and embeds this license into the application. See the licensing section in the
documentation for detailed information on how the licensing works.
1.2. Do I have to pay for a license for each copy I distribute?
No. There are no additional costs, run-times, or royalty fees associated with building or distributing applications using the VideoCog.
1.3. Why do I get a license error when I attempt to add the control to my form?
Typically this indicates either the VideoCog license file is not present in the same folder as the VideoCog DLL you are using, or the license file is invalid. Please contact support for detailed help.
1.4. Do I need to ship the license file with the VideoCog when I distribute the application?
No. The license is embedded into your application when you compile it, so there is no need to distribute the license file.
1.5. How do I add the VideoCog to my project?
1.6. Can I install multiple versions of the VideoCog?
Yes. Each version will install in its own folder. To use a specific version in your project file, simple add that specific file to your Visual Studio Toolbox.
1.7. What versions of Visual Studio .NET are supported?
The VideoCog is built under Visual Studio .NET 2003 and the 1.1 .NET framework. It has been tested and is supported under VS.NET 2003 and VS.NET 2005.
1.8. How do I update to the latest version?
If you upgrade to a new major version of a component ( for example, from version 1.0 to 2.0), and there is a new license file associated with the new component, you will need to remove the previous license file associated with the project and create a new one. From Visual Studio, perform the following:
- Delete the previous *.licx file
- Close and re-open the Project/Solution
- Re-save all forms containing the component. On Form -> Save, Visual Studio should generate a new *.licx file.
Yes. Each version will install in its own folder. To use a specific version in your project file, simple add that specific file to your Visual Studio Toolbox.
1.9. License Error when VideoCog is not on the main form?
Currently, licenses.licx files generated by User Controls do not get automatically embedded into the host form app/exe.
The current workaround for this situation, "VideoCog in Custom UserControl", is to add the licenses.licx file from the custom UserControl project to the hosting Windows forms application project.
This will embed the license in the Windows Forms application where the VideoCog will be able to find it at run time. If there already is a licenses.licx file in the Windows Forms application as a
result of another licensed control, simple edit the licenses.licx file (a text file) and add the VideoCog entry to it.
2. General Programming
2.1. Can I capture multiple cameras simultaneously?
Yes. Just add two instance of the component to your form, and initialize each with the camera's friendly name.
2.2. Do you have a list of compatible capture devices?
No. There are simply too many devices out there to list and test for compatibility. Since the VideoCog uses DirectShow for it's device support, our general rule of thumb is, if you can see it in windows Movie Maker, you should be able to see it with the VideoCog. You can also try using
dVine, our in house tool for video testing.
2.3. How do I recompress a file?
A. There are 4 basic steps to recompressing a video file:
- Set the compressor
- Set the source
- Set the output
- Record
Example:
// Recompression example
ArrayList array = new ArrayList();
array = videoCog.EnumerateCompressors();
videoCog.Compressor = array[1].ToString();
videoCog.Streams[0].Source = "C:\\Input.avi";
videoCog.OutputFile = "C:\\CompressedOutput-" + array[1].ToString() + ".avi";
bSuccess = videoCog.Record();
Recording will stop automatically when the end of the input file is reached, or if the Stop function is called.
3. Image Processing / DVizion
3.1. How do I get an image for processing?
Your application can process images in real time using the frame callback mechanism in the VideoCog. This mechanism will call your application (callback) for each frame as it passes through the video graph.
There are 3 steps you need to take to ensure you receive image callbacks to your application:
- Enable the sample grabber.
- Define a callback function.
- Notify the VideoCog of the callback function.
1. Enable the sample grabber for the specific stream in the video graph:
videoCogControl1.Streams[0].GrabberEnabled = true;
2. Define the callback function that will be called every frame:
private void FrameCallback(double SampleTime, System.IntPtr pBuffer,
int BufferSize, int Width, int Height)
{
// invert the image
unsafe {
byte* p = (byte *)(void *)pBuffer;
int nWidth = Width * 3;
for(int y = 0; y < Height; y++)
{
for(int x = 0; x < nWidth; x++ )
{
p[0] = (byte)(255-p[0]); p++;
}
}
}
}
3. Set the callback function.
videoCogControl1.SetFrameCallback(new Cogitance.DelegateFrameCallback(this.FrameCallback));
See our online image processing tutorial for more information.
3.2. How do I add an image overlay?
An image overlay, such as a bitmap graphic, can be added to the video stream either manually or using the TGA overlay filter included in the DVizion library. The lTGA filter draws a specified TGA file onto the video stream at the specified location and opacity. 32 bit TGA files with alpha channel can be used to alpha blend the overlay with the underlying video image.
To add an overlay using the TGA filter, see the "logo" examples in the examples folder.