Search Unity

[Released] AVPro Video - complete video playback solution

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

  1. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I'll continue this via PM :)
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Glad to see someone using the OES path :)
     
  3. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
  4. gianfanatee

    gianfanatee

    Joined:
    Jun 14, 2016
    Posts:
    13
    Thanks! I set up the server correctly and everything worked fine.

    About not being able to download the videos via WWW() to play them (On the WebGL guild), are there any ways around that? We really would like to preload a few videos ahead of the current video.

    Thanks,
    Gian
     
    Last edited: Oct 4, 2016
  5. sportique

    sportique

    Joined:
    May 27, 2013
    Posts:
    8
    Thanks!
    everything seems to work great in Windows7 but when I try to run the example build in Windows8.1 It seems to gradually shrink the size of the bunny video (by around 5%) and then crashes when I click to move to the next demo scene. I've tried it on to different machines running 8.1 get the same behavior on both. I've attached the crash log.

    thanks again
     

    Attached Files:

  6. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    123
    That teaser looks cool :) Will the sound source thing allow you to send each mono output to different sound source? So for example if you had a 5.1 sound source you could set the speakers in Unity up like a 5.1 sound system?
     
    Tom-Goethals likes this.
  7. xpansivevr

    xpansivevr

    Joined:
    Jun 22, 2016
    Posts:
    27
    Yes! Please add support for this. :)
     
  8. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm, I think this is just a HTML5 / Unity issue. I don't think HTML5 lets users write to the disk too easily really...I think this is a security issue. I'm no HTML5 expert though...

    According to this:
    https://blogs.unity3d.com/2016/09/20/understanding-memory-in-unity-webgl/
    WebGL builds store all written files in memory, not actually on the disk. I guess it might be possible but one would have to be careful, and I have no idea whether HTML could load from this Unity memory file storage...
     
  9. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    The shrinking is just the watermark when it's using the GPU decoder. The crash sounds like it might be related to GPU decoding but I can't be sure. Could you try going into the Windows "Platform Specific" panel and disabling GPU decoding?
    Alternatively try not to destroy your video player between scene loads. The video player object is a complex object and not something that should be destroyed/created often if possible.
    We will investigate this crash bug though... thanks!
     
  10. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I'll add it to the list. What cool thing are you building that needs stereo videos with alpha? :)
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yeah....that's the plan! Currently my experimental version is stereo only and it's not handling seeking well..Hopefully will get there in the end.
     
  12. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    123
    Let's hope it all comes together. You've shown use you're working on it now so you can expect us to keep badgering you until it arrives :)
     
    AndrewRH likes this.
  13. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    How do I reference the Media Player to play or stop the video? Thank you.
     
    Last edited: Oct 6, 2016
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    There are a lot of examples in the docs and also in the sample code, but here is another:

    Code (CSharp):
    1. public MediaPlayer _mp;
    2.  
    3. void PlayExample()
    4. {
    5. _mp.Play();
    6. }
    7.  
    8. void PauseExample()
    9. {
    10. _mp.Pause();
    11. }
     
  15. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    If anyone is having problems with the latest version of AVPro Video giving build errors due to the shader, please find the fixed shaders attached here. We'll include these in the next version.
    Thanks,
     

    Attached Files:

  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hey Everyone,

    AVPro Video
    has just been nominated for the Unity Awards 2016 Asset Store Award! :)

    Please check it out the award nominees here and vote for your favourites.



    Thanks,
     
    GamerPET likes this.
  17. tlutz

    tlutz

    Joined:
    Oct 14, 2013
    Posts:
    8
    Hello,

    I don't know if this has been added in a new version, but is there an event for when a video is buffering?

    Some videos I try to play in app, which are set to autoplay, will not begin until i have paused and unpaused. After, it will play for a little bit and then stop again, in which case I need to pause and unpause it again. I've looked in event types and I don't see "isBuffering" or something like that.

    Also, will there be support to find out the current length of the video that is loaded/buffered, as there was in the Quicktime plugin?

    Thanks!
     
  18. Kaonuri

    Kaonuri

    Joined:
    Feb 3, 2016
    Posts:
    2
    I want to own android plugin but i think my android plugin is conflict with avpro's android plugin. how can i use multiple plugin with avpro?
     
  19. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Hi,
    I'm trying trial version. And as I'm using linear color space I came to this problem too.

    Could you please provide guide how to fix it for uGUI? Is it possible? I mean while still using HW acceleration with Media Foundation
    Thanks
    Peter
     
    Last edited: Oct 7, 2016
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    You can poll for buffering via:

    public MediaPlayer mp;
    mp.Control.IsBuffering(); // returns true/false
    mp.Control.GetBufferingProgress(); // return value between 0.0 and 1.0

    Are still have a few more plans to further improve buffering visualisation. We also have yet to integrate these commands into the demos but we will be doing that soon.

    Which platform is it where you have to manually pause and unpause? I have never seen that before. If you could please let me know the platform, your Unity version and AVPro Video version - that's be very useful. Does this happen when you use the supplied sample videos too?

    Thanks,
     
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes you should be able to use multiple plugins on Android. I think perhaps you also emailed us about this? If so we'll continue this over email. Otherwise please let me know more about your problem. Thanks,
     
  22. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    We'll provide a shader to fix this in the next update. Thanks!
     
  23. 68af8857-4c75-4981-8dd1-c79878558721

    68af8857-4c75-4981-8dd1-c79878558721

    Joined:
    Mar 14, 2016
    Posts:
    1
    Is there a way to query the exact timestamp or frame number of the current texture?
    GetTextureFrameCount() returns how many times the texture has been updated, which gets out of sync with the source frame count when any frames are dropped.
    IMediaControl.GetCurrentTimeMs() returns how far through the video it should be. I've tried quantizing this to the framerate, but depending on when the texture update happens relative to calling GetCurrentTimeMs, I can be out by a frame.
     
  24. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    @AndrewRH
    Can you please provide a way to get actual mp4 file from the link? For example we provide mp4 link to your media player which in turns get the actual file and play, once whole file is buffered which means its in memory, can you expose a function to get that file so we can do other things like saving on user system or uploading somewhere else.
     
  25. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi, currently there isn't a way to query the timestamp or frame number of the texture. We can certainly try to add timestamp value in the future. We'll have to see how this is possible across all of the platforms. We'll investigate this - it's certainly on the list.
    Thanks!
     
  26. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Currently there is no way to do this in our video player. You could download the file yourself (using WWW class) and then play it from local disk, but to save it after the player has buffered it isn't possible yet I'm afraid. This functionality isn't high on our list of priorities but I'll certainly add it to the list for the future.
    Thanks,
     
  27. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Thanks, and cograts on nomination :)
     
    AndrewRH likes this.
  28. Uli_Okm

    Uli_Okm

    Joined:
    Jul 10, 2012
    Posts:
    95
    Hi @AndrewRH I`m thinking about buying this asset, but I need to be sure first as I can`t test the demos right now:
    - How the VR support works? The video is applied to a Cubemap/Skybox?
    - Is there any special way/settings to use VR? Is it compatible with all the platforms (Windows with Rift, Vive, or Android with cardboard)

    Thanks
     
  29. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi Uli_Okm,
    Typically video is applied to a sphere or a cube. AVPro Video has support and sample scenes for both of these cases. They both work on all VR platforms automatically without any setup - Vive, Rift, Cardboard are all supported and work the same way.
    Thanks,
     
  30. AndrewRH

    AndrewRH

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

    Hoping to have another version of AVPro Video released tomorrow.

    Thanks,
     
  31. AndrewRH

    AndrewRH

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

    AVPro Video version 1.5.2 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:

    General
    • uGUI and IMGUI components now automatically displays videos with stereo or alpha packing correctly without having to assign material manually
    • Fixed shader build errors in Unity 5.4.1
    • Fixed shader build errors in Unity 4.x for D3D9 and OpenGL
    • Added stereo support to more shaders including uGUI
    Workflow
    • Improved component menu layout by grouping components
    • Logging improved so some log messages can be clicked on to highlight the logging MediaPlayer
    Windows
    • Linear colour space now automatically rendered correctly when using GPU decoder
    • Fixed memory leak in GPU decoder introduced in v1.5.0
    • Fixed old memory leak in Notify system
    • Fixed HLS adaptive resolution changing when using GPU decoder and improved texture switch to remove 1 frame glitch
    WebGL
    • Cubemap script fixed to not show texture seam
    • Texture filtering and wrapping modes applied correctly now
    • Added crossOrigin=”anonymous” to video element

    Don't forget to login and vote at the Unity Awards 2016 page

    Thanks,
     
    Tom-Goethals likes this.
  32. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    Hi Andrew I've sent you a email to unitysupport@renderheads.com regarding reference the Media Player. Please help! Thank you!

    EDIT: Is there a way to do something like : while(mediaplayer.isPlaying) ?
     
    Last edited: Oct 12, 2016
  33. gamerhalo21

    gamerhalo21

    Joined:
    Oct 12, 2016
    Posts:
    1
     
  34. lucasTOG

    lucasTOG

    Joined:
    Oct 12, 2016
    Posts:
    7
    Hi Team,

    We are experiencing a problem with the AVPro Video Plugin in OSX. It works fine in Windows and Android, but in OS X the video goes all black, and isn't played.

    We have noticed that CanPlay() returns false, and that the state is "Unknown".

    Do you know what may be causing this issue?

    Thanks!
     
  35. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    146
    Hi,

    I've discovered a strange problem in WebGL.
    I have a mp4 file in StreamingAssets and on the media player I have turned on Auto Play.
    Then I do this in code when I want to start the video:
    MediaPlayer.m_VideoPath = "thevideo.mp4";
    MediaPlayer.OpenVideoFromFile(MediaPlayer.FileLocation.RelativeToStreamingAssetsFolder, MediaPlayer.m_VideoPath);

    This works fine.

    Also I have a replay button and this triggers this code:
    MediaPlayer.Control.Rewind();

    This works well in Firefox but in Chrome it rewinds but doesn't play again. And now when I hit play manually it doesn't react anymore!

    I've created a slider also but in Chrome it doesn't work either. The code for the slider is the same as in the examples.
     
  36. tomszirtes

    tomszirtes

    Joined:
    Apr 25, 2013
    Posts:
    20
    Hi I'm a AVProVideo customer, I would like to grab the movie frame texture for some processing on the CPU. The texture object provided by the library applied to the material is not read-enabled. Is there an easy way to get hold of a read-enabled texture so I can do a ReadPixels call on it? Thanks
     
  37. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    Yes, please take a look at the sample scene called "06_Demo_FrameExtract". This scene does exactly that.
    There is also a function in the MediaPlayer class called ExtractFrame() which will help you. See "FrameExtract.cs" for example usage.
    Thanks,
     
  38. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I'm not sure what could cause that. Could you provide more information please, such as:

    1) Which version of AVPro Video?
    2) Which version of Unity?
    3) Which OS X version?
    4) Format and resolution of your video?
    5) Does it work when you use our sample videos?

    Feel free to email us about this to discuss further - unitysupport@renderheads.com

    Thanks,
     
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmmm, strange indeed. We'll look into this.
    Which version of Unity are you using? And also version of Chrome until which operating system?
    Have you tried out sample scenes here:
    http://downloads.renderheads.com/2016/AVProVideoDemoWebGL/
    There is a demo in the with a rewind button and slider - please see if that works in your Chrome. This demo was built using Untiy 5.4.1.

    Thanks,
     
  40. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    mediaplayer.Control.IsPlaying() should work :) We'll reply to your email shortly. Thanks,
     
  41. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I believe this is because you haven't set up your plist permissions file. This is required on Apple platforms that access URLs. We mention this in the PDF documentation, please see the section on Streaming.
     
  42. tomszirtes

    tomszirtes

    Joined:
    Apr 25, 2013
    Posts:
    20
    Great thanks!
     
  43. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    146
    I'm using Unity 5.4.1f1 with Chrome version 53.0.2785.143 on Windows 10 64 bit.
    But the demo works! So I will look into the demo code to see what's different.
    Maybe the difference is that I'm using Unity's gui (uGUI) implementation.

    UPDATE: I found the problem. It is not working correctly in Chrome when in the "Player settings" - "Other Settings" the option "Optimize Mesh Data*" is checked!
    So when you experience the same, just uncheck this box.

    UPDATE 2: It works when I host it locally but when I host in on our server I get this message:
    Error: network loading error (errorcode=2)
     
    Last edited: Oct 13, 2016
  44. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for the updates. Excellent bug-hunting skills to find that strange issue with "Optimize Mesh Data"! I will look into this and perhaps report it to Unity as a bug.

    Where are you loading your videos from? Streaming Assets folder, or another URL? Or is this error message just coming from the Unity app itself? More details please :D

    Thanks,
     
  45. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    146
    I'm loading them from Streaming Assets and the error message is from the javascript console in the browser (F12)
     
  46. gianfanatee

    gianfanatee

    Joined:
    Jun 14, 2016
    Posts:
    13
    Henkjan, check if your server is being able to handle requests for mp4 files. The strea ming assets for WebGL are in a subfolder. In my instance of IIS, I had to tell the server to answer to mp4 files from the Stre amingAssets subfolder (If I remember correctly, modifying the MimeType handler).
    Start by trying to access the video file from the browser itself and see if that works!

    Edit: The Unity Forum wasn't allowing the word Stre aming
     
  47. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    146
    The server is well configured because:
    1. Firefox and Edge work ok
    2. In Chrome the video is showing but when I hit rewind or try to scroll with a slider the plugin/video 'hangs'.
     
    Last edited: Oct 16, 2016
  48. wangshibowyl

    wangshibowyl

    Joined:
    Dec 24, 2009
    Posts:
    9
    it's great work! but http streaming with android has some problem,I hava to wait too long time to play,"ffmpeg -movflags faststart" not work too.but the same video play immediately on windows 10 http.I don't know why.
     
  49. 907917072

    907917072

    Joined:
    Oct 14, 2016
    Posts:
    1
    Hi,@AndrewRH ,In the 1.3.9 version of the IOS system, the video will blur and jitter and what does the new version solves this problem?
     
  50. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945