hi to all,
I have design a Application that takes input

from the Web cam or other video devices. and

have to add some frames in the Live video and

then display.
i have study out the direct sdk , which

provide the flexible enviornment. but i dont

get the proper flow.It is totaly based on the

VC++ component.
Please Help.
Thanks.

Dani AI

Generated

raised a common need: capture live webcam video, draw (overlay) frames, and render the result. is correct that DirectShow is a capable low-level path, but that route often forces work in native C++ (custom transform filters or renderer changes) for low-latency, GPU-backed overlays. For a quicker managed solution, capture the frame stream into C#, draw overlays there, and present the result—this trades a bit of latency for much simpler development.

A compact managed pattern using AForge (works with DirectShow devices) is shown below. The capture library raises a NewFrame event that provides a Bitmap which can be drawn on and sent to a UI control. Keep per-frame work small and always dispose bitmaps to avoid leaks.

using AForge.Video;
using AForge.Video.DirectShow;

var devices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
var cam = new VideoCaptureDevice(devices[0].MonikerString);
cam.NewFrame += (s, e) =>
{
    using (var frame = (Bitmap)e.Frame.Clone())
    using (var g = Graphics.FromImage(frame))
    {
        g.DrawImage(overlayBitmap, 10, 10); // overlayBitmap preloaded
        pictureBox1?.Invoke((Action)(() =>
        {
            var prev = pictureBox1.Image;
            pictureBox1.Image = (Bitmap)frame.Clone();
            prev?.Dispose();
        }));
    }
};
cam.Start();

For production or true zero-copy overlays, insert a native transform filter between the capture source and renderer (graph: Source -> TransformFilter -> VMR/EVR) or use Media Foundation on modern Windows; those routes give GPU acceleration but require C++/COM work. Practical tips: match capture resolution to overlay, avoid heavy per-frame processing on the UI thread (use a worker or lock-free queue), watch pixel-format conversions when drawing, and ensure x86/x64 build matches native dependencies. If tight latency and frame-accurate sync are required, implementing the overlay as a native DirectShow/EVR component is the reliable path.

Recommended Answers

All 2 Replies

I would like to suggest you to use DirectShow..

i had tried direct show. but it have limited functionality.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.