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.
Discussion in 'Assets and Asset Store' started by AndrewRH, Feb 12, 2016.
Hey Tom, your app looks great - congrats!
Will be updating the plugin in a few hours.
AVPro Video version 1.4.8 has just been released!
You can find the updated version on the Asset Store and the free trial version / demos on our website.
Less garbage generation
Optimised ApplyToMesh component
Optimised rendering coroutine of MediaPlayer component
Added global option to disable debug GUI
Improved file path display and editing
Added watermark description to trial version
Cubemap script (for 3:2 cubemap VR)
Fixed vertical flip issue
Added fog and transparency options to VR sphere shader
Android OES optimisation (see below)
Shaders support GLSL better
New faster rendering path, less memory, faster, no overheating - see OES playback path notes in the docs
Added ability to load file from within another file by specifying an offset
Which lets you hide video files from prying eyes
Fixed occasional memory leak when destroying player
Fixed editor warning about absolute path
iOS / tvOS
Fixed occasional memory leak when destroying player
HLS streams now dynamically adjust texture size
Resulting in support for higher quality streams
Fixes issue where videos would become letterboxed
Fixed broken build issue when using the “use pre-built” build option
I received your video - thanks. So I see your video is encoded very strangely. It is actually resized inside the video - I think caused by the display and source aspect ratio's being different. You should be able to re-encode the video to remove this problem.
I will continue to look into this though to see whether we can add support for these types of videos.
Are you using the "Force DirectShow" option to play this? or perhaps you're using Windows 7 or before?
Believe me I said the same thing... Unfortunately I cannot send you the copy of the file as it is a company file. This is on windows. It is an MOV file, running it through ffmpeg helped me get this info, Otherwise opening the file in VLC will start it in black with a high pitch noise going on (Same behavior as plugin), but opening it in Quicktime will play just fine..... Damn you ProRes
Is this on OS X?
No this is on windows, using the LAV Filters to display video. I can send you the Info file for this MOV, atleast what is printed out by ffprobe and ffmpeg so atleast you have some information.
I have a problem :
- When I disactive then active GameObject - AVPro Video Media Player greater than two time then I click Play : Time Video is running but not update frame in camera view.
- If I disactive then active again it play normal.
What is wrong?
thanks for your swift reply. We had to resize the video manually because of the maximum resolution supported (as per documentation) as it didn't work prior to that. We have the ForceDirectShow unticked and we're running on Windows 10 and 8.1. Will Windows 7 be problematic? This game is going to a third party and I would like to inform him about the OS compatibility if it isn't. Thanks!
If your video is maximum 1920x1080 H.264 then it should play on Windows 7 and above without any issue.
Hmm interesting. We'll investigate this Are you deactivating it in the editor via the UI, or via code?
I've just tried this in the Editor and it works fine for me...
Also, which OS is this on? And version of Unity +AVPro Video?
Hmm...supporting videos with negative time offset is rather unusual.. I would really recommend transcoding the video to remove this time offset. I think you can even do this losslessly in ffmpeg by just shifting the timecode somehow. I'll put i ton the list but not sure when we'll get around to fixing this, or even if it will be possible.
I deactivating via Editor and Code, problem is same on PC, iOS, Android.
I use Unity 5.4 and AVPro (download at 11th May 2016, sorry i forget it's version).
Okay that's great! We already fixed that bug a few months ago If you upgrade the plugin it should be fixed. When you upgrade please make sure to do it with a freshly opened unity that hasn't been run, as this can lock the plugin files are prevent the upgrade from updating those files.
Hi Renderheads Team,
I'm happily using your plugin, but facing right now a problem I can only fix by tweaking your code. And I'm not so happy with this solution
The problem can occurs in these cases :
streaming on macOs from an https source without editing info.plist
streaming a malformed video (should not happend, but upload problems are common)
streaming behind a firewall / proxy that, for some reason (no credentials ?), can return something else than a video.
In these cases, the video can't be read, of course, and we get a bunch of logs like these ones :
Player 351: failed to get value for key 'metadata'
Player 351: failed to get value for key 'playable'
Player 351: failed to get value for key 'availableMediaCharacteristicsWithMediaSelectionOptions'
Player 351: failed to get value for key 'duration'
The real problem is that I simply can't (or at least didn't find how to) detect this kind of errors, and I end up with an infinite loop, waiting for the loading of my video forever.
I could expect :
a MediaPlayerEvent.EventType.Error to be fired
a MediaPlayerEvent.EventType.Closed to be fired
IMediaControl.IsFinished to be true
MediaPlayer.OpenVideoFromFile to return false (ok, maybe not this one, since it's an asynchronous error)
Right now, the only solution I can figure is to add some 'timeout', waiting for an EventType.ReadyToPlay event.
Did I miss something, or, if not, is it a 'feature' you could add ?
Thanks a lot,
Thanks for reporting your issues. I will get back to you with a response. In the meantime it would be very helpful if you could email firstname.lastname@example.org with some URL examples for us to test with.
Also - what are your versions of: AVPro Video, Unity, OS X?
Your plugin is running on one machine with Windows 10 64 Bit, Unity 5.4.0f3 64 bit, but not on another. None of your examples run on one but do the other. Basically the movie file isn't opening - Native.OpenSource is always returning NULL.
Force direct show doesn't help either.
public override bool OpenVideoFromFile(string path, long offset)
_instance = Native.OpenSource(_instance, path, _forceDirectShowApi, _audioDeviceOutputName);
if (_instance == System.IntPtr.Zero)
_instance is always 0 with nothing helpful being output.
How can I ensure that I have all the prerequisites installed? I have the Windows Media Feature Pack isntalled and DirectShow is part of the Windows SDK, which is installed.
This isn't a problematic machine. Everything else has been working up to now.
I'd be most grateful for any help.
OK - so it looks like I didn't have codecs installed (it's a pretty new machine). I tried running your Windows Media plugin and that didn't work either. I installed the LAV filters and now everything is working.
I was under the impression that codecs would have been installed as part of Windows Media Feature pack. Hmmm?
Note that your older software was a bit more helpful in terms of error messages!!
That's very strange.
AVPro Video shouldn't require any additional codecs to be installed on a Windows 10 machine for standard video formats (mp4, avi, h.264, h.265 etc). On Windows 8-10 we use the Media Foundation API which ships with a bunch of standard codecs built in to Windows. There is a "K" and "KN" edition of Windows 10 that ships without the media codecs though and would require the Windows Media Feature pack to be installed. Is your machine one of these editions?
The "Force DirectShow" option allows you to use legacy DirectShow codecs installed on the machine. The DirectShow codecs that ship with Windows are rather dated which is why something like LAV Filters allows for modern codecs and higher resolution videos to be played.
It sounds like DirectShow is working for you now, but it is very odd that the Media Foundation (non DirectShow) path still isn't... This isn't something we have heard of before.
I have a question about being able to select alternate audio tracks. I've seen that in your release notes you've added support for multiple audio tracks. I'm currently using the Windows version with Directshow forced on. How do I change the Audio track? I see that the scripting online reference has SetAudioTrack but I've tried that and it didn't seem to do anything. Also I don't know how to get the number of tracks you can choose from.
Maybe this has been answered before in which case if you could point me in the direction of that that would be really helpful.
We have fixed the issue now. In these cases it will now throw an error event and will no longer log those messages. This fix will be included in the next update (the first update after 1.4.8). Thanks for reporting this issue!
to get the number of audio tracks:
We haven't implemented this for DirectShow yet, only for MediaFoundation. Actually in the last release we commented out the Windows implementation completely because it seems to crash sometimes. This is something we're looking into.
It works very well on iOS, OS X and Android though.
Thanks for letting me know. Unfortunately it's the directshow element of your plugin that I use. Is it likely that you'll be reimplementing this into the next version?
So fast !
I just sent you the requested informations. Anyway, thanks for your prompt support.
I'm using Windows 10 Pro, I download LAV filters and still not works.
Hi, I'm using this plugin and it works great for the most part, but I have a very strange issue that I can't really debug (skipping reasons) and was wondering if someone can give me an idea:
Can you think for any reason why a video would play just fine if loaded from a local path, but break (I assume, can't see the log) when playing from a URL? (this is from a Samsung Gear VR device)
Yes it's planned to be in the next version Support might be spotty though so it really depends on how well the base filters support multiple tracks. Filters like LAV should be okay though. I'll know more soon once I start implementing this.
Hmm this is strange. H.265 should be supported natively by Windows 10 without using "Force DirectShow" or LAV Filters. Is your edition of Windows 10 perhaps an "N" or "KN" edition which doesn't ship with media codecs?
Do the sample videos that ship with the plugin play?
Perhaps your video is simply too high resolution?
I'm out of ideas here - H.265 should generally play fine. Perhaps email email@example.com with a copy of the video file so we can take a look?
Did you enable the Android app permissions in Unity Player Settings to allow it to access the internet?
Also, when you uploaded your media file to the server, did you make sure it was encoded with something like "fast start" so that the metadata is at the beginning of the file?
I am making a android app for gear vr
I am trying to Stream youtube Video from my channel through AV pro for a app but i am getting an error
[AVProVideo] Error: LoadFailed
RenderHeads.Media.AVProVideo.MediaPlayer:UpdateErrors() (at Assets/AVProVideo/Scripts/Components/MediaPlayer.cs:849)
RenderHeads.Media.AVProVideo.MediaPlayer:Update() (at Assets/AVProVideo/Scripts/Components/MediaPlayer.cs:418)
When i am using video link
its working fine.
Please see page 44 of the PDF documentation where we discuss YouTube playback. I will paste the excerpt:
Does AVPro Video support playing YouTube videos or live streams?
Yes and no. If you enter a YouTube URL into AVPro Video it will not be able to play it because this is the URL to the website and not the video. It is possible to gain access to the underlying MP4 file or HLS stream URL which will work with AVPro Video. This may be against the terms and conditions of YouTube though.
So basically it will work if you get the URL of the actual video file, but if you just point it to the web page URL of the video then it won't work.
I've noticed that in my projects I have poor performance compared to others using AVPro. Any help that could be provided in sorting this out would be very much appreciated.
If I create a new project with only AVPro I get low framerates when playing high-res high-fps videos. Whirligig and Simple VR Player both use the AVPro Media Foundation back-end and have smooth playback on the same videos. What could cause this?
For the record I also have smooth playback if I use the -force-d3d11-no-singlethreaded switch but I do not believe this could explain the difference as neither Whirligig or Simple VR Player appear to be using this switch.
AVPro Video 1.4.8 (Media Foundation back-end)
Windows 10 64 bit
I believe we have the Whirligig creator in this thread so you may even get a response from him
Basically AVPro Video has 3 playback paths on Windows:
1) Media Foundation - software decoder (default)
2) Media Foundation - hardware decoder (fastest)
3) Legacy DirectShow (can be much faster than 1, but often requires install 3rd party codecs)
As you say the hardware decoder plays back smoothly, but it requires that command-line flag to be used. We have a version now that doesn't require that flag so hardware decoding can be enabled directly in Unity. We hope to include this in the next release.
The Legacy DirectShow path can actually be faster than our current implementation of Media Foundation - software decoder. This is because with DirectShow we try to use YUV 4:2:0 format but with Media Foundation the full RGBA32 format is mostly used. This means DirectShow can have much better performance as it isn't doing the YUV-RGB conversion on the CPU and it is also moving much less data across the bus to the GPU. So you may want to try this option. You can enable it by selecting "Force DirectShow "on the MediaPlayer in the "Platform Specific - Windows" panel.
The main limitation of this Legacy DirectShow path is that it doesn't have native support for some codecs and require 3rd party codec installation. This is especially true for H.264 which the Media Foundation path supports up to 4K resolution, but DirectShow only supports up to 1080p. So if you want to use the legacy path with 4K content you would have to install something like LAV Filters.
I hope that answers your question.
I have tried all available playback paths.
I'm fairly confident that the same playback path is active in my project and in Whirligig/Simple VR Player (Media Foundation software decoder) but with very different results. I would love to know why.
Hmm, I'm not sure then. Perhaps you could give us some examples of the difference - a film of the difference perhaps? Feel free to email firstname.lastname@example.org. Is there a reason you can't use the GPU decoding path? (if it's because of the command-line switch, that requirement will disappear in the next release) I know that in our old plugin AVPro Windows Media we had one option called "Display Sync" that could make video playback a lot smoother. This feature isn't yet included in the new AVPro Video plugin because we're rebuilding the sync feature from the ground up, but we hope to have it in there soon. I hope that helps. Happy to discuss this further over email if you want
I purchased your plugin in last sale.
now i have a question, does it support Gif? if not can you please add support for that?
I am using the AVPro Video plugin for a 3D 360 VR video. We have two spheres which are mapped to the left eye and right eye, and each have their own camera for rendering. However, I notice on device that when I turn on the debug eye tint, as I look around the sphere I often times see a single green or red color (both eyes seeing the same sphere), and at times even see the left and right eye tints swap (looking at one area of the sphere I seen red left and green right, but another area red right and green left). This not only removes the 3D effect, but also causes a pop in the video which creates a very unnatural feeling when in the VR headset.
I am curious as to why it would ever render the sphere to both eyes, as there are a left and right sphere, each with culling for their own cameras? Is this a shader issue (using the Android OES shader) or am I simply setting something up wrong here?
Any help would be appreciated!
The sphere shaders that we include are designed to work on a single sphere, so there shouldn't be any need to replicate the spheres per eye. As long as both of your cameras render the sphere, it the shader will take care of assigning the right part of the stereo frame as each eye is rendered. If you don't use the 2 cameras for anything else, then even one camera can be used.
I hope that helps.
Yeah I ran back through the documentation and saw the sphere/shader setup and how it works. Our spheres have specific UV mappings, which I believe are part of the problem here, as the plugin supports some of the features we had to handle ourselves before switching.
Thanks for the quick reply and will update further if needed.
We'll be releasing AVPro Video v1.5.0 later this week. Lots of nice new things coming
I'll post a preview soon.
I'm using AVPro Video using UGUI, what should i do to make it full screen?
GIF support isn't on the horizon. I've added it to the list so we'll investigate it and see whether we can add it.
There are several ways to make the video full-screen:
1) Use the background shader - see the Background demo scene where we show how to use this. This will always render the video in the background though.
2) Use IMGUI component - this will always render the video over the top of everything else though.
3) Use uGUI component - you should be able to set the component via the normal Unity uGUI canvas and anchor settings anchors etc to get it to be fullscreen. You would first need to set your canvas to be in Camera mode, and then set the scaler to Scale with Screen Size. If your uGUI component matches the reference resolution then it should be fullscreen:
Hope that helps!
Appreciate for your prompt response.
And cant wait for 1.5 Release
Getting a memory leak on Android OpenGL2.0.
We have 2 MediaPlayers playing simultaneously for finer stereoscopic control with 2 cameras.
Each player is set to loop a 2 second video.
If I leave it running on Android it crashes after about 50 loops consistently.
All its doing is looping the videos, not doing anything else.
Thanks for reporting this. We haven't heard of such a situation before
Please could you tell me:
1) which version of Unity+AVPro Video you're using
2) what is your Android OS version and device model
3) Any reason for using GLES2 rather than 3? Does it still do this if you switch to 3?
4) Are you using the OES playback mode in Android?
5) Are your videos h264 or h265 or something else? Perhaps you could email us a copy of your media+scene for testing? (email@example.com)
Using AVPro Video 1.4.8 + Unity 5.4.1f1. (Win 10 / Android)
When loading a new video, in win 10, the videoduration gets updated as expected. When published to Android, only the first video loaded gets the correct duration. All other video's I load (in the same videoplayer object) have the duration of the first loaded video.
I tried using CloseVideo() before loading a new video, this works fine in win10, but seems to be broken in Android, as I can not load another video after using CloseVideo().
I just tested it here using the "02_Demo_imGui.unity" demo scene, and it worked fine.
I suspect that you aren't retrieving the duration at the right point when it is loading. Could you tell me at what point it is reading the duration? Is it doing it every frame, or is it waiting for one of the events and then reading the duration? Is the file just a local file, or a remote MP4 on a server, or something more complex such as an HLS stream?
1) Unity 5.4.0p2 and AVPro 1.4.8
2) OS 6.0.1 Samsung Galaxy S7
3) Its just for compatibility with older generation hardware. Yes it still occurs in OpenGL3.0
4) I'm not sure what OES Playback is, we are just using a default player, no tweaked settings.
5) I can't send a copy of the project sadly, but here is the video specs for each player:
Thanks, we'll take a look and let you know.
We've run some tests here with over 300 loops so far on a 1 second 2560x1440 h264 video with AAC audio, and so far no problem. We're running on a Galaxy S6 though. I wonder if it is specific to your video? Can you loop the included sample videos or do you have the same problem with those? I can't replicate the issue here, please consider sharing a video that is causes this issue. Thanks,
We have a project setup that is iOS and Android, using AVPro 1.4.4 and Unity 5.4.1. We're using UGUI to display a video, and it's working great, except for one thing - there is no audio in the video when viewing it on multiple Android devices. iOS plays the audio without any problems. I've tried a couple different videos as well, same issue.
Perhaps I've missed something obvious?