Search Unity

[400usd] UVLC (Android, ios and windows standalone)

Discussion in 'Assets and Asset Store' started by arklay_corp, Nov 25, 2016.

  1. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242

    UVLC
    Link to the store: UVLC

    This plugin is aimed to integrate video playback on your game or app both, local and streamed files.

    And I really mean integrate... most solutions out there just put video on your game, but it's very hard to get it really integrated into the experience.

    With this plugin video becomes as accessible and integrated into unity as your other image and audio files. You can access each frame from your own shaders and you can locate each audio channel on your 3D environment (very important in virtual reality)

    As you can guess it is based on libVLC engine, so it is able to play whatever you play using your VLC (including youtube and vimeo if you can get the video url).

    It works for windows standalone (32 and 64 bits), android, ios and inside the editor, which I find very useful and it was one of my requirements when I started this development.

    It also includes my other popular asset easy threading: https://forum.unity3d.com/threads/20usd-easy-threading-multi-threading-made-easy.262860/ and the custom build system I use in my developments and that allows to deploy and execute all builds with one click (a must have)

    I know it is an expensive asset, but trust me, I've tried many other video playback solutions and this is the one you need. And I assure you that developing it by yourself will be much more expensive.

    I didn't include the scripts and shaders for stereoscopic and surround (360/180 degree videos) videos but if there is enough demand I will add them (they are quite straightforward to implement, to be honest).

    Some video of the plugin working:
     
    Last edited: Jan 14, 2017
  2. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Asset is live!
     
  3. LukasO

    LukasO

    Joined:
    May 23, 2013
    Posts:
    115
    What's the performance like compared to Unity's build in video player?
     
  4. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Hi Lukas,

    I didn't make a direct comparison, since they are two different animals, VLC is much more complete solution than the one unity provides. UVLC uses the native version of VLC for each platform, so u can expect its perfomance to be similar to the VLC application.

    But I think your request makes sense, so, what kind of comparison would you like? I post the results as soon as possible.
     
  5. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    Linux supported?
     
  6. MarkNeville

    MarkNeville

    Joined:
    Feb 18, 2015
    Posts:
    5
    Just purchased it but it appears that it doesn't work for UWP 10 (Windows Store). Please help!
     
  7. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Hi Play_Edu:
    No, linux is not supported.

    Hi FinVR:
    I think we are already talking over email, right? I will try to get it to work (as said on the description I only tested it for android and 32/64 bits standalone)
     
  8. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    Hi thanks for replay.
     
  9. salanc

    salanc

    Joined:
    May 23, 2014
    Posts:
    2
    It will crash in 32/64 bits standalone.(unity version 5.5.0f3) please check it.
     
  10. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    @salanc, can you give more details? it works fine for me
     
  11. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    @salanc, try downloading the latest version (it was approved yesterday)
     
  12. norbertots

    norbertots

    Joined:
    Jul 4, 2014
    Posts:
    15
    Hi Arklay ..please include 3d stereo panorama 360 video demos to Google CardBoard and Samsung GearVR and i will buy..
     
  13. salanc

    salanc

    Joined:
    May 23, 2014
    Posts:
    2
    I download the last version.It can work. thanks.
     
  14. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    @salanc , great, let me know if u need some help

    @norbertots i've just uploaded a new version to the store, I will update the post as soon as it gets approved until them you can download a binary demo of the 360 and stereoscopic implementation here: https://dl.dropboxusercontent.com/u/4342611/UVlc-1.0-x64.zip

    The 360 implementation is just a custom shader, so it is quite straightforward. For the stereoscopic 3d there are to main tasks:
    - use the uv coordinates to show the left or the right half of the frame
    - use layers to show one raw image or the other depending on the eye camera
     
  15. artefacto-sas

    artefacto-sas

    Joined:
    Mar 13, 2014
    Posts:
    11
    Hi,
    Just purchased it but it appears that it doesn't work for Android.

    Logcat :
    Code (CSharp):
    1. Unable to lookup library path for 'libvlc', native render plugin support disabled.
    2. Unable to find libvlc
    3. DllNotFoundException: libvlc
    4.   at (wrapper managed-to-native) U3D.VlcUnity.libvlc:libvlc_media_player_new (intptr)
    5.   at U3D.VlcUnity.VlcPlayer.CreateVlcPlayer () [0x000a9] in D:\Projects\RD\uVLC\Assets\Arklay\U3D\VlcUnity\Implementation\VlcPlayer_Setup_Cleanup.cs:44
    6.   at U3D.VlcUnity.VlcPlayer.OnEnable () [0x00002] in D:\Projects\RD\uVLC\Assets\Arklay\U3D\VlcUnity\VlcPlayer.cs:27
    7.  
    8. (Filename: D Line: 0)
    PC used for compilation : Windows 7Pro 64bits
    Unity 5.5.0 p3

    Reproduced with empty projet using only this plugin and the launch scene : Example. Builded with your Build System tool.
     
  16. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Yeah artefactodev, sorry about that, there is a bug in the version you are using (I just uploaded a fix, its under review right now)

    To fix it, please change the DllImport("libvlc") to DllImport("vlc") that should fix it.

    Again, sorry about that
     
  17. artefacto-sas

    artefacto-sas

    Joined:
    Mar 13, 2014
    Posts:
    11
    Thank you ArkLay.

    With this fix, streamed video play correctly on Android. But, how can we play video from streamingAssets folder on this platform ?
     
  18. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Hi, for standalone an ios it's very easy, but for android the movie will be compressed into the jar file, so first you would have to uncompress it and store it somewhere (external storage probably).

    Example code (quick and dirty):
    Code (CSharp):
    1.  
    2. public class SetMovie : MonoBehaviourBase
    3. {
    4.     [System.Diagnostics.Conditional("DEBUG_SetMovie")]
    5.     void Log(string fmt, params object[] pars)
    6.     {
    7.         // Do not add the name of the funtion to avoid problems with multithreading
    8.         Debug.LogFormat(GetType() + " - " + fmt, pars);
    9.     }
    10.  
    11.     public VlcPlayer player;
    12.     public void SetLocalMovie()
    13.     {
    14.         StartCoroutine(SetLocalMovieCO());
    15.     }
    16.     IEnumerator SetLocalMovieCO()
    17.     {
    18.         string path;
    19. #if !UNITY_EDITOR && UNITY_ANDROID
    20.         string compressedPath = "jar:file://" + Application.dataPath + "!/assets/GHOST_IN_THE_SHELL.m4v";
    21.         path = Application.persistentDataPath + "/temp" + Path.GetExtension(compressedPath);
    22.         if (File.Exists(path))
    23.             File.Delete(path);
    24.         WWW www = new WWW(compressedPath);
    25.         yield return www;
    26.         File.WriteAllBytes(path, www.bytes);
    27.         path = "file://" + path;
    28. #else
    29.         path = "file:///" + Application.streamingAssetsPath + "/GHOST_IN_THE_SHELL.m4v";
    30.         yield return null;
    31. #endif
    32.         Log("local movie path: " + path);
    33.  
    34.         player.movieUrl = path;
    35.         player.gameObject.SetActive(true);
    36.     }
    37. }
    38.  
    Unity's documentation about streaming assets: https://docs.unity3d.com/Manual/StreamingAssets.html
     
  19. artefacto-sas

    artefacto-sas

    Joined:
    Mar 13, 2014
    Posts:
    11
    Thank you : it works !

    But, 4K videos are not smooth on Galaxy S7. It's lagging a lot... Did I forget something?
     
  20. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    It depends not only on the resolution but also on the codec, android will struggle with heavy 4k codecs... also check how the official vlc does with the same video, this asset will not be as good as vlc (android still has to run all the unity frameworks at the same time as it does the video decoding) but it should give you an idea about which videos you should be able to play
     
  21. artefacto-sas

    artefacto-sas

    Joined:
    Mar 13, 2014
    Posts:
    11
    Hi,

    I've tried the same video file with the official VLC app and the video is playing really smoothly.
    Hardware accelaration is used with your plugin?

    For information, here, the video codec info :
    Code (CSharp):
    1. Format                                   : MPEG-4
    2. Format profile                           : Base Media / Version 2
    3. Codec ID                                 : mp42
    4. File size                                : 73.7 MiB
    5. Duration                                 : 30s 614ms
    6. Overall bit rate mode                    : Variable
    7. Overall bit rate                         : 20.2 Mbps
    8. Encoded date                             : UTC 2017-01-13 16:01:55
    9. Tagged date                              : UTC 2017-01-13 16:01:55
    10. Writing application                      : HandBrake 0.10.3 2016012200
    11.  
    12. Video
    13. ID                                       : 1
    14. Format                                   : AVC
    15. Format/Info                              : Advanced Video Codec
    16. Format profile                           : Main@L4.0
    17. Format settings, CABAC                   : Yes
    18. Format settings, ReFrames                : 1 frame
    19. Codec ID                                 : avc1
    20. Codec ID/Info                            : Advanced Video Coding
    21. Duration                                 : 30s 560ms
    22. Bit rate                                 : 20.0 Mbps
    23. Width                                    : 3 840 pixels
    24. Height                                   : 1 920 pixels
    25. Display aspect ratio                     : 2.000
    26. Frame rate mode                          : Constant
    27. Frame rate                               : 25.000 fps
    28. Color space                              : YUV
    29. Chroma subsampling                       : 4:2:0
    30. Bit depth                                : 8 bits
    31. Scan type                                : Progressive
    32. Bits/(Pixel*Frame)                       : 0.109
    33. Stream size                              : 73.0 MiB (99%)
    34. Writing library                          : x264 core 142 r2479 dd79a61
    35. Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=24 / lookahead_threads=8 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=1 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=2pass / mbtree=1 / bitrate=20000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=20000 / vbv_bufsize=25000 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
    36. Encoded date                             : UTC 2017-01-13 16:01:55
    37. Tagged date                              : UTC 2017-01-13 16:01:55
    38. Color primaries                          : BT.709
    39. Transfer characteristics                 : BT.709
    40. Matrix coefficients                      : BT.709
     
    Last edited: Jan 23, 2017
  22. mwaller_RM

    mwaller_RM

    Joined:
    Jul 1, 2014
    Posts:
    7
    Hi, We have tried another VLC plugin in the past and it crashes when used with another plugin in our app. How can i get an example to add to a unity project for a test. I cant make sure the crash doesn't happen with the exe example.
     
  23. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
  24. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    @artefactodev I just pushed a new version (2.6) of the asset, is currently under review. There are a few bug fixes and initial UWP support (still WIP)

    I also added the options that seems to enable hardware decoding on android, please give it a try once unity approves the update, if it still doesnt work send me a private message, and we will look further into it (maybe you can provide the movie for me to test it?)
     
  25. Stumpyt76

    Stumpyt76

    Joined:
    Feb 5, 2017
    Posts:
    1
    I am doing a local stream with 'tcp/h264://xxx.xxx.xxx.xxx:5030/' address, plays on VLC. Will it play on your package?
     
  26. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Hi @Stumpyt76 it should work, maybe the media creation call should be tweaked... if you have some similar stream accessible over the internet I can give it a try and tell you for sure (contact me on private if you don't want to share it).
     
  27. L0ri3n

    L0ri3n

    Joined:
    Aug 1, 2015
    Posts:
    6
    This looks like a fantastic asset! Thanks for your hard work on it and for making it available to everyone.

    The description indicates support for Windows, iOS and Android. So I'm assuming it doesn't support Mac OSX at this stage. Any timeline for OSX support since our app needs to run on this platform too?
     
  28. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Hi @L0ri3n
    Sorry, for now there are no plans for including OSX, there is not much audience there since this asset is used mostly in VR implementations
     
  29. L0ri3n

    L0ri3n

    Joined:
    Aug 1, 2015
    Posts:
    6
    Thanks for your quick reply. It is really helpful. Our main interest is VR but our application needs to also work on non-VR devices too (Windows, OSX and preferably Linux sooner or later). Hence the interest in these other platforms. However, I respect that your time and resources and limited and so you need to prioritise where you see fit. I'd like to vote for OSX support at some stage though for non-VR applications! :)
     
    arklay_corp likes this.
  30. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    I will keep it in mind @L0ri3n
     
  31. halleywang

    halleywang

    Joined:
    Mar 2, 2017
    Posts:
    14
    Hi, I want to use VLC to open sdp file in Universal Windows Platform (Windows Store), which can allow me to receive RTP/H.264 on my UWP app.

    Does this package work?

    Thanks :)
     
    Last edited: Mar 2, 2017
  32. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Hi @halleywang ,

    Yeah, it should work, if you have problems just let me know here
     
  33. halleywang

    halleywang

    Joined:
    Mar 2, 2017
    Posts:
    14
    Thanks for the reply.

    But I just saw that someone reported that it can't build in UWP10 on the top (MarkNeville).

    Is this true?
     
  34. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    yes, @halleywang but i made some modifications on the latest version to support it (the main problem was the Threads) and it should work now.

    maybe @MarkNeville can confirm this...
     
  35. halleywang

    halleywang

    Joined:
    Mar 2, 2017
    Posts:
    14
    Thanks for the reply. Sorry about the impolite question...because I just bought another plugins and have this problem.
    I will think it through :)
     
  36. halleywang

    halleywang

    Joined:
    Mar 2, 2017
    Posts:
    14
    I just bought this package, and set the movie url as "file:///Assets/xxx.sdp"

    I check the server before, it can correctly show the video in VLC.exe.

    But it didn't show any frame in unity

    Do I miss some settings?

    Unity: 5.5.0f3
    PC: Win10 64

    By the way, it can be built in Windows Store correctly !!
     
    Last edited: Mar 12, 2017
  37. halleywang

    halleywang

    Joined:
    Mar 2, 2017
    Posts:
    14
    Hi, I finally can open my sdp file with file path: "file:///Assets/xxx.sdp" in my windows standalone !!

    But when I build on the UWP, it still doesn't work.

    I think this may because the file path.

    I cannot show the mp4 file in this app, too. That's why I think is because of file path.
     
  38. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    @halleywang don't worry, acttually it didnt feel impolite for me. And if you buy any of my plugins and it end up not working for you just ask me for a refund, if the plugin is of no use for you I will grant it

    About your problem. try to use streaming assets folder and load it using:
    "file:///" + Application.streamingAssetsPath + "/xxx.sdp";

    Maybe UWP compresses the executable? (like android does, check the example script SetMovie.cs)

    What kind of errors are you getting?
     
  39. wesloc

    wesloc

    Joined:
    Feb 4, 2017
    Posts:
    14
    Hi @arklay_corp.
    The asset looks very interesting.
    Since I never used VLC library before, I am wondering about its performance for 4K video decoding..

    Regarding the video decoding in VLC, is it hardware accelerated when I run it on Windows with a high end nvidia card, eg, GTX 1070?
     
  40. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Hi,
    Yes, the decoding is hardware accelerated on desktop and mobile.
    About 4k perfomance, in desktop runs smoothly, in mobile, for low end devices you will have to modify the example to copy the pixel buffer directly and avoid intermediate steps.
     
  41. nkAleks

    nkAleks

    Joined:
    Oct 17, 2016
    Posts:
    1
    Hey,
    Wanted to check out the demo, but all the dropbox links appear to be dead...
     
  42. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
  43. mwaller_RM

    mwaller_RM

    Joined:
    Jul 1, 2014
    Posts:
    7
    I was wondering if you could tell me if you use “UnityRenderEvent” calls in your plug in. Those calls conflict and cause a crash with our other plugins as you can see from the example below.

    ========== OUTPUTING STACK TRACE ==================

    0x00007FF911493068 (OtherPlugIn) UnityRenderEvent
    0x00000001410AB55B (Unity) PluginsRenderMarker
    0x0000000140E95511 (Unity) GfxDeviceWorker::RunCommand
    0x0000000140E99FAF (Unity) GfxDeviceWorker::Run
    0x0000000140E7A1B0 (Unity) GfxDeviceWorker::RunGfxDeviceWorker
    0x00000001415985DC (Unity) Thread::RunThreadWrapper
    0x00007FF928608364 (KERNEL32) BaseThreadInitThunk
    0x00007FF9287470D1 (ntdll) RtlUserThreadStart

    ========== END OF STACKTRACE ===========
     
  44. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    hi, sorry for the delay, i wasnt notified about this question... we share the whole source code so you can rename it if you find conflicts
     
  45. mwaller_RM

    mwaller_RM

    Joined:
    Jul 1, 2014
    Posts:
    7
    Hi @arklay_corp

    Its not a conflict in naming its just that call currently "UnityRenderEvent" i was just curious if you use the same low level call in your plug in to communicate with the lower level code.
     
  46. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Hi,

    UVlc doesnt use native low level rendering from the plugin (not in the plugin even tho if you want good 4K support for mobile devices it should be implemented using it)
     
  47. mwaller_RM

    mwaller_RM

    Joined:
    Jul 1, 2014
    Posts:
    7
    Hi @arklay_corp

    One last question for you, If i supplied a couple streaming urls would you be willing to tell me if they work with your plugin. we have a couple formats we stream (only on windows) and i need to know if they work or not.
     
  48. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    sure, send me a PM
     
  49. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    I just double checked and there is no problem on finding the dll. Please download a free copy of the asset into an empty project and use the custom build pipeline to be sure the dll is being copied

    Once you build inside the data/plugins folder you should have a copy of libvlc.dll
     
  50. pan-master

    pan-master

    Joined:
    Nov 11, 2013
    Posts:
    127
    OK thx It worked, I copied all Dlls from your demo scene as you said from custom build