polybiusproxy / hxCodec

Haxe library for native video playback on HaxeFlixel and OpenFL.
https://lib.haxe.org/p/hxCodec
Mozilla Public License 2.0
108 stars 70 forks source link

First time loading videos sometimes takes a while to load (Needs more testing) #286

Open trayfellow opened 1 year ago

trayfellow commented 1 year ago

With hxCodec 3.0 loading videos for the first time can take to 10-15 seconds to load

NeeEoo commented 1 year ago

Can confirm this also happens for me on mac, sometimes it took 15 seconds sometimes it takes 50 seconds, i also see the lag happening for other people i see playing a mod i worked on

JonnycatMeow commented 1 year ago

i have an idea

JonnycatMeow commented 1 year ago

we can use file caching

JonnycatMeow commented 1 year ago

Screen Shot 2023-07-15 at 5 59 20 PM

EgguMan commented 1 year ago

This occurs because the video is being moved from hard storage to RAM, and videos are very dense.

JonnycatMeow commented 1 year ago

is there anyway to fix it?

EgguMan commented 1 year ago

is there anyway to fix it?

The way I did it is with this little work around on a seperate thread in my loading state.

image

JonnycatMeow commented 1 year ago

well could there be another way for it to be a perminate fix for hxCodec

EgguMan commented 1 year ago

well could there be another way for it to be a perminate fix for hxCodec

To my understanding no. To do that it would need to preload every single video in the game at once. Not only is that extremely stressful on the PC but it's very resource dependent

JonnycatMeow commented 1 year ago

oh ok

JonnycatMeow commented 1 year ago

well can you make a example on the readme and name it preload video so people can do what you did to the video

EgguMan commented 1 year ago

well can you make a example on the readme and name it preload video so people can do what you did to the video

Nah, it all works off a custom cutscene framework I made for my mod

JonnycatMeow commented 1 year ago

oh

JonnycatMeow commented 1 year ago

what is your mod called and does it have a source code on github?

polybiusproxy commented 1 year ago

Hello, does this issue occur when loading small videos? How big are the videos you're trying to load?

EgguMan commented 1 year ago

Hello, does this issue occur when loading small videos? How big are the videos you're trying to load?

it appears to be based on the size of the videos, from my limited testing

KarimAkra commented 1 year ago

IMG-20231022-WA0001(1)

I manged to make it load faster using sys.threads.Thread

polybiusproxy commented 9 months ago

Won't fix atm, it is expected for hxCodec to take time when loading big videos, due to it being single-threaded, slow I/O speed on the hardware side, etc.

JonnycatMeow commented 9 months ago

hxvlc has faster loading time and they already did the byte video support

polybiusproxy commented 9 months ago

Yeah, I've seen quite a lot of stellar work on hxVLC, might as well replace hxCodec hahaha

JonnycatMeow commented 9 months ago

well i am gonna try to make vlc wasm so people don't have to worry about video support on web & you can probably make it into a app for ios. just get a https website link and convert it into a .app for ios