Videostream Mac/PC

Hi, I’m working on some rooms, that need to have videoinstallations and to reduce the size of the webplayer I decided to get the videos streamed. Now it works fine on Mac but on PC it closes the browser immediately and prompts an error. (webplayer_win.dll caused an Access Violation (0xc0000005) in module webplayer_win.dll at 001b:0346faa2)
The log-file says there was an unhandled NULL exception, which should occur on Mac too, or not ? But it doesn’t.
So I tested the original sample right out of the scripting reference
Unity - Scripting API: WWW.movie which worked in IE (not in Firefox) but only after a few times trying.

thanks for your help

Ok, the videos play on PC if they are fully loaded, but thats not my understanding of streaming. So the “.isReadyToPlay” doesn’t seem to work on a PC. Why is that ? Or what can I do to about it, to get a real stream working on both systems ?

I’d be grateful for any suggestions

Can you perhaps show your exact code? In general you should definitely be able to get true streaming behavior on both Mac Win.

Hi,

I have exactly the same problem: The windows webplayer crashs on video streaming (unhandled NULL exception).

The Query i.e.: if (movieTex != null) movieTex.Play;
avoids the crashes but however the streaming doesn’t work.

sometimes after a browser reload the stream starts, but at first loading I can’t get videostreaming reliable to work…

I woudlt be very thankful for any advice!
best regards

Can’t anybody help?? What’s going on with unitys video support? Nothing works any more. Some months ago I had no problems with video streaming, but now (after updating to 2.1?) there are a lot of problems. So for me it is impossible to get an imported ogg-video synchronized with the audiofile (tried several ones). Ok, doesn’t matter as long as I can use the streaming support. But that doesn’t work, too! Neither on Mac nor on Windows! In editor the video runs fine more often than not, but sometimes it stops suddenly. And all browsers (IE, Safarie) crash either on starting the video or some seconds later. To make sure that this is not a scripting problem I tested with the original sample of the scripting reference, too (just like pinki does). No success.

thanks for helping me…

Can’t anybody paste some code so we can help??

No seriously. Paste some code and explain the error fully or nobody will have a clue how to help you.

After a few hours of work I do have an operating version now. It contains a player model wich has the following script attached:

function Start ()
{
    var www = new WWW(url);
    var movieTexture = [url]www.movie;[/url]
    
    while (!movieTexture.isReadyToPlay)
        yield;

    renderer.material.mainTexture = movieTexture;
    audio.clip = movieTexture.audioClip;
}

And some buttons as childreens that all have the control script attached:

function OnMouseDown () {
	if (!transform.parent.renderer.material.mainTexture.isReadyToPlay) {
		return;
	}
	
	switch (name) {
				case "Play":	transform.parent.audio.Play();
								transform.parent.renderer.material.mainTexture.Play();
								break;
								
				case "Pause": 	transform.parent.renderer.material.mainTexture.Pause();
								transform.parent.audio.Pause();
								break;
								
				case "Stop":	transform.parent.renderer.material.mainTexture.Stop();
								transform.parent.audio.Stop();
								break;
								
				case "Loop":	...
		}	
}

You can see this on: http://91.194.7.240/videotest/player_simple.html

But when I want to use exactly the same player with exactly the same code (I made a prefab of it) in my project, I get this strange behavior. Depending on the place of the player in my scene or maybe just arbitrarily one of the following things happends:

  • mouse click on play button was detected but video doesn’t play
  • video starts playing and suddenly stopps
  • video starts playing and browser crashes

You can see this on:
http://91.194.7.240/videotest/videotest_player.html
http://91.194.7.240/videotest/videotest_player_one.html

I tested with Safari, Firefox and IE and got this bugs on all browsers.

I also don’t know what is happening.
Tried to load uncompressed quicktime movies and smaller movies import, but as soon as the movie gets a little bigger 1+Gb (and you reach that easily with uncompressed video) then unity just instantly crashes.

I tried a lot of video input formats and almost always get same result. I don’t seem to be able to import any decent video file in unity

Also filed a bug 46981 about it but I saw they closed it without even mailing me about it, so they consider this solved ???

A quick check of the bug shows me it was closed as not reproducible, ping Sam for details as was the one that closed it out. I’ll see about getting some engineering eyes on this thread to offer some input, stay tuned.

I just did Tom

It happens on files larger then 1GB of video.
But I always use files a lot larger then that as source video.

1 minute of HD footage in uncompressed format is really a lot of gigabytes videodata.

And I always want to put the best possible video input into the encoder and then do only 1 encoding from it.

Understood on all points, hopefully you and Sam can chat about it a bit so we can repro the issue and see about fixing it.

There is still no solution to (my) streaming problem. I made a couple of systematic tests with the result that the crash seems to be undependent from code or player screen (with or without buttons, play on mouse click or play on start, on gui texture or plane, different versions of code, different video files, etc). It seems to happen just arbitraliy, but more often when unity has to do a little bit more (i.e. render enviroment, move controller). So the browser can crash with the original scripting reference code (Unity - Scripting API: WWW.movie) in a really simple scene, when I walk around and make fast movements with the controller cam. And so it can crash too without fast movement in a scene where I placed some 3d models. I also wrote a bug report of that (47414, 47473).

I like to know, can anybody confirm that problem? The error message of the browser is exactly the same pinki and joejoyful described. By the way, in editor streaming works fine most of the time!

