vlcj - Overview



The vlcj is an Open Source project which helps to run VLC player within a Java baed application. It provides option to discover the VLC player installed in the sytem and bind it to build a media player client and server software using Java.

Using Java, you can simply play a local media files and even you can create a video on demand streaming server.

Usage

vlcj is a quite popular java based library, and it is in used in various java based softwares like oceanographic research vessels and bespoke IPTV and home cinema solutions. Some of the renowned examples are Open Source video camera at Elphel and video mapping for the Open Street Map project.

Syntax

Create a EmbeddedMediaPlayerComponent Component

EmbeddedMediaPlayerComponent mediaPlayerComponent = new EmbeddedMediaPlayerComponent();	

Play the video

Playing a video is very easy. Pass the path of the file and it will play the video.

//pass path to media file
mediaPlayerComponent.mediaPlayer().media().play(path);    

VLC Player

VLC Media Player is a very popular media player and is available for Linux, MacOS and Windows. It comes bundled with tons of codecs to play any kind of media without any need to install external media codec. It also supports video streaming across networks and allows transcoding of media. Using VLC media player we can play local media files, local network streams, internet based video streams, DVD, Bluray, webcam, digital video and lots more.

VLC Media player is compiled into native platform code and cannot be used by Java programs directly. To overcome this problem, VLC Media Player provides a native API(Application Programming Interface) called LibVLC and is a part of VLC Media Player. vlcj then provides the java layer needed to interact with VLC Media Player using LibVLC.

vlcj Features

vlcj is a mature libary. It provides following features which are essential while working with VLC media player.

  • Java Bindings − vlcj provides Java binding to all native operations of VLC Media Player so that we can program a Media Player functionality using Java programming.

  • Framework − vlcj acts as a framework encapsulating any platform specific behaavior and native code handling by providing a simple high level programming interface for LibVLC.

  • Robust − vlcj ensure the correct usage of LibVLC APIs. As incorrect use may lead to crash or deadlocks.

  • Handles Asynchronous native events − vlcj registers callbacks for asynchronous native events which then can be handled in java listener pattern easily. This programming model helps in preventing deadlocks.

vlcj Applications

Following are few examples where vlcj can be used.

  • Java Based − Being java based, we can create media player within swing, awt, swt, javafx and openGL programs.

  • IDE − Eclipse/NetBeans based Rich Client Platform Applications can use vlcj for media based applications.

  • Internet Radio Player − Using vlcj, we can create a audio player which can stream internet based radios.

  • YouTube Player − Using vlcj, we can create a YouTube player which can stream YouTube videos.

  • Transcoder − Using vlcj, we can transcode any videos.

  • Network streaming server − Using vlcj, we can create a video on demand server.

  • Network streaming client − Using vlcj, we can create a video on demand client.

  • Video Playing Applet − Using vlcj, we can create an applet which can play a video.

  • WebCam − Using vlcj, we can create webcam application.

  • CCTV Camera − Using vlcj, we can create CCTV camera application playing videos recorded by CCTV cameras.

License

vlcj is distributable under GPL licence terms. In case of commercial usage without conditions of GPL license then contact the team at Caprica Software Limited.

Advertisements