Big size videos taking to long to load

My env detials

Im using visual studio env with only streamlit installed other then the standart packages. Its in my flash disc connected local device without ram limitations via 3.1 port. Using Streamlit verison 1.38.0.

Problem:

Loading a streamlit video elements cosumed nearly 10gb of ram when i try to load a 1080p 60 fps over one and a half hour long file. There is no compression and video encoding because it shouldnt lose quality for the project im running.

The Method:

    _mediaPlayer = st.empty()
    _mediaPlayer.video(_orginizedFile[_targetMedia]["video"])

_orginizedFile is a dict accuired by a function running fast so problem isnt caused by that.

Similar threads i managed to find:

Some new information:

Testing

Most important part is ram usage at this point it can peek to 20gb without a warning to it from 7gb. Without videos loaded with same session state i get 30.2 MB. Track goes like this:

  • opened avg 32MB
  • Session State added avg 32.3MB
  • Video Loading avg 9,3gb
  • When full version loaded avg 7,5 gb
  • When try to go back or forward while watching avg 10gb and may peek over 20gb

Loading time isnt good either. In ssd(one os is installed in documments folder) it loads in avg 6.7 second and in usb connected via 3.1 port it takes 7.31 seconds.