- Home /
Play long movie 1gb - streaming?
I want to paly long movie (almost 1GB) without long loading and without hiccups in my game.
can i creat a stream from video files?
can i play a video file part by part(every part is 10-second).
like a video file in websites that show 10-second first and in background load 10-second next, and repeat this act until the end of the video file.
please help it is very necessary for my.Thanks a lot!!!
I think after they downloaded it, it will not be too long to be loaded.
Anyone who streams a gigabyte worth of data from watching a single video would probably not be a happy camper... O.o
@Jodhale : He isn't downloading. . . He said strea$$anonymous$$g . . .
I think you should go back and rethink what your doing cause both solutions seems bad.
A. You have them download the video and its part of the game files. Sure you could watch it then but its 1gig just for the video, I mean no offense but its like 350 mbs for a 22 $$anonymous$$ute tv show episode on torrent. What are you strea$$anonymous$$g that you need 1gig? That means someone to play your game has to download a gig now.
B. Stream as you go, Yea your going to have to supply a server with the available bandwidth for this, Upload bandwidth does not come with standard connections, well not as much anyways. Uploading is considered less important and needed that downloading cause most people spend all there time downloading large files and uploading small update packets. You have money to burn on a solid internet connection server that can upload as fast as others can download? If not having someone in game connect to a remote server and have the video streamed to them isn't an option.
Answer by sparkzbarca · Oct 29, 2012 at 10:08 AM
though i dont recommend the 1gig video file, if you put it in it's own level you can load it in the background through.
http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevelAsync.html
That will load the video silently while the game is off doing something else, hopefully.
The feature requires Unity Pro.
If you think you can't load it all at once and want as you said a kind of streaming
load part 1 during part 1 async load part 2
I'm not sure about that though because if there different scenes it might not look good transitioning. Might not exit the first part and load the second fast enough to be seamless. Maybe if you did it during natural fade outs and cuts during the video it wouldnt be noticed. I'd be concerned about this no matter what using the cut video into parts thing.
The best thing is actual streaming where the video is in full, it just begins play before its complete, however that requires figuring out when it is safe to play based on how much is loaded and how fast the video is playing. Your not going to want to write your own code to try to estimate bandwidth and file size and when its safe to play.
Just to be clear the above assumes your trying to "stream" from a web server. A video in the assets folder wont take long to play just cause its a gig.
Games have loading times because it has to generate alot of objects and resolve thousands of equations about where they are in the world and how light hits them and how they interact with eachother. Video files do not need loaded if on the computer, there isn't alot involved in lighting pixels up when your told which ones to light and which color to make them. The heavy computation is being given basic information and the comp calculating itself what pixels to light and what color to make them and the initial rush caused by every object needing to be resolved at the beginning.