Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How could I embed the drawing (rasterizing?) into some video stream? #46

Closed
ryuujo1573 opened this issue Mar 1, 2022 · 7 comments

Comments

@ryuujo1573
Copy link

Firstly, I would express my appreciation for your work, which is amazing and cool.

If convenient for you, could you give my any hint on doing some stuffs which AE/Pr would do, like video composing, with Flutter widgets and your graphx abilities?

Sorry for my poor knowledge but I want to know if it is possible, for I've known that Flutter is based on Skia. May it be okay to do some special work to be capable of video composing. Which document I should refer to?

Excuse my strange language and thank you 👍

@roipeker
Copy link
Owner

roipeker commented Mar 1, 2022

Hi @ryuujo1573 . If you mean capturing a video from a Widget, like screen recorder, you should see if you can find a package in pub.dev
I think Flutter processing has an option to export gifs. Graphx has nothing on the subject.

Did I answered your question?

@ryuujo1573
Copy link
Author

I've found this “Video Editor in Flutter using dart”, which is the similar case.

Maybe I was wondering how could I harness graphx abilities to make some awesome effects in producing video (or live-stream)...
and seemingly this "Render Flutter animation directly to video" may be the clue to embed the drawing into videos.

Thank you.

@roipeker
Copy link
Owner

roipeker commented Mar 4, 2022

sorry the misunderstanding.
You can rasterize any DisplayObject with createImage() (outputs a dart.ui.Image) might be cpu intensive... the callback is async though, so I guess you can have a flag on stage.onEnterFrame to capture the stage for a period of time and save the images in a List, then output every image separately as frame1.png, frame2.png etc then use ffmpeg to join them as video/gif... i doubt u can get 60fps though in this process... and probably will need some fine tuning, but might work.

@ryuujo1573
Copy link
Author

Is it possible to access Skia so as to draw into the buffer using GPU? (or any APU by some authentic SDK from manufacturers)
I found nothing on how to do this, or maybe I could make a fork to Flutter and mess with bunches of code?
Appreciations, Zhang.

@roipeker
Copy link
Owner

roipeker commented Mar 5, 2022

I think you have to recompile the flutter engine with the exposed backend from Skia that you need. That's beyond my knowledge though.

@ryuujo1573
Copy link
Author

I'll try for that.
Thank you ❤️

@ryuujo1573
Copy link
Author

flutter/flutter#99593
Initiated!
Any advise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants