Search Unity

[WIP] MPMP - cross platform video solution

Discussion in 'Works In Progress - Archive' started by sloopidoopi, Jan 5, 2016.

  1. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Hi,
    i'm planing to release soon a new video solution for Unity on the Assetstore :

    MPMP (multi platform media player)

    MPMP is a high performance cross platform media player for Windows, Android and iOS/OSX
    To get the best hardware performance on each platform it uses different media frameworks.
    • Windows: Media Foundation
    • Android: Media Player
    • iOS/OSX: AVFoundation

    In Unity you have only a unified c# interface you work with, so you don't have to deal with all the platform differences. And finally you have video support in the editor!

    A first impression :



    Setup:


    I provide a demo version for beta testing/debugging so you can report any issues before it is going on the Assetstore.(Draws a watermark onto the video)

    Any feedback is welcome!


    System Requirements:
    ====================
    Unity 5.2.2 or higher (Best is to use 5.3 when on OSX)

    Windows:
    Windows 8+
    DX11 only!
    Visual C++ Redistributable Packages for Visual Studio 2013 (in the vcredist folder are two installers)
    (https://www.microsoft.com/en-us/download/details.aspx?id=40784 )
    If you don't want to install the full Redistributable Packages you need at least following dlls (located beside your exe):
    msvcp120.dll,msvcr120.dll,vcamp120.dll and vcorlib120.dll

    Android:
    Android API level 15+ (Android 4.03+)
    armeabi-v7a or x86 CPU
    OpenGLES 2.0 as Graphic API

    iOS:
    iOS 6+
    OpenGLES 2.0 as Graphic API

    OSX:
    64 bit system



    FAQ:
    ============
    MPMP doesn't work on my mobile device.
    Please check your Graphics API in the publish settings. You have to use OpenGLES 2.0 !

    What shader can i use?
    You can use every shader that has a '_MainTex' property. So you can use almost every shader that comes with Unity

    Can i use the videotexture on several objects at the same time?
    If you want to use the videotexture on several objects you can attach the material that your videoHost uses to another GameObject.

    Can i use APK Expansion Files on Android?
    Yes. MPMP checks if the Unity app is an obb file and loads the data in a different way.
    You can leave your videos in the StreamingAssets folder of Unity before you split your APK at built time.

    Can i use 4K movies?
    I tested a 4K movie on Windows 8.1 and it worked but without GPU acceleration.(Perhaps it could run under Windows 10 with GPU acceleration)
    So you need a decent CPU.

    Why is my video playing in the editor but not on my mobile device?
    Every platform has is own restrictions in terms of video codecs or audio formats. So it is most likely a problem of your video encoding.
    (For example at my tests on Android i had problems with a video that uses mp3 audio compression)
     
    Last edited: Feb 5, 2016
  2. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    I added a new setup demo video to the first post. It shows a quick setup on Windows and you can see how small the performance footprint on the system is even if you play a full HD video.
     
    nikokoneko likes this.
  3. Visual_Lies

    Visual_Lies

    Joined:
    Nov 3, 2014
    Posts:
    17
    Is there HAP support and do you have an idea on your price at the moment?
     
  4. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    At the moment i have no HAP support. Don't know if it would make much sense. I don't know if there is a real benefit over normal h264 with the native media frameworks. Did you played with the demo version? Do you think the native hardware decoding support is not enough?
    I'm planing to release this for 125$ ( I think this is a fair price considering the amount of supported platforms and features)
     
  5. Visual_Lies

    Visual_Lies

    Joined:
    Nov 3, 2014
    Posts:
    17
    The price sounds fair. I use almost exclusively HAP video files and just purchased AV Pro Windows Media to use in my project priced at 200, windows only, but HAP support. I am definitely interested in your asset that though and will keep in mind if I need to publish to anything other than windows.
     
  6. hurleybird

    hurleybird

    Joined:
    Mar 4, 2013
    Posts:
    258
    The big issue I see is the Windows 8+ requirement. Breaking compatibility with Windows Vista and 7 is a tough pill to swallow.

    Besides that, any plan for alpha channel support?
     
  7. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    For backward compatibility the implementation effort is much more complex (and so more error prone) so i decided to go this route. I hope that Windows 8 it not a too high demand these days.
    For alpha channel support i can make no promises. First i have too make me more familiar with this topic. But it should be not a big problem to have some sort of alpha solution that is shader based (color keying,masking etc.)
     
  8. hurleybird

    hurleybird

    Joined:
    Mar 4, 2013
    Posts:
    258
    The issue I see with no backcompat to at least Vista is that, not only does it substantially reduce the size of the market a game can address, but you're also opening yourself up to the continuous hassle of refund requests from Vista/7 users who (reasonably) assume that the game will run on their systems.

    For me, it doesn't matter how good the video playback is because breaking compatibility completely overshadows that.
     
  9. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    You are right with your concerns. And when i look at the Unity statistics i see that Windows 8+ is not so much popular as i expected . But in a first step i want to release it in the current status. I assume that possible customers could read the systems requirements i provide and don't feel they are trapped. And i already provide a demo so you can test it before you buy ( I can't do more to prevent missconceptions).
     
  10. hurleybird

    hurleybird

    Joined:
    Mar 4, 2013
    Posts:
    258
    Heh, sorry about that. By "you" what I meant was "myself and other developers." Apologies for the imprecise language. For example, I wouldn't want to break compatibility with Windows 7 in my game lest I end up inundated with refund requests from customers who didn't notice the system requirements.
     
  11. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    I submitted version 1.0 for review. Hopefully there will be no complications that delay the release. In the meantime you can download the demo version. I updated the link to version 1.0. There is now also a manual as pdf included.
    I also evaluted a Windows 7 support. But i can't tell any timeframe.(This is a complete separate development from the Windows 8+ version)
     
  12. daterre

    daterre

    Joined:
    Jul 30, 2012
    Posts:
    41
    Been using it on Windows so far, smooth and straightforward! Good work!
    I'm guessing the audio is bypassing Unity altogether. Is there any way to route it through the AudioSource/AudioListener/Mixer pipeline or would I need to import the audio as a separate file for that?
     
  13. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    As audio is handled by the media framework there is a problem with routing it into the unity mixer. One solution that mimics some features would be to write a script that adjusts the volume and paning of the media player depending on the camera position in relation to a gameobject that has the mpmp instance attached.
     
  14. loko08

    loko08

    Joined:
    Oct 6, 2013
    Posts:
    57
    Hey Man! Just wanted to say KUDOS!!

    It works great on iOS, and we are going to be using this on a commercial project. :) It works just fine. Hopefully you can have the Asset up in a couple of days :)

    Thanks!
    JP
     
    sloopidoopi likes this.
  15. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    MPMP is now available on the AssetStore! :)

    I created a new thread under the 'Assets and Asset Store' rubrik and will only post beta/development related stuff here.
     
    Last edited: Jan 25, 2016
  16. QuindoDark

    QuindoDark

    Joined:
    Jan 29, 2016
    Posts:
    5
    I have tried to get the demo working in 5.3.2f1 and 5.2.3f1. After importing the package I would get the following error whenever I tried to run the example scene.


    5.4.2 error:
    Failed to load 'Assets/MPMP/Plugins/x86_64/MPMP.dll' with error 'The operation completed successfully.
    ', GetDllDirectory returned ''. If GetDllDirectory returned non empty path, check that you're using SetDirectoryDll correctly.​


    5.2.3 error:
    InitializeUnityExtensions: Must have a valid path for the plugin [8]
    Extension was not registered, that means it relies on default PluginImporter settings, please register extension and apply necessary settings for it in the callback.​

    My setup was to start a brand new empty project and import the demo. I have tried google searching to fix the issue but I was unable to come up with any solutions. Other people seem to have no issues with it. Any ideas?

    Also, the download link for the demo on the asset store page 404ed last time I tried it.
     
  17. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    It could be that i exported the demo with Unity 5.3.(Can't remember) .Normaly this exceptions come when you open a scene with a minor version then 5.3 (as far as i remember from my tests). Did you tried to run the scene and it doesn't work?
    (The link on the Assetstore should now work again )
     
    Last edited: Jan 29, 2016
  18. QuindoDark

    QuindoDark

    Joined:
    Jan 29, 2016
    Posts:
    5
    When running the scene the following happens. http://prntscr.com/9wj5uh
    Clicking on the ui buttons does not cause any change in the game view.

    This was after I delete all the files in the project and reimported it from the fresh download from the asset store.

    Errors also appear simply from selecting MPMP.instance in my Game Hierarchy.
    http://prntscr.com/9wj6z7

    This is in unity 5.3.2f1
     
  19. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    This is strange. I made also a fresh setup and had no problems. Did you installed the vcredist package?
    And when you select a MPMP.dll do you have the right settings per platform?
     

    Attached Files:

  20. QuindoDark

    QuindoDark

    Joined:
    Jan 29, 2016
    Posts:
    5
    I ran the repair of the vcredist package and restarted my machine. I am still receiving the same errors. I double checked the Inspector settings and they all seem correct.

    The system I am on is a windows 10 64 bit Intel i7.

    I have done a search of my system for 'vcorlib120.dll' and it is not found.
     
  21. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    I tested it on a Windows 10 machine and had no problems.
    But i realized that you need both versions of the redistributable package installed when you work in the Unity Editor.
    The required dlls from the vsredist package are located in C:\Windows\System32 for the x86 platform and in C:\Windows\SysWOW64 for x86_64
     
  22. QuindoDark

    QuindoDark

    Joined:
    Jan 29, 2016
    Posts:
    5
    Ah you do need both? I did that, but I still can not find 'vcorlib120.dll' anywhere on my system.

    Google is also short on results for this DLL. https://www.google.com/search?q=vco...i57.973j0j7&sourceid=chrome&es_sm=93&ie=UTF-8

    Is there a typo in this dll name?

    I jumped into IRC to see if anyone else would have the same issues I was having. One that did told me I would need to Ask you how you did the asset db as the only ref to 'Assets/MPMP/Plugins/x86_64' is in the asset db.
     
  23. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    The dll name is vccorlib120. I missed a 'c' . The best is to search for '*120.dll" . I made some test and you have to install the x86 and x64 vcredist package even if you on a 64 bit machine. Unity seems to load something behind the scenes.
    Only later when you run your exe you need only the version of the architecture you used in the publish settings.
     
  24. QuindoDark

    QuindoDark

    Joined:
    Jan 29, 2016
    Posts:
    5
    An update.

    I repaired the 2 installations and started fresh in 5.3.2.

    I am still getting the errors in the editor.

    Building it for windows results in the demo working 2 out of 10 attempts. Most of the attempts clicking the load button caused the program to stop responding. I have running it in various configurations and I have not gotten a repeatable pattern.

    Building for android, it just works.

    I am going to switch to a different machine to see if it is just an issue on my specific machine. If you want debug logs from anything let me know.
     
  25. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Did you installed the packages with admin rights?
     
  26. bradsears

    bradsears

    Joined:
    Jun 30, 2015
    Posts:
    12
    I'm in the same boat. Unity can't find the dlls. vccorlib120.dll is in the windows folders suggested. Windows 8 64. Unity 5.3.2f1 personal.
     
    Last edited: Feb 2, 2016
  27. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
  28. bradsears

    bradsears

    Joined:
    Jun 30, 2015
    Posts:
    12
    That worked right away. Thanks and sorry I missed the post.
     
  29. Rissatto

    Rissatto

    Joined:
    Mar 16, 2013
    Posts:
    5
    Expected to support WebGL?

    You do a discount for friends? lol
     
  30. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Don't expect too much soon. First i have to make a Windows 7 version.
    I don't have friends :D but i signed it for the discount program .;)
     
  31. takoy

    takoy

    Joined:
    Jul 2, 2015
    Posts:
    20
    Hi
    Can I use it to view also youtube videos?
    Can I feed it a byte array every frame to show a video (streamed from a websocket)?

    Looks like an awesome solution! good work!
    Thanks
     
  32. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    To both questions: No
     
  33. hacaro76

    hacaro76

    Joined:
    Oct 14, 2015
    Posts:
    25
    Hey Guys, someone has used this asset with Google Cardboard SDK ? . We're interested to play a Stereocopic 360 Video through the Cardboard SDK.

    Some one have some example of intergation ? or suggestions ?

    Many Thanks in advance and Best Regards.
     
  34. polytropoi

    polytropoi

    Joined:
    Aug 16, 2006
    Posts:
    681
    @hacaro76 it works fine with cardboard, just put cardboard stereo controller component on the camera in the 360 demo scene.

    @_monoflow, thanks for the great asset. I like your DownloadAndSaveData method, is there a way to get a download progress callback somehow?
     
  35. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    @polytropoi : i will look into it . should not be a problem.
     
  36. Petter-Bergmar

    Petter-Bergmar

    Joined:
    May 11, 2016
    Posts:
    5
    Hello! And thank you for a great plugin. I have a problem with Windows 10. It works on my laptop running Win 10 but when I try the demo on a new computer with Windows 10 it doesn't work. When I click "Load" in the demo, the button turns red. I have installed the vcredist, is there anything else that I need? This is a very new computer with Win 10 and DirectX 12 preinstalled.

    Best
    Petter
     
  37. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Hi,
    i uploaded a new demo version for the next release (1.7)
    Before it goes official you could test it.
    The new version comes now with a second backend for Windows based on VLC. What means this?
    • Windows 7 support
    • Better streaming support on Windows.
    • More codecs supported .
    You can switch between the backend when you go under 'Edit/Preferences.../MPMP'
    Best is to read the documentation.
    So you have the choice on Windows now between the best performance(Media Foundation) or wider platform/codec support (VLC).
    Would be great if i get some feedback if you have any trouble or if the setup works without a problem.
    (And if you like it it's a good moment to buy it before the release goes public .Price will go up)
     
    Last edited: Jun 2, 2016
    sonofbryce likes this.
  38. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Does the VLC backend also require dx11?
     
  39. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    At the moment yes. DX 9 for VLC is on my todo list.
     
  40. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Great! Thanks!
     
  41. GuruNinja

    GuruNinja

    Joined:
    Jul 28, 2016
    Posts:
    7
    Hi, When I use seekTo(newsweekfloat, true) method on the android, he does not seek correctly! Do you have any solution of this problem?
     
  42. Pquinn

    Pquinn

    Joined:
    Oct 13, 2016
    Posts:
    1
    Hi Monoflow,
    I am working on a project which requires a muli-platform media player and MPMP is perfect. We tested it out and had a pretty nice build completed before buying, however after buying the plugin and buying a new PC I am now having difficulties with the same project.

    Any time I try and load media in editor and standalone Unity completely crashes. It can still be built to Android and works on Gear VR however any help you have to offer would greatly be appreciated.

    New PC specs:
    Windows 10
    Intel Core i7-6700 CPU @ 3.40GHz
    16gb RAM
    NVIDIA GeForce GTX 1070
     
  43. _monoflow

    _monoflow

    Joined:
    Mar 26, 2014
    Posts:
    271
    Have sent you a PM