Not to get streaming working is really a huge problem for me!! I need to get videos played in my scene for a customer order! So I tried to go “back to the roots” and imported a video directly to my project. The result with different file types:

ogg/mov - video not synchronized with audio
mpg - no audio at all
avi/mp4 - works fine but big file size

Ok, after a lot of tests I do have a synchronized, stabil playing video now. But it’s impossible to let this within the webplayer, then I get 15-20 MB! What can I do to reduze file size now? Or even better, is there no way to get the streaming work??

I have the impression that video in unity really isn’t that interesting as of yet.
Sure its a PRO functionality only, but it certainly doesn’t work like PRO at the moment.

I’m quite confident that unity technologies will make video support better in upcoming versions (maybe not the first in line) of unity3d.

I also have a bug hanging open for review, but I got a promise that they would look after it in a future release (possibly not the next in line however). It involves using videofiles which are 1GB or bigger.

When importing a file smaller then 1GBthen unity seems to import those quite well and even compresses them to relatively small video (you can set this yourself)
Just on bigger movies it crashes.

I always use high definition uncompressed video as source material before I compress my video, so it not unusual for me to have 30 minutes videos which are or example 150GB big in uncompressed format.

In ogg theora they are then compressed to a 1mbps stream and that makes it a lot smaller, but it currently doesn’t seem to be possible to compress such big file in unuty. Luckily enough I can compress them on our windows machine using the free ffmpeg2theora tool.

Its time intensive to start from such huge files I know (crunching that amount of data just takes quite some cpu), but to be honest THEORA just isn’t the right video codec if you expect quality video.

It can’t compete with flsh video ON2VP6, let alone H264.

Now I understand very well that H264 has license costs and these are almost certainly too expensive to license, but isn’t there anything else out there ?

Look Unity could in previous versions nicely use MOV files (even with transparency)

Quicktime is available on both PC and MAC and you are even alowed to distribute the free player with your cd-rom title.
Quicktime allready includes all those hightech codecs like H264 so unity doesn’t have to license it anymore.

isn’t there any way to re-enable native quicktime support again in unity3D ?
Tom (Higgins) or Sam, could we please get an answer to this ? it WAS in unity, now its gone. Can’t it come back?

Regards,

Bart

Some days have gone and there is still no answer to this post or to one of the bug reports. This is the first time, I’m really disappointed about Unitys support. All I want to know is, am I wrong? Or is this a known problem and can’t be solved at the moment?? So please tell me!

And I need an alternative idea. How can I “simulate” video streaming, meaning not to use WWW.movie but another possibility to load videos at runtime and keep slim player size? Maybe with Asset Bundles or Ressource Folders?

regards

Unity support mostly is very very good.
Sometimes something can slip between the fingers or not be answered in 1-2-3

Until now I have been helped quite OK and a lot better then on any other company I know.

Maybe you should be a little more patient OR mail support@unity3d.com

I can only repeat that in my opinion the video support in unit3d is very low and videoquality of ogg theora simply is NOT good. (certainly not compared to flash video or h264, but thats a patent/royalty problem)

For standalones you could use the quicktime plugin

Unity support mostly is very very good.
Sometimes something can slip between the fingers or not be answered in 1-2-3

Until now I have been helped quite OK and a lot better then on any other company I know.

Maybe you should be a little more patient OR mail support@unity3d.com

I can only repeat that in my opinion the video support in unit3d is very low and videoquality of ogg theora simply is NOT good. (certainly not compared to flash video or h264, but thats a patent/royalty problem)

For standalones you could use the quicktime plugin

EducaSoft wrote:
Unity support mostly is very very good.

Yeah, I know, that’s what I’ve got all months bevor! I’m still thinking this is one of unitys biggest potencies, but this time it is really important for me to get a quick solution. And I wonder, what has changed, it worked quite well some time ago. There were no browser crashes on video streaming in summer. Now it’s not working any more.

But what are you doing, when you (try to) import such huge video files? Even if they are compressed down, for letting them within the player they are surely to big, aren’t they? I’m only publishing games for web so size is pretty important.

I have to say that in version 2.0 of our project we had no issue with our web runtime (less then 5 meg ogg files). But I have noticed this BUG since the release of Unity 2.0.2.

I have over three bugs reported to unity on this issue and I still have not seen the solution to this Bug.

In short, they need to look over the changes they made to the video texture code. I think if they spent a day or two look over the code in debug for the web player they would realize that some thing is causing the buffering of the video to fail and the exception to not be handled make the browser freak, I state buffering because:

1- IF you run an ogg that is bigger then 2 megs using the code they stated should be used as an example to work… it does work on a Intranet or 11 mps connection or better.

2- If you take the same web program (.unty3d+ html) and put it on a public web server, it Crashes as stated in the above post. It will play about 2-3 second s of the audio and movie and then crash!!! Reason: Must websites do not push our 11mps for multicast.

For now our solution has been going back to using the flash cutscene method used in the pre-unity 2.0.

To the Unity Guy reading this listing, could you please take a look at my bug reports? While you are at it could you simply add QT as a possible web codex?

FOR CDROM AND NON_WEB Games the CODE WORKS FINE!

the same problems available now…!

What’s the flash cutscene workaround exactly? Can we display a .swf widow on top of Unity?
It’s 2011 now and these problem still exist. I need a good video solution for streaming.

:slight_smile: