Search Unity

[RELEASED] VLC Player for Unity (New: Youtube Streaming!)

Discussion in 'Assets and Asset Store' started by chassets, Feb 21, 2016.

  1. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    UPDATE: This plugin is no longer availabe and not in development anymore.

    Hi Guys!

    Since using Unity, I was never satisfied with movie textures for intro videos and cutscenes in our projects. ogv doesn't seem like the best format for the job, and with 1080p videos and higher bitrate we always had stuttering - even on highend systems. Other times the audio wouldn't match up exactly.

    I've tried the plugins that are available, but wasn't satisfied either, often only one format is supported and higher resolutions and bitrates result in jaggy videos even on good PCs - and they are all quite expensive.

    I wanted to have super smooth, high-bitrate 2k / 4k video cutscenes, like when playing in VLC media player. And I did not want to convert our videos or place them in a specific location. Thats why I had to create a VLC Player for Unity plugin.




    New Features in 1.03:
    • Youtube Streaming: Just use the url
    • Pin to UI or Window, so you can move the videos around or resize them
    • Dynamic Aspect Ratio Handling when resizing videos
    • Support for all VLC versions
    New Features in 1.02:
    • Video in Background: Render Video underneath UI and 3D objects
    • Performance improvements on video start

    Features:
    • Play intros and cutscenes super smoothly - every codec / format that VLC Supports
    • Streaming (RTSP etc, but everything that VLC can stream should work)
    • 4K Video resolution is no problem, since it plays via VLC on the GPU
    • VLC Playback gets rendered above your Unity game in your OS monitor resolution, (so even if you have to lower the games' resolution for performance reasons, the cutscenes will always be shown in the best resolution, which is great ;-) ).
    • Stream Video to Texture2D (Beta)
    • You can either use a special vlc core version that's embedded in you build - the user must not have vlc installed to play videos
    • ...or you can use an installed version of vlc on the machine, so your build is smaller since no vlc is included.
    • Likewise with videos: you can either embed them into your build, or play them from any location
    • Render videos over Gui-Panels, so it's easy to position videos that shouldn't be fullscreen
    • 2 Fullscreen video modes: Complete Mode over Monitor or just over Unity window (when running in windowed mode)
    • Multi-Monitor Support
    • Window-Mode Support
    • Video Controls: Play / Pause / Stop and navigate in video timeline

    Working on / Todo:
    • Capture Gameplay directly to Video

    Current Limitations:
    • Only works on windows machines at the moment, other OS version support might come later
    Thanks and have a great day,
     
    Last edited: Jan 18, 2021
  2. sashahush

    sashahush

    Joined:
    Sep 5, 2012
    Posts:
    75
    Definitely interested in this! Keep up the work, would be glad to test this!
     
    JamesArndt likes this.
  3. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Subscribed for updates :)
     
  4. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    I made some good progress on multi monitor support, and I'm soon able to do a main menu background video with unity elements and gui rendered atop ( just like in fallout 4s main menu). :D

    Stay tuned!
     
    Last edited: Dec 8, 2017
  5. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    To illustrate what I meant, here's a screenshot of the background video for menus activated (there's the star wars 7 trailer looping for testing purposes ;) )



    Gui or 3D will get rendered over the video and you can klick the buttons or interact with the 3d cube. The background video is a 1080 mkv with a very high bitrate and it's super fluent through VLC.

    I'm pretty happy right now, please excuse the super crappy looking demo-interface and debug cube for the time being :)
     
    Last edited: Nov 14, 2017
    theANMATOR2b and John-G like this.
  6. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Ok, so finally here's a demo version ;). Still has a few little things that I need to change, but on the computers I tested it, it worked fine.

    Heres the link (windows standalone): http://we.tl/jj9Ft4AQiQ (500mb though because of the demo video files, 1080p mp4, mkv and divx files are included)

    Looking forward to your feedback!
    (Please also tell me what Windows Version you use for testing.)

    Thanks and have a great day,
    holzay
     
  7. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    You´re right - Unitys video implementation is very poor, the plugins are not very good but expensive.
    So I really appreaciate your approach!

    Tested the windows standalone demo and everything works like a charm. Fantastic.

    Do you plan to implement video as Texture2D?
     
    Last edited: Mar 15, 2016
  8. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Thanks for testing! Glad everything works.

    Video as Texture2D might be possible - I'll have to research in this direction.
    But at first, I want to focus on fullscreen video and video on Gui-Panels like in the demo, since this is what most people I talked to need for their cutscenes.

    PS: which version of windows did you use (7,8,10?) Thanks.
     
  9. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    looks promising. Any chance of early testing release?
     
  10. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Windows 8.1 pro
     
  11. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    I'll try to release the plugin asap with the current features when everything is working a 100%, since this should be what 90% of people need.
    New features like playlists etc. will come as updates. In the meantime, feel free to test the demo (link at the top) and let me know what you think. Thanks!

    Thanks =)
     
    John-G likes this.
  12. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Texture2D is possible...I did it in my asset, in my case I just render the texture to an editor window.

    *skip to 1:15 - shows VLC playing to a texture
     
  13. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    yes, thanks @bocs. I looked up a few things regarding this, and I think I'll bring video on textures as the first update to the package once it's released.
     
  14. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Cool! How much will it cost once finished? Could really use it once it supports OSX and Linux.

    //edit: One thing: How hard would it be to make certain colors transparent so e.g. you could mix liveaction with real time rendered game using things like greenscreen?
     
  15. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    demo was very big to even test pls upload a video showing how it will look in pc
     
  16. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Haven't decided yet. As for keying out of videos: I guess if its a rendered texture2d on a plane for example, it shouldnt be too hard to create a shader to do that. But thats also something I'd have to look into.

    Thats kind of intentional, because I wanted to show that you can play big, high bitrate HD videos of any codec in contrast to Unitys Movietextures. But I can create a smaller demo with just 1 sample video.
     
  17. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    while playing the video in the game will player see any new window pop up showing the hd video or it will be seems less which happen every thing in background and player see video playing in the game it self
     
  18. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Sorry for the late reply! No, there won't be a popup of a regular vlc window. The video just shows fullscreen, or on top of UI elements Here is a smaller demo with just 1 video that you can try: http://we.tl/cyDQfptMl5

    Hope that helps :)
     
  19. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Hi!

    I finished writing the documentation and submitted to the asset store. Hopefully it will be up there soon.

    Have a great day,
    holzay
     
    John-G and wolfen231 like this.
  20. wmaass88

    wmaass88

    Joined:
    Dec 23, 2012
    Posts:
    45
    Awesome, looking forward to trying it.
     
  21. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Thanks!

    I made a quick screengrab, you can check out how the plugin works in Editor and Builds and how to create basic Playback
     
  22. wmaass88

    wmaass88

    Joined:
    Dec 23, 2012
    Posts:
    45
    Nice. VLC can play Youtube videos quite well, do you have plans for supporting playback from a URL?
     
  23. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    I just looked into it, and yes, I think it'll work in 1.1.
     
    zyzyx likes this.
  24. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Hi guys!

    Good news, the package is now live in the Asset Store, here's the link. I'm currently working on the first update, which will bring a couple of improvements.

    Here's the link: http://u3d.as/qex

    Thanks and have a nice day!
     
    darkeyes and wolfen231 like this.
  25. darkeyes

    darkeyes

    Joined:
    Oct 21, 2011
    Posts:
    54
    Excellent work holzay! :)
    How likely is an OSX version? (Eg is it something you are working on or just thinking about at this stage?) I'd really need it working on both Win and OSX before buying a copy.
     
  26. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Thanks!

    I'm thinking about it and have not yet started. For the plugin to work, I need a couple of calls to win32 dlls, but I guess that there is an equivalent to these on OSX - this is something I want to look into. So if I can find a way to do that it should work, since there probably isnt a huge difference between VLC on OSX and Windows.

    I'll keep you updated on any Progress I make in this regard!
     
    darkeyes likes this.
  27. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    What are the legalities of using VLC? I understand it cannot be resold.
     
  28. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Well of course I am not selling VLC, just a Unity plugin that handles everything in Unity and works if you have VLC installed or placed in a folder your build.
     
  29. wmaass88

    wmaass88

    Joined:
    Dec 23, 2012
    Posts:
    45
    Purchased! Looks good so far and looking forward to future updates. This is a very handy asset.
     
  30. wmaass88

    wmaass88

    Joined:
    Dec 23, 2012
    Posts:
    45
    holzay,

    A nice addition at least for me would be the ability to play the video in the background so that objects and GUI elements can appear on top of the video. For example if I wanted to make my own player control menu.
     
  31. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Thanks wmaass88, glad you like it.
    I had this Feature in, as you can see in the screenshot a bit above in this thread. But it was a little bit too buggy to release in the first Version. I'll see what I can do.

    In the meantime, I made a couple of adjustments at video start to make sure it never flickers when you start a Video - I had this Problem on an older laptop of mine with bigger videos.
     
  32. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Hi! Here is a demo for the upcoming video in background feature that you can check out: https://we.tl/HCx6V41u9h

    Tested in on 2 PCs, should work as expected. Let me know if anything is wrong. Thanks!
     
  33. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    FYI, Almost finished with the first update, should be live soon!
     
    zyzyx likes this.
  34. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Subscribed for updates !!
     
  35. Clodo

    Clodo

    Joined:
    Dec 27, 2013
    Posts:
    40
    The current Asset Store edition will work on Canvas panel in World Space Render Mode? Or exists a alpha version i can test? I want to use this on VR. I can test a build with HTC Vive and Oculus Rift. Thanks.
     
  36. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Currently, it will only work in Screen Space Overlay. When I manage to get the video working as a Texture2D, World Space UI or on any Mesh will be possible.
     
  37. DashW

    DashW

    Joined:
    Jun 14, 2013
    Posts:
    4
    Hi @holzay , sorry this is such a late response compared to your original post, but I'd be really interested to get a quote from you regarding how much it might cost to add Android support to this plugin. I've been wrestling with compiling VLC to Android for weeks, let alone integrating it into Unity, and I've reached the end of my rope. If you're interested, PM me!
     
  38. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Honestly, I have no mobile support planned at the moment, since they can play videos smoothly with Handheld.PlayFullscreenMovie(), which was always good enough for us - in contrast to ogv movies in Unity Standalone. Also I never needed to play 4K on mobiles ;-) So I don't really know for how many people this might be worth using / purchasing.

    Have a nice evening,
    holzay

    PS: Thanks a lot to everyone who purchased the plugin, I hope it makes your life a bit easier with video playback in Unity.
     
  39. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Hi everyone!

    Version 1.02 is out:

    New Features:
    • Video in Background: Render Video underneath UI and 3D objects
    • Performance improvements on video start
    There is a demo Scene for the Video in Background feature that you can check out (this effect works only in builds at the moment).
     
  40. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    I forgot to mention that streaming is now also possible (everything that VLC can stream should work, RTSP etc.) Just put the URL into the Video Path.

    I'm also trying to enable YouTube streaming, I'll keep you updated on this.
     
    zyzyx likes this.
  41. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Ok, basically Youtube streaming is working perfectly, but you need to use a recent VLC Player, either installed or shipped in your build (v 2.2.1).

    I will integrate this feature in the next Version(s) :) Hope that's a handy feature for some of you!
     
  42. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Great work!
    Quick question: How does VLC Player for Unity compare to this asset? Since neither asset offers a demo version it is hard to judge by description alone.
     
  43. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Hi! Well, there's a demo download link at the top of my asset store page ;) Although this is still Version 1.0, I should replace it with a newer one.

    With my solution, you can use everything VLC can do (depending on the Version you integrate), like the upcoming YouTube Streaming, you can use the QT-Interface of VLC if you want or need Access to the VLC-UI and features. I guess when using just the libvlc.dll, you can't do all of that - since some stuff is in lua files (YT for example) or in other places that come with VLC.

    But the main reason I chose this approach was the following: I couldn't play a 4K video smooth enough using libvlc.dll alone, the performance was just better when using VLC in my way - at least in my tests here.

    If you compare the 2 YouTube videos of the assets, the playback in the other asset you mentioned doesn't seem as fluid as dragging around the windows in his OS (or the Playback in my demo video), so maybe this is the same case as in my tests. 100% smooth playback of any video, even 100mbit 4K vids was my target.

    Another reason might be that you can change the sourcecode in my solution if you want to do something different.

    So I suppose these are the differences as far as I can see.

    PS: Also people tell me that they are happy with response times and support ;-)
     
  44. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Sounds great, thanks!

    While playing a video in the GUI is it possible to drag and scale like any other GUI element?
     
  45. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Yes it is (in the next Version 1.03, soon to be released). It also automatically handles aspect, so you can't strech/squatch the video (stretching also happens in the demo video of the other asset you showed me).

    I'll upload a quick vid showcasing this feature and youtube playback after work, when I get home.
    Hope this helps.
     
    zyzyx likes this.
  46. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    More complicated than that. Could do with someone well-versed in GPL v2 issues to explain the complex reality.
     
  47. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310


    as promised, a demo of the newest features. I think you can see the ease of use and the good Quality of the YT playback pretty well, everything is super smooth.

    Pretty satisfied with the result, this should be live in a couple of days =)

    Hope this is something thats useful to you guys.
    Have a nice evening! Regards,
    holzay
     
    Last edited: Apr 21, 2016
    zyzyx likes this.
  48. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    A customer has made me aware that there are no Audio controls (vol up, down, mute..) at the moment - I'll integrate this also in the upcoming 1.03 release.
     
  49. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Hi! how is progress going?
    Are there some kind of playlist/repeat/shuffle/seek features on your roadmap?
     
  50. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    310
    Hi! Sadly a bit slower as I want it to. And I had to fix a small thing in the 1.03 Version and have to submit again, so please excuse the delay.

    I certainly want to support playlists and Shuffle etc, I'm thinking about the ability to just put a Folder path into the script, which then will play all media inside as a Playlist and simple checkboxes for random shuffle.

    I quickly looked into it, and it should not be to hard to accomplish. So I guess I can integrate it in 1.04.

    Hope this helps,
    Have a great day!

    holzay
     
    Last edited: Dec 8, 2017
    zyzyx likes this.