Coder Social home page Coder Social logo

unityvlcplayer's Introduction

libvlc player for Unity

Minimalistic libvlc player to be used inside Unity. (Mainly for playing rtmp/rtsp streams)

Note that the wrapper is partial and doesn't include options that assets in the Asset store or https://code.videolan.org/videolan/vlc-unity/ offers.

Requirements

-Unity 2021.3.17f1+ (might work with other ones, just not tested with)

-Win64 build target

-libvlc 3.0.19 (win64) (again, might work with other ones)

Getting Started

  1. Clone

  2. Download or build libvlc (https://artifacts.videolan.org/vlc/release-win64/) and copy the contents into 'Assets/Plugins/x86_64/VLC/'

    The hierarchy of the 'Assets/Plugins/x86_64/VLC/' -folder should look like this:

     */hrtfs
    
     */locale
    
     */lua
    
     */plugins
    
     */sdk
    
     */skins
    
     *axvlx.dll
    
     *libvlc.dll
    
     *libvlccore.dll
    

Note! It is important to keep the libvlc's root folder named 'VLC' as in the cloned project.

  1. Open Scenes/SampleScene or drop a VLCPlayerMono.cs to a gameobject and set a target RawImage.

Press play. (some url's will take a while to load before playing; i.e. rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov)

VLC Player Mono

Monobehaviour component that plays a video and outputs the texture to a RawImage

Raw Image

Render target

Url

URL of the playable video/stream (eg. rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov)

Width / Height

Width and height of the video to be played, configures the internal VLC-libraries to use these dimensions. Can be left to 0 to automatically detect the dimensions and use them instead.

Autoscale RawImage

Automatically scales the target rawimage to the aspect ratio of the video. (Currently only tweaks the height to match the aspect ratio)

Acknowledgments

unityvlcplayer's People

Contributors

bosqmode avatar joelpesu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unityvlcplayer's Issues

unity vlcplayer for android

hi i'm trying to develop an android rtsp video player on unity, and i'm using your repository to develop. I managed to make it work on windows, while if I try to switch platforms on android and compile it gives me several errors. Can you give me directions on how to compile for android? I suppose that it is necessary to copy an android version in the Plugins folder as is done for Windows, I have made some attempts but they have not gone well. I hope you can help me, thanks

EntryPointNotFoundException: libvlc_media_tracks_get

Just wonder if anyone else had the same error?

I am using 2019.4.11, and have tested my rtsp link on a pc version vlc player to ensure if its working.

EntryPointNotFoundException: libvlc_media_tracks_get
bosqmode.libvlc.VLCPlayer.GetVideoTrack () (at Assets/UnityVLCPlayer/VLCPlayer.cs:168)
bosqmode.libvlc.VLCPlayer.TrackReaderThread () (at Assets/UnityVLCPlayer/VLCPlayer.cs:111)
System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at :0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at :0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at :0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at :0)
System.Threading.ThreadHelper.ThreadStart () (at :0)
UnityEngine.<>c:b__0_0(Object, UnhandledExceptionEventArgs)
bosqmode.libvlc.LibVLCWrapper:libvlc_media_tracks_get(IntPtr, IntPtr&)
bosqmode.libvlc.VLCPlayer:GetVideoTrack() (at Assets/UnityVLCPlayer/VLCPlayer.cs:168)
bosqmode.libvlc.VLCPlayer:TrackReaderThread() (at Assets/UnityVLCPlayer/VLCPlayer.cs:111)
System.Threading.ThreadHelper:ThreadStart()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.