A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Calling all New Unity users! Join the Halloween Mods Showcase Challenge until October 31.
Discussion in 'Works In Progress' started by ShuuGames, Feb 19, 2014.
This plugin looks like what I need. What is the status on h264?
[QUOTE=" All development and target platforms are supported, but it's meant primarily for standalone and web builds.[/QUOTE]
Does it work for WebGL? I'm desperately looking for a WebGL capable video player.
@german2209 Yes, it works for WebGL.
Is there any way to adjust the playback speed?
The frames/audiotime should be accessible, you can write your own play function in a script. At least that is what I did.
You could approach it like this.
frame += speed*Time.deltaTime; //Time.deltaTime will increase the value with 1 every second and speed will amplify or decrease that time.
Of-course "frame" needs to call to the video player.
edit: do not forget to turn of the play toggle on the player.
@ShuuGames I was wondering if you had any updates for the support for the new codecs?
@ShuuGames Could you please private message me - we need support and are willing to pay for it! Thanks! firstname.lastname@example.org
Hi everybody. Is it working on Windows Store? What type of video I must use to make it work.
Hi! We released our game with a couple of videos using this plugin. We haven't noticed any problem with 1080p videos, but one of our customers did:
We added this code:
screenRender.material.mainTexture = this.framebuffer;
on the OnGUI function to put the images on a Renderer since we needed to put some NGUI text (renderers) over the video based on the language of the user.
Any idea of what could be causing this?
Based on his description, it's like if the mainTexture stopped updating with the framebuffer, but I don't know what could be the reason for that, and only in some resolution.
Hi, I'm currently evaluation different technologies and approaches.
What I have:
A large video file containing different 2D animations/clips.
What I need:
Jump/seek to certain points in the movie.
Loop single animations (certain part of the movie, e.g. loop sec 2 - 5).
Can I do this with the movie player? I've already seen that it supports transparency but for the rest I'm not sure, especially about the loop feature.
All of this is covered, but with transparency the options are:
* use mpng video codec. Lossless and therefore files will be large, high cpu load, easy setup.
* use uncompressed video. Lossless, huge files, low cpu load, easy setup.
* use a separate track for transparency. Lossy, moderate sized file, moderate cpu load, setup needs scripting on your part.
Since seeking is instant, looping can be done by checking time or frame number in one of your Update methods and then jumping back in time. It works smoothly.
I guess you've figured it out by now, but for others. The file has to be in avi format, use mjpeg codec and pcm audio. Some other codecs work too, details are in this pdf
Due to personal reasons I haven't been able to release any updates for this plugin for a while and support has been over email only. New winds are starting to blow from different direction and development is getting out from stalled state. It's embarrassingly late, but here's the current status:
- mkv and webm container formats. Done
- Vorbis audio. Done. Wanted to do Opus, but porting Vorbis was much simpler so it took priority
- Theora video. Done. Wanted to do vp9, but again, porting Theora was much-much simpler
- Opus and VP9 have to wait a bit
- MP4, h264 and AAC have licensing issues and require platform support. Most notably in WebGL builds it won't work.
- Transparent video support gets extra attention. In progress
- Simple playback speed changing (backwards too). Done
- RTP streaming. Has to wait a bit
- Simple subtitles. Will do a bit later
- Lots more, screenshots and youtube videos to come
Still enjoying your video player! In my opinion still the best one out there. There have been others claiming to render 1080-4k for 360 stereoscoping video playback. But they are all bogus as they have hundreds of driver issues and basically work nowhere.
So I am still using your player setup for stereoscoping rendering (each camera rendering a cube-mapped cube with your player).
As the load is heavy I have to device resolution by factors of 2, instead of 1080p, footage will be 720p, and etcetera.
I have a question. How is higher resolution support (encoding, decoding) coming? This would greatly improve the resolution I can push to clients.
I have read your previous post and noticed h264 is coming, great! Will there be a noticeable delay in the playback? Or any other things we might need to have in mind when using encoded formats.
ps. Keep up the good work, love your asset.
It's so nice to hear what you're saying
The main feat of theora over mjpeg is that same quality files can be a lot smaller (because theora has P-frames aka delta-frames). Decoding speed for my theora c# port is about 4x realtime for 720p 30fps video on average i5 cpu. So I'm estimating that a good i7 should be capable of 1080p@60fps without any hickups on desktop. It doesn't sound great compared to what native code and hw accelerated drivers can do, but it's about the best what can be done in managed portable code only. But here's a big thing compared to mjpeg, theora decoding can be pushed to separate thread. Mjpeg decoding used Unity API calls so that was not possible. So for theora 4 streams of 1080p@60fps all perfectly synced should be achievable, but right now there's no threading code written for this yet, it's not first priority. Once it comes, I want to make extra sure all timings are exact and seeking works just like it does now.
Ah, that h264. TBH, it's a pain in many ways. When it comes it will most certainly be using platform specific code with all the issues it introduces. I can talk about these all day. Where it works it'll be great, but where it doesn't there's not much I can do about it.
Great, i thought so!
Multi threaded does indeed sound nice, but I can imagine it not being a priority.
My machine has a powerful i7. I will try out your theora recommendation! Will have a look at it soon.
Keep up the amazing work
Thx for the info. This sounds pretty good.
Wow...transparency support is a bit of a game changer!
@ShuuGames Despite calling the MoviePlayer unload function, we're noticing that the bytes for the video are not being cleaned up and garbage collected, which is causing our program to continually increase in size. Do you if there might be a bug somewhere that prevents the bytes from being released? And if you have any suggestions to determine how to fix this. It seems like this is a critical issue for us.
The thread that is downloading the file isn't super efficient. I played with the code and with a little work it can be much more efficient. The two places that are performance bottle necks are ReadByte and the list add for each byte. If the code reads a larger input buffers and and use that to search for frame begin and end tags in that buffer it is much more efficient (10 fold at least for me).
In the latter case I allocate a buffer of max size then download. If a start tags and an end tags are found then good those are frames. At the end of the buffer if only the start tag is found without a complete frame then the contents of the buffer get shifted left so that the last found start tag is moved to index 0 and then more bytes are downloaded into the buffer offset after the existing data. If the end tag is never found within whatever the max frame size of bytes is then the existing data is tossed as a bad frame just like your code.
In this case the video is 250 megs and I can keep my nick pegged at %5 of a gb network card with the modifications. Prior to that I was seeing network traffick at well under %.5.
Also I don't completely understand controlling the frame rate since the MovieStreamer seems to deal only with the frame data and tosses any meta data for the entire file. I don't think the timing is encoded in the frame itself but I could be wrong.
Hello, and thank you for the excellent video player... I'm using it to play a cutscene video from a list of video files, sending the correct filename as a string to the Player infile. This works fine inside Unity, but in a Build no video plays (blank screen) and I get the following error in the output.log:
NullReferenceException: Object reference not set to an instance of an object
at MoviePlayer.ShouldRethrow (System.Exception e, MP.LoadOptions loadOptions) [0x00000] in <filename unknown>:0 at MoviePlayer.Load (System.String path, MP.LoadOptions loadOptions) [0x00000] in <filename unknown>:0 at MoviePlayer.Load (System.String path) [0x00000] in <filename unknown>:0 at MoviePlayerController.SetCutscenesToPlay (System.String which_cutscenes) [0x00000] in <filename unknown>:0 at AreaCollider_01.OnTriggerEnter (UnityEngine.Collider other) [0x00000] in <filename unknown>:0
The play logic is: when the Player enters an enemy area collider (eg AreaCollider_01 in the last line), the correct enemy cutscene is set using a switch statement. This is sent to the Movie Player Controller script (as "SetCutscenesToPlay"), and when the encounter with the enemy is over, a MoviePlayer canvas is enabled and the correct video begins. I don't understand the first line of the error message, since this all works with no errors from within Unity.
(Unity 5.0.0, MoviePlayer v0.1)
Any help greatly appreciated. Thank you.
This usually means the video is not in the correct video format. Make sure the video is in the MJPEG or MPNG avi format.
All the videos are in mjpeg format, encoded using ffmpeg. I tried encoding one using the png option but I get a Build error "unsupported data".
I've tried re-encoding, and using a different encoder but the video still does not play after the Build.
Any help appreciated. Thank you.
I changed the original file to a mov, and encoded that to mjpeg avi using avidemux, but get the same message in the output log. I ran the Build on a different PC but the problem is the same.
Any help appreciated. Thank you.
Hi, when import Playmaker actions.unitypackage i`m getting a lot of errors in console... like on attached file... help?
I`m using Unity 5.4.1.
Hello can i make a menu with this? like: for example: 5 buttons one with the quit, and 3 or 4 with some videos? and when i click it will just play the video that i set to play?
Ditto : I have to allow the user to swap between videos, and even with prior unload, the buildup appears demonstrable.
Can you play Mjpeg in HD ?
Wondering if you can help me out.
I want to modify the MoviePlayer so I can interpolate between adjacent frames.
Ie frame = 11.5
will draw frame 11 onto the given material / renderer then draw frame 12 at an alpha of 0.5 over the top.
But I'm not sure where to start. I am presuming I should be looking in the MoviePlayerBase::Bind () method??
If you're still trying to do this then you should probably have a shader that accepts two textures and blends between them. Then places in code where texture binding and frame update happen should be modified.
Is this Asset still working?
I am looking for a solution to stream MJPEG into Unity from an IP Cam. Does this asset work for this purpose? Is this plugin supported any longer? Does it function?
Great Asset, Great Performance, but import over 2GB .bytes file and simple click at menu, Unity is crash with overflow error. What can I do for fix this problem?