Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

[RELEASED] MPMP - cross platform video solution

Discussion in 'Assets and Asset Store' started by _monoflow, Jan 25, 2016.

  1. DerrickBarra

    DerrickBarra

    Joined:
    Nov 19, 2013
    Posts:
    202
    Thanks _monoflow, is there a way to see in MPMP what a video texture's FPS currently is for benchmark testing?

    Man if we somehow get this working then MPMP would be the defacto way to play VR video. I'm curious what that pixel bottlneck is too since the GPU usage isn't super high.
     
  2. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    I uploaded a new version (the demo version is already updated online):

    Version 1.3 - 2016.02.17

    • video texture is now displayed correct in linear color space
    • Texture filter mode(Point/Bilinear) option for Windows
    • You can now specify the texture property name that should be used in the video texture. So every custom shader should now work without tweaking the MPMP code by hand.(default is '_MainTex')
    • Added a time ugui element for displaying the position and duration in seconds
    • Added a path ugui element for managing the video path
    • Added a 360° demo scene for watching stereoscopic panorama videos
    • Fixed exception bug on OSX when Windows is the target platform and you run the scene in the editor
    • Added a log warning and auto switch to x86_64 when publishing for OSX
    • Documentation update
    Many thanks to the valuable feedback and support @olix4242 !
     
    Last edited: Feb 18, 2016
  3. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    I am trying to test the latest demo you have released and its not working in the editor on OSX. Says it cannot find the entry point for NewMPMP.
     
  4. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Turns out reimporting and then restarting Unity fixes it!
     
  5. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Yes you have to restart Unity when you updating native plugins! This is a fact that can cause some confusion. Always secure to do a reimport and restart in combination. Or at best test a new version in a clean new project.
     
  6. DerrickBarra

    DerrickBarra

    Joined:
    Nov 19, 2013
    Posts:
    202
    Hi _monoflow, if you spotted the editor crash bug post I made you can safely ignore it, the crash was on my part.

    But, an unrelated null reference exception, if you open MPMP.API_Test scene and play there's a crash when the test scene code looks for your MPMPScaleFlip.cs component but it's not finding it (you should wrap the GetComponent call with a null check) and then re-add the Flip script to the object that's missing it in the scene.

    And thirdly I've been personally adding a GetVideoMaterial() function to your MPMP.cs script that just lets me get access to the material (which is private), would you mind adding this function in your actual script? (That way on future releases I don't have to keep re-adding the function). I know it's super minor but it would be helpful. Thanks!
     
  7. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Good to know. Thanks for the info! I will update the stuff you mentioned.
     
  8. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Is there a way we can load in a default texture until the plugin starts rendering the video? This would be handy. Or the ability to have the renderer invisible until the video is actually ready to display its first frame?
     
  9. DerrickBarra

    DerrickBarra

    Joined:
    Nov 19, 2013
    Posts:
    202
    I know the requirements would be nuts, but is there anything internal to MPMP that would prevent an 8K video from working on a high powered desktop? I'm thinking using an 8K video with SBS (Side By Side) or TB (Top-Bottom) formatting would be enough resolution for each eye (4K each) to look good with a 360 format video (cuts it down again to roughly 2k per eye at any given time).
     
  10. haska

    haska

    Joined:
    Oct 20, 2015
    Posts:
    1
    In version 1.3, unity crashes to quit if load video2 while video1 is playing.
     
  11. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Bug. Will be fixed ! (You have to pause the video before triggering a new load by hand at the moment)
     
  12. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    I will think about what the best option would be. But i guess an option for a default texture would the best way.
     
  13. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    First you need the right codec for your video. H264 will not work as the max resolution is 4,096×2,304 ( https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels ) .So you will need H265 ( https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding#Tiers_and_levels ) . As far as i know this is only supported under Windows 10. And i don't know if there are arise other problems when handling such a huge texture in Unity.
     
  14. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Version 1.3 is now online in the AssetStore !
    If you have some problems with updating an existing scene (EntryPointNotFoundException: NewMPMP) then the new dll were not updated ) To be sure that you have the latest dll you could open your project, don't run it, delete the MPMP/plugins folder and reimport MPMP. Then you have the latest dll.
     
  15. FaramirTFK

    FaramirTFK

    Joined:
    Feb 23, 2016
    Posts:
    8
    Hi everyone!

    I must say first at all i´m pretty new at this, but right now i´m feeling stupid.
    I have recently download the demo version, i´m trying to play some video in 360º with the demo scene.
    I have 0 idea, cause I tryed to put the videoPath (Example: c:\360video.mp4), I can see the video on the little box at the bottom but the video doesn´t play and the canvas stays white.

    Maybe do i need to put something especific in the videoMaterial?
     
  16. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Did you checked the system requirements and the installation process from the manual?
     
  17. DerrickBarra

    DerrickBarra

    Joined:
    Nov 19, 2013
    Posts:
    202
    Hey FaramirTFK

    The video path in your example should be 360video.mp4, which would default to the streaming assets folder of your unity project.

    Silly question, are the videos in the demo scene working? If not then that needs to be solved first before you try playing your own.
     
  18. FaramirTFK

    FaramirTFK

    Joined:
    Feb 23, 2016
    Posts:
    8
    All the videos were working. Well the demos for 360º doesn´t have videos, those are the ones i´m trying to play. First time worked as i said with the video in the inferior canvas, but since that time unity got blocked. Before posting i checked out the manual, this pc should be able to move all of it without problema, Windows 10 updated, GF 950, 16 Ram, I5....
    About the video it´s a demo from Kolor Eyes and it works fine with their external player. Maybe i will check the manual again perhaps i missundestood something.

    PD: I think the problem is that i went too greedy, i just tryed some HD 360º and it´s working, but the first one 4K isn´t, i´ll make updates so maybe this helps someone like me after. Thank you.
     
    Last edited: Feb 24, 2016
  19. FaramirTFK

    FaramirTFK

    Joined:
    Feb 23, 2016
    Posts:
    8
    Well that was close. Now i´m trying just to use the MPMP.basic scene and load another video, i´ve got the deadpool trailer and converted it with QuickTime Pro as you say before, the first time i ran the scene it worked perfectly but the second one went to hell, and unity got blocked. :(

    Do you have some idea about what i may left behind?



    That´s all folks, and then i have no other choice but to crash unity with the task manager. The only think weird i can think about is the fact that is on DirectX11 over DirectX9...
     
  20. mml

    mml

    Joined:
    Mar 29, 2015
    Posts:
    11
    Hi there,
    I just grabbed your asset today. It was a breeze to install and setup and it works nicely on mac and iOS. Great job!
    Unfortunately I ran into an issue when trying to export the .ipa for TestFlight. XCode fails when trying to codesign MPMP.bundle.

    What can I do to get an .ipa with the MPMP.bundle for TestFlight?

    Cheers,
    Felix
     
  21. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
  22. mml

    mml

    Joined:
    Mar 29, 2015
    Posts:
    11
    Thanks for the quick reply! I have already done a few TestFlight builds of the same project and only ran into the issue after I added MPMP. But I will make sure, and try a build without MPMP and see if that works. Until then, a few questions:

    So, you're saying it should work out of the box and I don't need to change any build/player/plugin settings in Unity or in XCode?
    Also, Is it normal that MPMP.bundle shows ab in the Binary and Entitlements section when exporting for iOS App Store Deployment (See screenshot)?
    Shoudl I be worried that it doesn't have a Provisioning Profile set?



    Cheers,
    Felix
     
  23. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Under normal circumstances there should be no reference to the MPMP.bundle on iOS. I tested it on my machine and what i realized is that when you click on the MPMP.bundle in the Assets folder of Unity you have to check in the inspector the 'Select platforms for plugin'. It should set to 'Standalone' and 'Editor' so the bundle it is not included into the XCode Project.
     
  24. mml

    mml

    Joined:
    Mar 29, 2015
    Posts:
    11
    Yes, that fixed it. Thanks!
     
  25. marshmatter

    marshmatter

    Joined:
    Oct 2, 2013
    Posts:
    44
    Just picked this up yesterday and seems to be working great on our test devices. Nice to have a good cross-platform video solution!

    Something I have noticed is the video framerate seems to be visibly choppy on the mobile devices, as opposed to silky smooth in editor (playing local file from streamingassets)

    Is this a common performance limitation or am I missing something? Could this be an encoding issue?
     
  26. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Could you specify your 'mobile devices' a bit more (platform, device) and what video do you use (codec, size)?
    In general you can't expect the same performance on mobile as on standalone. On Android there are many different hardware specs with different performance. Do you have playback issues or seeking problems?
     
  27. marshmatter

    marshmatter

    Joined:
    Oct 2, 2013
    Posts:
    44
    Sorry for the lack of detail there.

    My test clip is: mp4, h.264, 1280 x 720, 29.97 fps, 1 minute 39 seconds. Audio is 44100 Hz Stereo.
    Test devices are a Nexus 5X and an iPad Mini 2.

    I'm using the MPMP Basic scene for testing.

    It's just simple playback right now (I'm not concerned with seeking through the clips). But I am noticing that the fps of the video feels slower - e.g. only playing back at 25fps. My first test possibly tonight will be to re-do the video clip at 30fps proper.

    I still haven't had a chance to experiment too much just yet, but I figured I would check in to see if this is an expected behaviour and/or performance limitation or if I just need to look more closely at my encoding.

    Handheld.PlayFullScreenMovie gives a smooth and expected result with the same file.
     
  28. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    In the MPMP.cs script is a fps property that you could change. In the latest version it could be that i changed it to 30. change the value to 1/60 . This will increase the update interval .
     
  29. marshmatter

    marshmatter

    Joined:
    Oct 2, 2013
    Posts:
    44
    That seems to have done the trick, cheers!
     
  30. hirokitanaka65

    hirokitanaka65

    Joined:
    Feb 25, 2016
    Posts:
    5
    Hello,
    I purchase the MPMP and try the above.
    Then it works perfectly on Windows. However, it doesn't work on OS X(both on UnityEditor and on built application).
    I'm attaching screenshot of gui then load button was clicked.
    I'm using MPMP1.3 on Unity 5.3.3p1, OS X 10.11.3(15D21).
    Please tell me I should try next.
    Regards.
     

    Attached Files:

  31. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Does it not work with local files?
    Could you try it with other streams? (Don't know if there are access restrictions on the area you live.)
    And please check if the url you pasted is right.
     
  32. hirokitanaka65

    hirokitanaka65

    Joined:
    Feb 25, 2016
    Posts:
    5
    Thanks for your reply.

    I'm using valid URL that I checked on Safari.
    It works with local files, and with 'not live' streams on web likes http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
    When I try it with other streams, if the stream isn't live broadcasting, it works.
    But it doesn't work if the stream is live broadcasting likes http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/appleman.m3u8
    After load button clicked, seek parameter of MPMP become NaN.
     

    Attached Files:

  33. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Hm, strange. The fact that the seek parameter gets NaN is normal as you can't seek into a stream.
    The only thing that i could imagine is that there are some changes with OSX 10.11 or Unity changed something in Unity 5.3.3. Do you have a Unity 5.3.2 Version to test?
     
  34. hirokitanaka65

    hirokitanaka65

    Joined:
    Feb 25, 2016
    Posts:
    5
    Just now I try it on OS X 10.10 and Unity5.3.3p1, it works with this URL: http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/appleman.m3u8
    And it doesn't work on OS X 10.11 and Unity5.3.2p1, so the cause are some changes with OS X 10.11 probably.

    My question has been solved. Thank you very much.
     
  35. nrlnd

    nrlnd

    Joined:
    Mar 13, 2012
    Posts:
    12
  36. hirokitanaka65

    hirokitanaka65

    Joined:
    Feb 25, 2016
    Posts:
    5
    Do you have any plans to confirm above and make to work on OS X 10.11?
     
  37. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    I'm working on a solution.
     
  38. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
  39. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    I'm having an issue with the GUI on the demo version:

    Unexpected top level layout group! Missing GUILayout.EndScrollView/EndVertical/EndHorizontal?
    UnityEditor.DockArea:OnGUI()

    And All I get is this :



    I imported it into an empty project just to make sure nothing else was interfering.
     
  40. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    What platform and which Unity version?
     
  41. Crazydadz

    Crazydadz

    Joined:
    Mar 29, 2012
    Posts:
    50
    Wow, seems a nice plugin good job! Are all the source code included with the plugin?
     
  42. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Thanks. The native part is closed source.
     
  43. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    Just for reference since we discussed this offline, it's Windows 7, apparently Windows 8+ is a requirement, even if you turn on Debug Mode, and manually assign the .mp4 it will not play on other platforms like Android. I Tested this theory at home where I have a Windows 8+ box, and it works just fine, natively and on android when you have 8+.
     
  44. hacaro76

    hacaro76

    Joined:
    Oct 14, 2015
    Posts:
    25
    Hi, there is a way to use it with google Carboard SDK ? We want to play an over under 360 stereo video with Cardboard.

    Thanks in advance
     
  45. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    JFYI: I made another stress test with a GTX 970 Card and had no problems to run 8x1080p videos simultaneously or play 4x2160p videos at 60 fps .(In a 1920x1080 Unity window) If i start all the videos at the same time there is some short amount of time where the framerate drops but after that the framerate is stable.
     
  46. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    I uploaded a new version (the demo version is already updated online):

    Version 1.4 - 2016.03.12
    • Added an option for adjusting the refresh interval of the native texture update
    • Linear color space on NVIDIA cards is now supported
    • Loading a new video with new dimensions don't cause a crash anymore on NVIDIA cards (Windows)
    • API calls from mediaPlayer uGUI don't call the plugin directly (crash on ATI cards fix)
    • Pause before load fix (Windows)
    • Critical Section now with higher spincount to improve stability (Windows)
    • SaveAndLoad method has now new action parameter for tracing the download progress
    • Changed the initialisation of MPMP to Awake. Also added a script execution order manager that forces the MPMP.cs to be executed earlier.
    • MPMP_DelayQuit.cs script for shutdown all MPMP instances before your application quits. Fixes a possible crash on quit (Windows)
    • New Events: OnPixelbufferError (OSX/iOS) forces a reload for fixing some possible video refresh problem on OSX El Capitan.
    • OnTextureChanged: called when the internal texture has changed the dimensions.(Windows,Android)
    • API addition: GetVideoMaterial, SetUpdateFrequency, GetUpdateFrequency
    • Documentation update

    As i have to destroy the videotexture on every load for NVIDIA on Windows there is now some short flicker. I had to change this as otherwise Unity crashes when you load a video that has a different dimension then the actual video. On ATI cards this is not the case.
    From my testing with the new OSX El Capitan i'm frustrated as the AVFoundation implementation has now bugs that didn't occured on Yosemite.
     
    mimminito likes this.
  47. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    mimminito likes this.
  48. RicardoViana

    RicardoViana

    Joined:
    Feb 16, 2015
    Posts:
    13
    Hi there.
    did any of you guys tested with Unity 5.4 beta?

    i'm having a few issues. it doesnt load the menu on top. And i get a few errors.

    Severity Code Description Project File Line
    Error No overload for method `DownloadAndSaveData' takes `3' arguments
    Error CS7036 There is no argument given that corresponds to the required formal parameter 'progressAction' of 'MPMP.DownloadAndSaveData(Uri, Uri, Action<bool>, Action<float>)'
    Error The best overloaded method match for `UnityEngine.MonoBehaviour.StartCoroutine(System.Collections.IEnumerator)' has some invalid arguments
    Error Argument `#1' cannot convert `object' expression to type `System.Collections.IEnumerator'
     
  49. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Did you made a new fresh project or just updated an existing to 1.4? Please test a fresh project or delete the scripts folder of MPMP and do a new import of the MPMP package.
     
  50. RicardoViana

    RicardoViana

    Joined:
    Feb 16, 2015
    Posts:
    13

    I have updated to 1.4. It didnt work. So cleaned up all MPMP folder and imported again. Still not working.
    Havent tried with a fresh project though.
     
unityunity