rebinf / QuranVideoMaker

A video editor with the emphasis on creating Quran translation videos.
Other
22 stars 7 forks source link

Exporting Bugs #5

Closed Iam-Muslim closed 1 year ago

Iam-Muslim commented 1 year ago

Al slamo alaikom my brother , During Exporting any quality of video even if it was low , all of my pc resources are being used My ram is 8 gb and it is used 100% My cpu is core i5 11th and it is used 100% while the gpu is not used completely

It should use the gpu instead of cpu during exporting

Thank you for this work , may allah reward you in afterlife <3

rebinf commented 1 year ago

Wa Alaykum salam,

In general, the performance of the app is not great, it uses several external libraries in a "hacky way" to preview and export the videos.

I'm currently rewriting some of the code, once that's done, dealing with performance issues would be next.

Thank you for your kind words, you too.

Iam-Muslim commented 1 year ago

Alslamo alaikom my brother <3 , related to exporting most of time , exporting is stuck at half and it stops using the resources from my pc . i can appear in long recites more than 2 minutes

image

rebinf commented 1 year ago

Wa alaykum salam,

This may have something to do with exporting threads, for now I've made it possible for threads to have default value of -1 until I find a good solution for playback and rendering.

Iam-Muslim commented 1 year ago

Thank you for fast replying , i have took more screenshots to explain for you the freeze of the exporting And when i tried in debug mode in visual studio , visual studio itself crashes at the freeze point

This is Screenshot number 1 ( Exporting 1080 video 24 Minutes , Using full 100% Cpu and more than 10gb Ram ) 1

This is Screenshot number 2 ( after the Exporting stucks at a point and the cpu usage goes to zero and whenver you restart exporting the cpu usage is zero and exporting doesn't start unless you restart the whole app ) 2

I am sorry if i bother you my friend <3 If i need to contribute with you or trace errors , i need to read the whole code and see how it works and inshaa allah i will do this later. For this now exporting is not working and buggy Note : I tried to export the same project but under 360p and it was done , so the problem is in high resolution as it stops in 480 and above maybe the exporting cannot handle long export time with slow progress tell me if i continue tracking issues or stop that if it is bothering you :)

I found a good repo which you can get a look at and maybe you can implement or copy from there some functions :

https://github.com/zngduong/VideoSubtitleCreator

https://github.com/AngryCarrot789/FramePFX

rebinf commented 1 year ago

You're not bothering me at all 🙂

Thank you for reporting this issue and looking up solutions.

It is very likely it's running out of RAM, lower resolution videos take up less memory, that's probably why exporting the same poject works when lowering the resolution.

InShaAllah I will look into this and have a look at the suggested repos this weekend.

JazakAllahu Khayran

rebinf commented 1 year ago

After some investigation, it seems like there was a massive memory leak caused by skiasharp. Also further memory usage by using opencv to create the initial video. For now garbage is collected during export several times, it feels very hacky but seems to be working.

The memory usage for a roughly 30 seconds of 4K video was about 40GB! Now this is back down to about 7GB. I've tested a similar video with kdenlive the memory usage was about 6GB. So memory usage by QuranVideoMaker now seems acceptable. As for the CPU, it is fully utilized, saw similar behavior with kdenlive.

For now I'm closing this issue.

Iam-Muslim commented 1 year ago

Thank you my brother , That was fixed The following link has 7 fonts for the great quran where you can use them https://easyupload.io/px3yc8

Note that link expires after 30 days Also , you can check ffmpeg latest release it has only one .exe instead of those all .dlls

may Allah bless you , Insha'a I will finish some work and start contributing with you <3

rebinf commented 1 year ago

Thank you,

Thanks for the fonts, however I don't use file sharing websites, for various reasons, is there a reputable website where I can get the fonts?

That version of mpeg is much bigger:

Screenshot 2023-07-29 204958 Screenshot 2023-07-29 205057

Wa iyakum, a pull request is always welcome :)

Iam-Muslim commented 1 year ago

Thank you my brother for replying , yes you are right, it is much bigger .I didn't take size in consideration This link has 21 fonts but after testing it had 7 fonts only which worked well The site is in arabic , insha'a Allah I'll search some other fonts after some time.

https://fonts.qurancomplex.gov.sa/

rebinf commented 1 year ago

Thanks for the link, I've checked it out, I don't see any other better fonts than the uthmani script font. Custom fonts can be put in Fonts folder in the app directory. JazakAllahu Khayran