WinUI3 & Unoplatform: Drawing brush on image/video surface while playing and save it directly on original file - computer-vision

Hello I am building an image/video editing application (runs on window 11) using Unoplatform.
(Unoplatform internally use WinUI3)
What i want to do is
App can load image/video frame on canvas
Use brush effect on frame surface like drawing pad feature
During playing video, user can add effect on every frame and modified frame saved right away on original file.
During playing video, do computer vision processing to recognize object and add mark on frame
Audio must playable
So my question is,
How can I add an effect to only a specific frame in the original video and save it using Unoplatform(or WinUI3) API?
Is it possible to play video on canvas view and get frame by frame from MediaPlayer?

Related

QT widget How to get RGB Buffer from QCamera

I am porting an video streamer application to QT (from HTML), I just had the webcam working using QT, and now I want to know How can I get the RGB Video buffer from a QT Camera? All the samples I can see is capturing image to a file.
I am using QT Widgets and not QML since its a desktop application.
What I am trying to do is to get the buffer image of the camera, compress it and send to network.
And I want to trigger this manualy since I want to call the capture of next frame when all the compression and sending is done to prevent timing issue.

Drawing items on VLC object

Recently I have tried to do some graphics on the top of VLC video using vlc-qt (which provides a video widget). The approach was trying to draw something on the widget. But it failed duo to the fact that vlc-qt's widget uses an internal widget to render video. (See more details here)
Now I'm trying to do something different. I want to try drawing text (or some rectangles) on the VLC media itself (not the widget). I suppose it's the way how VLC media player renders subtitles (isn't it?)
So the question is this: Having a vlc-qt interface, how can I access underlying vlc object and draw something on it [using libVLC API]?
I'm afraid the only way to do it with libvlc is to use libvlc_video_set_callbacks + libvlc_video_set_format_callbacks. It will decode media stream's frames to memory, which you could use as you wish.

How to pass D3DDevice in LibVLC to be the "HWND"

I wanted to use libVCL to display a video in my game, however I have issues with using HWND when the game is in fullscreen, the fullscreen surface overlaps the video.
I do have the D3DDevice handle available though so the video could draw inside the game surface.
But all I've found is libvlc_media_player_set_hwnd() and not a way to pass the video surface to my game's surface for drawing. Is there any way/example to do this?
There is no such function in LibVLC.
I think you need to use the video format callbacks and render the video buffer to a texture yourself. That is the I the approach I used (from Java with JMonkeyEngine for example).
See libvlc_video_set_callbacks, libvlc_video_set_format and libvlc_video_set_format_callbacks.
I've seen this play back full HD smoothly, but this will consume more CPU than having VLC render directly into a video surface.

How to process the frame before display in VLC media library

I'm using VLC library to create a simple media player, the program will display instructions above the video. These instructions are varying in position, size and color. I need to process the video frame before it's displayed to add my drawings. How can this be done? How can I have the libvlc show this large text when changing the volume up or down?

How can I access the current frame in C++ builder 6 MediaPlayer object when I have paused the video?

How can I access the current frame in C++ builder 6 MediaPlayer object when I have paused the video?
i use a panel or Animate object as its display but I can't find a property or function for neither the MediaPlayer object or its display that lets me access the currently paused frame so that I can be able to copy its pixels information to a bitmap or do some processing on it!
I did this to copy the display image to a bitmap image but it just copies the display(panel or animate) background color:
MediaPlayer1->Display->PaintTo(Image1->Canvas, 200, 200);
TMediaPlayer does not support what you want. You will have to switch to another API, like DirectX or libav, which can give you access to the frame data and expects you to render the frames visually yourself as they are being given to you.