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. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Please try using the latest version of the plugin (1.11.5) as we did fix an iOS crash issue. If it's still crashing, please can you report it on our GitHub page so that our support team can investigate for you:
    https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues

    Thanks,
     
  2. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
  3. zhang321

    zhang321

    Joined:
    Aug 20, 2015
    Posts:
    4
    I use the new version 1.11.5, unity will still crash.The URL video I use is in. M3u8 format. I don't know if this is the reason. I hope you can answer it. Thank you
     
  4. draky

    draky

    Joined:
    Nov 24, 2016
    Posts:
    12
    Hey Nathan,

    Attached are some pictures. Hopefully that is enough. These settings work fine in Windows, but not on Mac
     

    Attached Files:

  5. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Okay, I can see two issues here:

    1) You have transparency packing AND stereo packing set to top-bottom - just set one (probably stereo packing)
    2) The sphere has the wrong shader assigned - it has the Stereo UV shader which is only used when you specify the UV's - in your case you just need to have the other InsideSphere shader

    I suspect if you change these then it will work.
    Thanks,
     
  6. Piranha771

    Piranha771

    Joined:
    Oct 19, 2016
    Posts:
    11
    Why do you flip the UV.Y axis when a video is open?
    This makes any shader that relies on correct UVs for effects impossible to use. Until now I used a camera that captured the video on a mesh and put the result in a render target to use it on the UI with an effect. But this is no good option for performance just to avoid a flipped Y uv you guys made.
     
  7. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    I understand what you mean.
    Actually the flip is in there to improve performance. On some platforms the video frames are decoded upside down (there are different standards for this). We could simply blit to remove the flip, but as you say this adds an extra cost. So instead we hand the video frames in their raw format and rely on the render process via shader to correct the flip. This gives the best performance. If you're using one of our scripts like ApplyToMesh or ApplyToMaterial and the shader your're using is one of ours, or has support for flipping (by copying our shader variable for this), then setting this flip to happen will be done by the script automatically.
    In the new AVPro Video 2.0 we're adding a 'resolve' feature to resolve things like the vertical flip, colour space, transparency etc etc - this involved an extra blit but as you pointed out it makes it easier to interop with othe shaders and rendering systems.
     
  8. Piranha771

    Piranha771

    Joined:
    Oct 19, 2016
    Posts:
    11
    I tried to find somethink like this. But there is no shader variable for flipping. I looked up the ApplyTo* scripts and they modify the VBO data directly. Anyway I resolved the issue by applying the effect as a post process on the camera, which fits my needs better anyway.

    Thank you for your quick response.
     
  9. tigerss

    tigerss

    Joined:
    Oct 11, 2015
    Posts:
    20
    Hi, is there any plan to upgrade Exoplayer version above 2.8.4? We also use another library that requires a higher version of Exoplayer and AVProVideo will crash if using a higher Exoplayer version
     
  10. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    We have upgraded to the latest ExoPlayer version in the upcoming 2.0 AVPro Video which is in beta currently:
    https://github.com/RenderHeads/UnityPlugin-AVProVideo/releases/tag/2.0.0beta5
    AVPro Video 1.x will be retired and and is currently just getting bug fixes and no feature updates. There will be a discounted upgrade route set up for existing AVPro Video users.

    Thanks,
     
  11. AndrewRH

    AndrewRH

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

    AVPro Video version 1.11.6 has just been released!

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

    Changes include:

    Android
    • Added new OES 360 InsideSphere shader with transparency support, including feathered edges for 180 degree content
    • Fixed bug which meant CanPlay() was always returning false after a network connection loss when streaming media. This was causing some developers to not be able to resume playback on calling Play() following the connection loss.
    Windows
    • Restored low latency option as some developers are using it to reduce latency of RTSP streams
    macOS / iOS / tvOS
    • Fixed crash caused by passing an invalid URL to open

    iOS / tvOS
    • Fixed issue with video rendering black when using Y’CbCr mode and the video metadata doesn’t include the type of colour space transform required

    Thanks to everyone that reported bugs that were fixed in this release :)

    Please report any issues here on the forum, or preferably to our Github Issue tracker

    Thanks,
     
  12. joan4d

    joan4d

    Joined:
    Aug 8, 2019
    Posts:
    3
    Hi, i need help for this project. I need use OBS player for streaming live (video and audio) on the unity, for android and WebGL.With AVPRO is posible? thanks
     
  13. tigerss

    tigerss

    Joined:
    Oct 11, 2015
    Posts:
    20
    Thank you
     
  14. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    It depends what format is the live stream in? If it's in HLS (.m3u8) then it should work. There is a free trial version available for download from our website/github so you can test your use case.

    Thanks,
     
  15. AndrewRH

    AndrewRH

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

    AVPro Video version 1.11.7 has just been released!

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

    Changes include:

    Windows UWP
    • Updated UWP 64-bit plugin that wasn’t recompiled since version 1.9.17
    • Fixed trial version UWP ARM builds that were being built incorrectly

    Thanks to everyone that reported bugs that were fixed in this release :)

    Please report any issues here on the forum, or preferably to our Github Issue tracker

    Thanks,
     
  16. rlghksdldy0

    rlghksdldy0

    Joined:
    Aug 10, 2020
    Posts:
    1
    I want to play from the middle of the video. But no matter how much I look, I can't see it. Unity's Video Player can do

    vp.Prepare();
    while (!vp.isPrepared)
    yield return null;
    vp.time = 27;
    vp.Play();

    but avpro doesn't know. Help me teacher.
     
  17. Hossein5017

    Hossein5017

    Joined:
    Oct 9, 2017
    Posts:
    4
    hi
    how can i build AlphaLeftRight video like this ?
    photo_2020-11-16_14-58-23.jpg
     
  18. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Check the documentation PDF, there is a FFMPEG command-line for generating these videos.
     
  19. wurzel-digital

    wurzel-digital

    Joined:
    Jun 21, 2013
    Posts:
    9
    Hi,

    i currently have a weird problem with AV Pro Video in a WebGL application

    In our WebGL application we play a video on UI and WorldSpace UI, but it also renders on random materials in the albedo texture. It happens in FireFox Browser on UI Shaders and in Safari Browser on Standard Shader. The Materials are definitive not linked in any way to the media player. In some cases it renders on an object if you are getting close to it with the camera. if you go further back it is not rendering the video on it any more. In Chrome it is not yet appeared.

    On some objects we got a workaround by adding a texture to the albedo slot of the material, but it still appears in some rare cases.

    Do you have any idea what is creating this issue or did anyone else see this issue? We need some workaround to make sure it is not rendering on random objects.

    we are using Version 1.11.4 currently but will try to update maybe it helps.
     
  20. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Wow that sound very strange. Which version of Unity are you using? Perhaps you could try with another version?

    It sounds like it may be some sort of over optimisation on Unity side...
     
  21. wurzel-digital

    wurzel-digital

    Joined:
    Jun 21, 2013
    Posts:
    9
    i am using unity 2019.4.4f1. i will try to update unity and AvPro and hope it disappears
     
    NathanRH likes this.
  22. kanjess

    kanjess

    Joined:
    Oct 31, 2020
    Posts:
    2
    Sorry to interrupt, but I have encountered some difficult problems about my AVProVideo:

    In my project, I placed the MediaPlayer component on the UI, the corresponding video address is empty, I choose to call the corresponding video through the script code, by OpenVideoFromFile methods.
    And there are other buttons here to control the playback of the video.

    But in actual operation, there are many problems with the code running:

    OpenVideoFromFile: it work, The video appears on the UI and starts to play automatically.
    MediaPlayer.Control.Pause(): it can't work. When I press the button to order the video to pause, Unity reports an error: "NullReferenceException: Object reference not set to an instance of an object".
    MediaPlayer.Pause(): If I replace ".Control.Pause()" with ".Pause()", it works... I don't know why?...and...
    When the video is finished, "MediaPlayer.Control.Rewind()" can work and make the video play again. But if I use "Control.Rewind()" when the video is playing, it alson reports an error: "NullReferenceException: Object reference not set to an instance of an object".

    After some testing, I found that the methods including "Control.MuteAudio(bool)" or "Control.SetPlaybackRate" are unavailable, regardless of whether the video is playing, paused or finished. They all report an error: "NullReferenceException: Object reference not set to an instance of an object"................
    All codes have no errors in VS Code.
    My AVProVideo version is 1.11.3, and Unity is 2019.4.13f1c1.

    Can someone tell me why?... Thanks a lot!!!
     
  23. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I think the problem is that the interface is null.

    MediaPlayer.Control returns an interface, and it can be null while the video is still loading, so you need to check it for null like this:

    if(mediaPlayer.Control != null)
    {
    mediaPlayer.Control.Pause();
    }

    I hope that helps,
    Thanks,
     
  24. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
  25. kanjess

    kanjess

    Joined:
    Oct 31, 2020
    Posts:
    2
    It work! Thank you very much!
    I debug.log the MediaPlayer.Control. It returned "Null" but immediately found the object. So your suggestion made a big difference! Thanks again!
     
  26. Jeff_rey

    Jeff_rey

    Joined:
    Nov 26, 2017
    Posts:
    19

    I think I got it working, could you tell me if this would be a problem.

    Code (CSharp):
    1. namespace RenderHeads.Media.AVProVideo
    2. {
    3.     public class setvideo : MonoBehaviour
    4.     {
    5.         public MediaPlayer VideoManager;
    6.         public string videoUrl;
    7.      
    8.         public void StartVideo()
    9.         {
    10.          
    11.             VideoManager.m_VideoPath = videoUrl;
    12.             VideoManager.OpenVideoFromFile(VideoManager.m_VideoLocation, VideoManager.m_VideoPath, VideoManager.m_AutoStart);
    13.             VideoManager.Play();
    14.         }
    15.  
    16.  
    17.     }
    18. }
    19.  
    20.  
    21.    
    22.    
     
    Last edited: Nov 21, 2020
  27. Hossein5017

    Hossein5017

    Joined:
    Oct 9, 2017
    Posts:
    4
    tanks for answer but I wrote it
     
  28. MathijsDoetDingen

    MathijsDoetDingen

    Joined:
    Nov 24, 2020
    Posts:
    3
    Hi!

    Im trying to make a video switch seamless into another video and am using the playlist media player. I have set the video's to start mode immediate and the progress on finish but i still see a small jitter when the video switches.

    Is there any way to solve this? Perhaps video codec settings to optimize or am i missing something in the setup?
    (i am using the playlisttransitions demo and have deactivated any transitions since we want none)

    I am using Unity 2019.4.11
     
  29. Ikaro88

    Ikaro88

    Joined:
    Jun 6, 2016
    Posts:
    296
    Hi, i tried your product but the audio overpass the unity mute audio for example, there is a way to avoid that?
     
  30. P3ndragonLLC

    P3ndragonLLC

    Joined:
    Sep 19, 2019
    Posts:
    99
    Hello, I've noticed you had a couple of updates in the last couple of months since I asked a question about if it's possible to switch the Audio mode between System Direct and Unity at runtime (at the time of ask, it had to be one or the other when the program launched) and I believe it was on the list for a future update. Is that something that's been added, or do you know when it might be added?

    Thanks!
    Scott
     
  31. jsteinkamp

    jsteinkamp

    Joined:
    Mar 21, 2016
    Posts:
    2
    Problem description: (also posted on Github)

    Mac does not local publish with video, it does on PC.

    This could be related to permissions being changed on the video files.

    Unity 2020 with AVpro is sketchy.

    Please see this site for my research:
    http://users.design.ucla.edu/~cariesta/MayaCourseNotes/html/unity_video_texture_maps.html

    Device (which devices are you having the issue with - model, OS version number):
    MacPro7,1 Catalina, updated browsers

    Media (tell us about your videos - number of videos, resolution, codec, frame-rate, example URLs):
    h.264 mp4 320x240 8480kbps with audio48000 stereo

    System Information:
    AVPro Video: plugin v1.11.6 scripts v1.11.7
    Target Platform: WebGL
    Unity: v2020.1.15f1 OSXEditor
    OS: Desktop - MacPro7,1 - Mac OS X 10.15.7 - English
    CPU: Intel(R) Xeon(R) W-3223 CPU @ 3.50GHz - 16 threads - 32768KB
    GPU: AMD Radeon Pro 580X - Apple - Metal - 8192KB - 16384
     
  32. frangagn

    frangagn

    Joined:
    Sep 20, 2018
    Posts:
    53
    I'm using a VUZE XR as a camera, and I'm using AVPRO Video as software to drive the playing of the videos within Unity. I convert the raw VUZE video into a sbs video using Vuze VR Studio (H.264, 4K, 60bps) and when I try to play it in VR with AVPRO it does not work at all. I can play it in other players on my computer (e.g. Skybox, Play'a), but not with AVPRO.

    When I put the video in Adobe Premiere, for e.g. , and render it without specifying that it's a VR video, it works fine. It is probably a case of "there is stereo metadata encoded within the video which causes our Media Foundation decoder to i nterpret i ncorrectly." as you mention in your FAQ#8. However, having stereo metadata encoded in a stereo video is not a bad thing at all.... I can't believe this is a very difficult fix for you, and the VUZE produces that kind of encoded video by default, and it's one of the current leading VR consumer camera. I cannot ask my users to use FFMPEG to convert their videos before using them with my software..... Besides, the FFMPEG method you describe produces really aweful results, lots of quality loss....

    Anything you can do?
     
  33. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Thanks, yes I understand the problem and agree. This is something we have managed to resolve in Version 2.0 of AVPro Video which should be available soon. Unfortunately in 1.x on Windows we could not address this issue easily but thankfully it is solved now.

    Thanks,
     
  34. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Thanks we are helping you with this over on GitHub.
     
  35. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    I'm afraid this still hasn't been added. It is still a setting that is related to the player setup phase so it cannot be changed until the media is reloaded. It'll still on our list though and hopefully now that we're almost done with the massive changes for AVPro Video 2.0 release we can look into this.

    Thanks,
     
    P3ndragonLLC likes this.
  36. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hmm that's strange - we have code in there to mute the MediaPlayer when the mute in editor option is selected. Which version of AVPro Video are you using?
     
  37. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    That looks good to me!
     
  38. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hmmm. I guess we really need an option in there so that the next video loads BEFORE it's needed...

    Did you try a deep profile the jitter to see where it's coming from?

    High resolution highly compressed videos take quite a while to set up during loading as there are a lot of buffers that have to be allocated and primed. If you have a video that is made of only key-frames then it can be faster to load.

    Or perhaps the jitter is something specific and you can show what it looks like or describe it?

    Thanks,
     
  39. frangagn

    frangagn

    Joined:
    Sep 20, 2018
    Posts:
    53
    And when is this version 2.0 going to be released? I tried to use the Beta, but without any instructions, it's difficult....
     
  40. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    What problems are you having with the beta? we've happy to give you some guidance. It should mostly work very similar to version 1.x. We're trying to get 2.0 out before the end of this month.
     
  41. frangagn

    frangagn

    Joined:
    Sep 20, 2018
    Posts:
    53
    Created a blank project with the same settings as my working project. Created a GameObject to hold the MediaPlayer, loaded a video set layout mapping to EquiRect. Created a sphere to rendre the video, created a new material that uses AVPROVIDEO/VR/InsideSphere Until shader, applied this shader to the sphere, added the ApplyToMesh script to the sphere, added the mediaplayer to this script as well as the MeshRenderer of the Sphere to the APPLYTOMESH script. Triple checked that the Material settings are Stereo MOde = Left/Right and Layout is EquiRect. Video is not rendered in stereo.....

    How can I contact you more directly to get help on 2.0?
     
    Last edited: Dec 7, 2020
  42. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    The best way to contact our support team is via the GitHub issues page:
    https://github.com/RenderHeads/UnityPlugin-AVProVideo

    They way you've done it sounds correct. Does your video contain stereo metadata? Ideally it should, then the plugin will detect it and it should set up everything automatically. In the current beta there is no way to manually force the stereo mode, but we'll be adding that soon.

    Thanks,
     
  43. Juanola_

    Juanola_

    Joined:
    Sep 29, 2015
    Posts:
    38
    Hey!

    So, im working in an Oculus Quest project. I inserted all my videos in the Streaming Assets path, and pointed the media players to those files with the "Relative to Streaming Assets Path" option on.

    I generate an obb that goest with my project.

    So, when I deploy, I get the "Read and Write External Files" permission box. My question is, this is due to the Streaming Assets thing? Android required that permission for reading OBBs? Is it possible to avoid that permission by using other option and the OBB?

    Thanks!
     
  44. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I don't think you can avoid that - it's required I believe. Another option would be to download the videos from a server and put them into the persistantDataPath folder when the app runs for the first time.
     
  45. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
  46. Juanola_

    Juanola_

    Joined:
    Sep 29, 2015
    Posts:
    38
    Yeah, I thought it was probably that way. Thanks!
     
  47. billymonks

    billymonks

    Joined:
    Nov 19, 2016
    Posts:
    3
    Hi, I'm evaluating the demo asset. I'm hoping I'll be able to play this m3u8 stream because this asset seems perfect for my needs. Any help would be greatly appreciated.

    Problem description:

    The video stream does not play, the 360CubeVideo player is solid black.
    Source Path set to Absolute Path or URL. I've tried setting Force File Format to Apple HLS to no effect.

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

    Windows 10, in editor and built app

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

    https://pbs.lls.cdn.pbs.org/est/index.m3u8

    System Information:

    AVPro Video: plugin v1.11.7t scripts v1.11.7
    Target Platform: Standalone
    Unity: v2020.1.16f1 WindowsEditor
    OS: Desktop - B450 AORUS ELITE (Gigabyte Technology Co., Ltd.) - Windows 10 (10.0.0) 64bit - English
    CPU: AMD Ryzen 5 3600 6-Core Processor - 12 threads - 32716KB
    GPU: NVIDIA GeForce RTX 2060 SUPER - NVIDIA - Direct3D 11.0 [level 11.1] - 8031KB - 16384
     
  48. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Thanks for reporting this issue. I have replicated it...Indeed the Windows player has some problem parsing the M3U8 manifest.

    If I just select a substream directly (eg https://pbs.lls.cdn.pbs.org/est/index_1920x1080_8000k.m3u8) then it works fine, which is why I think it's something in the main manifest that's confusing it.

    It plays fine in our macOS and iOS players, but not Windows. I suspect that it's something to do with the additional audio tracks (Spanish and English Description) that may be causing the issue..

    Thanks,
     
    billymonks likes this.
  49. billymonks

    billymonks

    Joined:
    Nov 19, 2016
    Posts:
    3
    Thanks for the quick reply Nathan!
     
  50. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hi All,

    AVPro Video 1.x will be retired soon!

    It's been almost 5 years since we initially launched AVPro Video 1.0 and now with the upcoming release of the new version 2.0 it's time to retire it. We will still keep it around for a bit longer and of course we'll still be supporting existing customers, but we can't continue supporting the old product forever.

    AVPro Video 2.0 will be released soon!

    The new version 2.0 is currently in release candidate phase (and under review at the Asset Store) and should be available soon.

    AVPro Video 2.0 RC1 trial version can be accessed here:
    https://github.com/RenderHeads/UnityPlugin-AVProVideo/releases/tag/2.0.0rc1

    We anticipate releasing an RC2 which will probably become the first official release.

    We've also replaced the old PDF documentation with a web portal which will allow us to make much better documentation which I think is always welcomed. You can see a preview of the new documentation here:
    https://www.renderheads.com/content/docs/AVProVideo/index.html

    If you do spot any issues in the RC1 version please report any issues here on the forum, or preferably to our Github Issue tracker

    Thanks,
     
    LostPanda likes this.