meterkeron.blogg.se

Processing video scrubbming with mousex
Processing video scrubbming with mousex










processing video scrubbming with mousex

Zoom your video by pressing the left mouse button. But if you like to highlight the zoom area, you might use the effect frame without any filtering: myFrameClone.MFOverlayRect(myEffectFrame, null, ref newRect, eMFOverlayFlags.eMFOF_Crop, 1, "", "") Sample applicationįor your reference, a sample application that illustrates this logic is attached below:

processing video scrubbming with mousex

Technically, it is enough for the proper zooming of the video. The overlay with the filter mask: myFrameClone.MFOverlayRect(cutFrame, myMaskFrame, ref newRect, eMFOverlayFlags.eMFOF_Crop, 1, "", "") The x and y point to the center of the rectangle, so there are " -250" in calculations. The bigger rectangle of 500x500: MF_RECT newRect = new MF_RECT() So, you should use the mask frame to create a round overlay. If there is no mask then the result looks like a square overlay. If the rectangle is bigger then there is a zoom effect. You should specify a new rectangle to place the cut frame. So, the target rectangle of 200x200 should have the following parameters: tagRECT rect = new tagRECT()Īnd, finally, you should cut the rectangle from the source frame: myFrameClone.MFCut(0, ref rect, out cutFrame) Zoom and Mask Where the panelPreview is your actual preview control, and the m_nMousePosX and the m_nMousePosY are the X and Y coordinates of a mouse pointer over your preview. This is an incredibly useful feature if you have multiple videos that look similar but are somewhat different (perhaps, different versions of a project) and you want to quickly identify which one is which. Int y = Math.Abs( * m_nMousePosY / panelPreview.Height) Contact Sheet mode Hover scrubbing triggers when you move your mouse from left to right over the video thumbnail. Int x = Math.Abs( * m_nMousePosX / panelPreview.Width) Now, you should calculate a relative mouse pointer position: MFFrame cutFrame To calculate proper parameters, you should get video properties of the processed frame: myFrameClone.MFAVPropsGet(out M_AV_PROPS myProps, out int samples) The main idea is to cut a square from the original frame, filter it with the mask and overlay it over the source frame.

processing video scrubbming with mousex

Once a source frame has been received, you should clone it to avoid any memory access issues: mSourceFrame.MFClone(out MFFrame myFrameClone, eMFrameClone.eMFC_Full, eMFCC.eMFCC_Default) MFFactor圜lass myFactory = new out MFFrame myEffectFrame, out myMaskFrame, "") Frame processing You should use both images to generate new frames: MFFrame myMaskFrame

#PROCESSING VIDEO SCRUBBMING WITH MOUSEX FULL#

You should use full black for full transparent parts. The mask uses white color to filter the video, and it uses other colors as transparent. Just like this.įor the effect, we need an image of the shadow effect and a mask: This article implements frame overlay, generation new frames from local files, and some other frame processing features.Ī feature to zoom a selected part of a video under a mouse pointer.












Processing video scrubbming with mousex