polarby / render

A package to render any native static and moving flutter widgets to exportable formats
https://pub.dev/packages/render
MIT License
49 stars 26 forks source link

exported video is lagging #10

Closed wdcs-harshlathigara closed 1 year ago

wdcs-harshlathigara commented 1 year ago

Describe the bug i have created video with the help of render package but video is so much lagging a widget that i want to render in video its contains some text widget with animation

Expected behavior video should play smooth.

polarby commented 1 year ago

This package is very well documented, please refer to the Using settings to keep up performance heading to check what you can do to keep performing at high quality. Due to hardware limitations, you must compensate for either the process duration, video quality, or fluency (what you have described). I recommend taking longer rendering time instead of fluency.

I have thought about making automatically adjusted settings (where you just set your preferences of compensation), but it is hard to find documentation to check the current FPS of the device. I wasn't able to archive that yet.

I am gonna close this issue, as I think generally this is a settings issue. If you want to get invested in building an automatic solution, please don't hesitate to reach out to me for help (eg. pull request).

wdcs-harshlathigara commented 1 year ago

yes i have checked your documentation and i have tested with all possible combination but unable to achieve desired output

polarby commented 1 year ago

Could you please provide me with a mockup code of what you are trying to archive? If your UI widget is big, it might also be unnecessary to set a high pixel ratio.

I recommend you lower the pixelRatio and lower the simultaneousCaptureHandlers while setting your frameRate to your desired output. Then slowly adjust settings to fit even more to your needs, without lagging.

Note that lagging is not caused by the post-capturing processing, but by too many simultaneous processes during capturing, which makes the whole application lose its frame rate and therefore also the UI images that can be repainted (due to too many handlers, images being stored, etc.). Therefore, it is critical to keep the device framerate high, while post-processing usually can help you out by adjusting the image quality through upscaling.