Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] AVPro Video - complete video playback solution

Discussion in 'Assets and Asset Store' started by AndrewRH, Feb 12, 2016.

  1. joelbeloUnloop

    joelbeloUnloop

    Joined:
    Jun 1, 2017
    Posts:
    3
    Problem description:

    Hi!
    I tested a simple video that only plays audio on some mobile phones, no image.
    This only happens when I use Vuforia camera on the background.
    It works on some phones.
    It says "Opening video" and then nothing else happens, the audio starts and no image.
    On the phones that work it says "Opening video" and then "playback engine etc" and then the video starts with image.

    Please help.

    Device (which devices are you having the issue with - model, OS version number):

    Samsung Galaxy S7

    Media (tell us about your videos - number of videos, resolution, codec, frame-rate, example URLs):

    1 video, 720x480.

    System Information:

    AVPro Video: plugin v1.6.10 scripts v1.6.10
    Target Platform: Android
    Unity: v5.6.1f1 WindowsEditor
    OS: Desktop - 870-008np (HP) - Windows 10 (10.0.0) 64bit - Portuguese
    CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz - 8 threads - 8091KB
    GPU: Emulated GPU running OpenGL ES 3.0 - Emulated - OpenGL ES 3.0 [emulated] - 2150KB - 4096
     
  2. luigis

    luigis

    Joined:
    Oct 30, 2013
    Posts:
    25
    Hi everyone,

    I'm using a demo version of AVPRO for Windows, is it possible to use Scripting with demo version?

    Thanks a lot
     
  3. ibompuis

    ibompuis

    Joined:
    Sep 13, 2012
    Posts:
    100
    Hello,

    I'v some trouble with last AVPro video trial version with unity 5.6.1p3 on OSX sierra 10.12.5
    Everything works fine when I play on editor but if I build you can see problem here:

    https://screencast.com/t/sWcAabRlfBi

    Any idea ?

    EDIT: Only work fine with unity 5.4.3p3 and 5.5.2p3, tested all unity 5.6.x patch

    Thanks
     
    Last edited: Jun 26, 2017
  4. IEOPC1

    IEOPC1

    Joined:
    Jan 31, 2017
    Posts:
    13
    Hello,

    I just purchased the Android version and attempted to upgrade my project from the trial. I deleted all platform plugins that were installed by AVPro and then re-imported the package; however, I am still getting the Renderheads logo on my playback. Was I suppose to delete the entire package and then reinstall or just delete all of the AVPro plugins? Am I suppose to remove the old media player from my game object and add the new one?

    Thanks.
     
  5. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    So I've downloaded the latest Google VR SDK.
    And I have a working desktop app using the full version of AVPro video for video playback capability.

    What is involved in converting this desktop app for use in Google cardboard?
     
  6. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm that's a shame. We tested with 5.6.0 and still didn't have any memory issues. If you're able to send us a reproducible case we would love to debug and fix it.

    Thanks,
     
  7. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Okay, I think we got your email - you said that if you disable Multi-threaded rendering, then it works. This is great news, but we're not sure why this is the case. Disabling multi-threaded rendering on Android causes very high resolution videos to not play back smoothly. Perhaps there is a bug in Vuforia? Anyway, glad you found a workaround.

    Thanks,
     
  8. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes of course, there is full C# scripting support.

    Thanks,
     
  9. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    The problem is probably that the plugin file (DLL / SO etc) is locked by Unity. You should close all Unity instances, then open your project in Unity and without running it or anything, install the upgraded unitypackage file. It should work then. You can also find these upgrade instructions in the PDF documentation if you need a reference.

    Thanks,
     
  10. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi Phil!

    So for the crash bug, you can go to AudioOutputManager.cs, line 44 and change this:

    Code (CSharp):
    1. int channels = mediaPlayer.Control.GetNumAudioChannels();
    to this:

    Code (CSharp):
    1.  
    2.             int channels = mediaPlayer.Control.GetNumAudioChannels();
    3.             if(channels <= 0)
    4.             {
    5.                 return;
    6.             }
    We'll include this fix in the next update. We'll look into the mute tickbox not working - thanks!
    Also, I'm a little confused because I don't think we support AudioOutput component when using DirectShow....

    Thanks,
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    There shouldn't be anything involved. AVPro Video is designed to be cross platform and "just work". Of course you need to make sure the media is encoded in a format that is compatible with your target platform.

    Thanks,
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks, we have tested this but we can't reproduce.

    We think it is an issue related to the Metal graphics API. Please go to your Player Settings in Unity, and under the Other Settings section you can untick the "Automatic Graphics API" option and change it so that OpenglCore is at the top of the list. We think that will fix the issue.

    Please let us know what hardware you're running on so we can replicate the bug?

    Thanks,
     
  13. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
    Sad to report 5.6.2f1 does not seem to fix the Android OES path rendering, if i'm not doing anything wrong that is. Everything just stays black. (not pink though) so if anyone else can confirm it's still broken... that would be great.
    [EDIT: Loads of pink when i enable OpenGLES3]
     
    Last edited: Jun 27, 2017
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Ahh that's a shame to hear. Yes the bug we reported is still marked as "Active":
    https://issuetracker.unity3d.com/is...er-compilation-failure-on-some-mobile-devices

    Hopefully Unity will fix this bug :) Our other option would be to handle the sphere rendering inside the plugin too.. This is inflexible though because it doesn't let people use their own shaders etc..
     
  15. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Hi Andrew. For some reason can't get video playback working. have tried every possible permutation of video pathing. Is there by any chance a Android demo you would recommend for troubleshooting?
     
  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    All of the demo scenes that we include with the plugin should work on all platforms. Did you have any luck with our demo scenes? Thanks,
     
  17. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    120
    Your right Directshow doesn't support the AudioOutput. However Whirligig (my app) allows people to switch from media foundation to directshow which means that I have the audio output setup for Media Foundation. When they switch to Directshow the Audio output is still setup for media foundation but instead of not using it is caused the issue that was previously mentioned.

    Thanks for the fix :) and thanks for looking into the mute function in directshow not working. I need this as I've just added external TBE f360 spatial sound support from an accompanying TBE file (so when the TBE file is used the internal audio track needs muting). You should look into TBE. It works really well, loads the sound instantly (unlike www function in Unity) and syncs really well :)
     
  18. ATMEthan

    ATMEthan

    Joined:
    Dec 27, 2012
    Posts:
    54
    Hey, I tested in 5.5.4 and in 5.6.2. In 5.5.4 the application crashed and in 5.6.2 I couldn't get the application to crash. I'm going to message you a test repo so you guys can take a look at it.
     
    AndrewRH likes this.
  19. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    Hi Andrew, I am having troubles playing 8k resolution videos. Can the AVPro plugin play 8k videos with alpha channel?
     
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    Which platform and using what codec?
    AVPro Video supports playback of any media that is supported by the operating system. Currently I believe that 8K GPU decoding is only supported using H.265 media on Windows with an Nvidia 1060 or above GPU. H.265 doesn't support alpha I believe, so you would have to use alpha packing to include transparency in your video.

    I hope this helps. Let me know if you have any other questions.

    Thanks,
     
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi, so our iOS guru, Morris had a look at your project. Here is what he had to say:

    I hope that helps you. The YCbCr option is available in the newest version and saves a lot of memory, and is actually faster too.

    Thanks,
     
    ATMEthan likes this.
  22. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Hello,
    I should develop with AVPro an App for Andoid to play VR videos about 15/20 mins lenght.
    I've a 13 mins video 3840x2000 @29fps, that run with no issues with the standard Oculus player on my Samsung S6.

    BUT with the App created with Unity and AVPro the frame rate drop down and the screen get totally black after a few minutes (I think because of overheating, indeed the mobile is quite hot).

    - I've converted the video in HEVC, with small GOP, no ACAB, 4 slices, but I was able to watch just a little bit more than with the original version of the video (the original one was H264 - 1.8 Gb, now is H265 - 2 Gb).

    - I'm using Fast OES (with OES sphere shader), but I do not see any noticeable improvement neither in performances neither in hoverheating issue (in none of my previous test with other videos, to be honest).

    - I'm just using a small script to show the framerate on every Update, but I don't think that this could be the issue...

    My configuration:
    - Windows 10
    - Unity 5.5.3f1 Personal
    - AVPro demo (last package)
    - Samsung S6 with Android 7
    I've attached my script, and my settings for MediaPlayer and for Player, maybe I'm doing something wrong?
    Your help would be much appreciated.
    Many thanks
     

    Attached Files:

  23. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
    Hi Daniel,

    Using the Oculus SDK in Unity you can tell your device to underclock the CPU and GPU (throttling), using the OES render path the framerate stays higher then 30 fps (video is only 30 so perfect). We're playing back 3840x1920 @ 30 fps for hours on end on an S6 without issues.

    OVRPlugin.cpuLevel = 0;
    OVRPlugin.gpuLevel = 0;

    Let us know if it works for you :)
     
    hema_dubal likes this.
  24. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Thank-you Tom,
    I have a couple of doubts on it:

    1 - I did several tests with OES, with many different videos, and I never experienced any increase in performances (at least on my S6). Rather I've usually noticed a small decrease in frame rate (!).
    In fact this 13mins video (that is natively @29fps) run around 25fps without OES, and around 23/24fps with OES.

    2 - I tried to run this video several times, and each time it dropped down after a different period (after 3 mins, after 5 mins, after 7 mins, after 2 mins, etc..)

    So, as far as I can understand:
    a) on my mobile the OES doesn't work (at least as it should)
    b) the mobile (with this Unity App and AVPro) seem to overheat in a "random" way.

    So do you think it could be a my mobile issue ("broken" in some way)?

    Many thanks!
     
  25. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    ...In my last test the frame rate was only 20fps :(:( with OES, and after 2 mins the app stopped and I've got the message that "The Samsung Gear VR must get colder to maintain the performances..."

    I've tried with some other video but it's always the same...
    :(:(:(

    I really don't understand...
    Do I have to trash my S6? Maybe it's a Android 7 related issue?

    Thanks a lot
     
  26. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Oh, I forgot to mention that I have this issue only in VR mode with Samsung Gear VR.

    When I'm not in VR mode the video doesn't stop (but the processor reach 39 degree of temperature)
     
    Last edited: Jun 29, 2017
  27. nbaris

    nbaris

    Joined:
    Jan 13, 2015
    Posts:
    27
    I see this warning even though I'm using the "Relative To Streaming Assets Folder" option and not the "Absolute Path" option. Is that a mistake? I'd really rather not enable external write access.

    Thanks
     
  28. ATMEthan

    ATMEthan

    Joined:
    Dec 27, 2012
    Posts:
    54
    Thanks for taking a look into this. To be honest I thought my test project was using the latest version. I must've gotten mixed up when I tried using 1.5.25 to test an older AVPro version. Going forward I'll incorporate the suggestions Morris sent us.
     
  29. Joits

    Joits

    Joined:
    Jul 12, 2016
    Posts:
    29
    Hello. I'd like to look into your plug-in.
    I'm developing for iOS (new to iOS platform), and currently we would like to be able to load user movies from e.g. the film library using an absolute path, is this possible using your plugin? if so how would one be to retrieve the path.

    Thanks in advance.
     
  30. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I think you can usually just ignore that warning.
     
  31. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes you can. Here are 2 extracts from our FAQ:
    1. iOS - Can I playback a video from the Videos library?

      Yes if the video is not content protected and you have it's URL. URL's for items in the video library take the following form:

      ipod-library://item/item.m4v?id=1234567890123456789

      You can get the URL of an item by using the MPMediaQuery class from the MediaPlayer framework.

    2. iOS - Can I playback a video from the Photo Library?

      Yes. You need to use the UIImagePickerController to select the video. This will result in the video being processed into your app's temp folder where you can access it via the URL returned from the controller.

    Basically as you can see though, in order to access files in those locations you need to get the URL to them by writing some code. I hope that helps.

    Thanks,
     
  32. ibompuis

    ibompuis

    Joined:
    Sep 13, 2012
    Posts:
    100
    Thanks, works fine now !
     
  33. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Please let us know what hardware you're running on so we can replicate the bug? And was it set to Metal when it wasn't working? Thanks,
     
  34. ibompuis

    ibompuis

    Joined:
    Sep 13, 2012
    Posts:
    100
    Please find below:

    MacBook Pro (Retina, 15 pouces, mi-2015)
    2,8 GHz Intel Core i7
    16 Go 1600 MHz DDR3
    AMD Radeon R9 M370X 2048 Mo
    Intel Iris Pro 1536 Mo

    With Metal, only HAP video works fine (Q and alpha too), dragon example video not work, same issue as decribed.

    Thanks
     
  35. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks, we'll investigate and let you know if we find anything. In the meantime please use OpenGL as that seems to work for you.
     
  36. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi All,

    AVPro Video version 1.6.12 has just been released!

    You can find the updated version on the Asset Store and the free trial version / demos on our website.

    Changes include:

    Android
    • Fixed a rare crash bug that could happen during seeking
    Windows Desktop / UWP
    • Added new low latency option for Media Foundation which provides a hint to the decoder to do less buffering
    Windows Desktop
    • Added support for 10-bit HDR video decoding (Main10) when using DirectShow any suitable decoder such as LAV Filters. The decoding still resolves to an 8-bit texture but we plan to add 10-bit or floating point texture resolve soon
    • Fixed a crash bug when using DirectShow and LoadFromBuffer to load a video from memory
    General
    • ExtractFrame() method now faster and more accurate
    • Time Scale support (where a non-realtime video capture solution changes Time.timeScale or time.captureFrameRate) has been improved, making it faster and more accurate
    • Added new 180 degree sample video
    • Fixed a bug in AudioOutputManager when channel count <= 0
    Thanks,
     
  37. HugeElephant

    HugeElephant

    Joined:
    Jul 5, 2017
    Posts:
    2
    Love this plugin!

    Quick question: I'm hoping to create a "wipe" style alpha transition where I'm playing a video and it wipes away revealing the scene behind it.

    It would use two videos: one for content and one for alpha. NOTE: This wipe can't be baked into the video, because the transition can happen on command by the user. It's not happening in-sync with content.

    Is this effect achievable through this plugin? Which shader would I use to allow for this wipe?
     
  38. iBoo-Mobile

    iBoo-Mobile

    Joined:
    Nov 2, 2016
    Posts:
    2
    Hi all!

    I have an app that loads diferently youtube videos each week using AVPro, another plugin to get the correct Youtube URL and a CMS to refresh de videos. No problems so far at this point.

    The only thing I need is a preview image of a frame of that video. The video is played on stream at the moment you click it. There is any way to get that image?

    Thank you in advance and cheers!
     
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi!
    I understand what you want to do. Yes this effect is achievable, but our plugin would only handle the video playback part. We don't include a shader for every conceivable use case, so you would have to write the transition shader for this yourself.
    You would have to first think how the transition is going to be draw (IMGUI, uGUI, MeshRenderer etc), and then make a shader for that specific renderer. You could take one of our included shaders any modify it to suit your goals.

    I hope that helps.
    Thanks,
     
  40. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    I don't know about the YouTube API, but I would assume there is some way to query it for the video thumbnail / poster image... This is something you would have to check with the YouTube code. Otherwise one slightly hacky way to achieve this would be to play the stream for a second in the background, grab a frame from it and copy it to a RenderTexture, then display this texture at the start of the video. You could even cache these locally so they only have to be pulled once...

    Thanks,
     
    jimprucey likes this.
  41. G8S

    G8S

    Joined:
    Feb 7, 2017
    Posts:
    18
    Hello!

    I am using AVPro to create a Gear VR 360 Video theatre app for a client but when I deploy to android (Galaxy S6 is what I am developing on) the 4k video which I am trying to play lags horribly. It looks like it plays at 2 frames per second or so... Is this something to do with the video or...? The video I am testing it with was captured at 4k/60FPS and bitrate of 4598kbps.

    I have tried both packaging it in the streaming assets folder, and also loading it from the internal storage with no success. In fact, the audio plays but not the video when I load it from a data folder.

    Any help would be greatly appreciated!
     
    Last edited: Jul 8, 2017
  42. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    In our experience the S6 isn't capably of playing back 4K at 60fps. Instead try 2K at 60fps, or 4K at 30fps.
    Also H.265 works well on the S6.
    Thanks,
     
  43. scottunity

    scottunity

    Joined:
    Feb 1, 2014
    Posts:
    72
    Any plans to implement FinishedSeeking event?

    Looking for a way to synchronize switching between 2 synced clips during playback.
    Currently using multiple MediaPlayers (Windows UWP)

    You have the snippet of using the fast seek which may be ok if you have frequent I frames and only care about approx match.
    Since I'm also switch shaders and swapping MediaPlayer associated with a mesh there's the issue of synchronizing that. (Frame of undesired visuals) I'm finding out with AVPro and Windows UWP 'first frame' event is erratic and may be missing. Your snippet uses LateUpdate.

    Are there other means or suggestions fore getting more accurate:
    1. Switch between clips with same time base (i.e. appear like live switching)
    (Currently doing a GetCurrentTimeMs and Seek to match but IsSeeking seems to be a little flaky and where to make the switch isn't clear.
    2. synchronize other parameters to match the first frame displayed. (i.e. after last frame but before this one)
     
  44. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    Does AVProVideo support Single Pass Stereo in Unity 2017.1f3 in VR (OpenVR Vive)? I have a video playing on a surface with a modified standard shader (for gamma) that only displays in the left eye unless I change settings to Multi Pass Stereo rendering. Any feedback would be greatly appreciated.
     
  45. BRB_Innoactive

    BRB_Innoactive

    Joined:
    Jul 18, 2017
    Posts:
    1
    Hi,

    I'm new to AVProVideo and tried to have a look at the demos but the video fails to load every time.
    I just get an error message similar to this: "[AVProVideo] Failed to open C:\Test123\BigBuckBunny_360p30.mp4"

    Tried every demo video included and also used different paths (like you can see from my test folder), still the same error.
    Also tried using different path types (e.g. absolute, relative ...), didn't work either.
    Not sure whats wrong here, please help.

    I'm using Windows 10 and Unity 5.6.1.
     
  46. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    Yes, this is quite a tricky thing to do. There is internal buffering inside the video decoders to account for, so getting a perfect switch between two videos is quite difficult. Having more I frames certainly makes it a bit easier. I think you would have to play around with playing the second video and manually buffering the frames (via Graphics.Blit to an array of RenderTextures) and experimenting with different frame delays at which to start this. Or try to add a cross-fade between the two videos as one ends and one starts - this may help to hide any frame differences. There is always a new "low latency" option in version 1.6.12 of AVPro Video which may help
    to reduce the amount of buffering done internally - but this is all controlled by whichever decoder is used. Sorry I can't offer an exact solution for this.
     
  47. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    AVPro Video does have support for Single Pass Stereo, but I think you would have to use one of our shaders. Unity 2017 is still very new, so there may be some bugs there still. Did you also try it in other versions of Unity?

    Thanks,
     
  48. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    That's odd. The demos should all work out of the box without any modification. Is your Windows 10 version perhaps a K/KN version of Windows? These versions of Windows don't ship with any media codecs and require an extra download from Microsoft called the "Media Feature Pack".

    Thanks,
     
  49. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    It works in Uniy 5.6. I need to migrate to 2017.1 to gain nVidia VRWorks SLI support. I'm using the Unity built-in Standard Shader. If I don't play video on the surface but instead display a texture map then it works as expected.
     
  50. Charlie1103

    Charlie1103

    Joined:
    Jul 19, 2017
    Posts:
    1
    Hi andrew!
    I have a problem with IOS packaging.
    Xcode show this.
    Undefined symbols for architecture arm64:

    "_UnityRegisterRenderingPluginV5", referenced from:

    _AVPPluginRegister in libAVProVideoiOS.a(AVProPlugin.o)

    ld: symbol(s) not found for architecture arm64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    How can i fix it?
    Avpro version is 1.6.2.And Unity version is 5.3.6.