Click here to Skip to main content
15,887,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wrote a code using Aforge to capture the Video from the camera and display it in VideoSourcePlayer. The problem is the displayed video is not mirrored as it should be.

I was able to mirror it using filter, but this applies only on the saved recordings or images, because the Mirror filter requires Image type to be applied.

Here is the code for displaying the video where I need help to mirror it.

fiF = New FilterInfoCollection(FilterCategory.VideoInputDevice)
       finalVideo = New VideoCaptureDevice(fiF(SelectedCam).MonikerString)
       finalVideo.VideoResolution = finalVideo.VideoCapabilities(VidResolution)
       VideoSourcePlayer1.VideoSource = finalVideo
       finalVideo.Start()


And here is the code where I apply mirror on the recorded videos.

If Recording = True Then
            Try
                
               
                BMP = DirectCast(eventArgs.Frame.Clone(), Bitmap) 

                Dim Fltr = New Mirror(False, True)
               
                Fltr.ApplyInPlace(BMP)

                VFwriter.WriteVideoFrame(BMP)
               
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try

        Else

            VFwriter.Close()
           
        End If


What I have tried:

Applying the same Mirror filter on videoSourcePlayer didn't work. I'm sure there is a different way to Mirror the streaming video. Any help will be appreciated.
Posted
Updated 2-Sep-20 5:53am

1 solution

I would take a look at the Aforge new frame event, more details on that can be found using the link below
NewFrame Event[^]

According to Aforge documentation
The event is fired on each new frame received from video source. The event is fired right after receiving and before displaying, what gives user a chance to perform some image processing on the new frame and/or update it.

Note Note:Users should not keep references of the passed to the event handler image. If user needs to keep the image, it should be cloned, since the original image will be disposed by the control when it is required.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900