Difference between revisions of "LibVLC"

From VideoLAN Wiki
Jump to navigation Jump to search
 
(34 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{{Lowercase}}
 
{{Lowercase}}
The [[libVLC]] (VLC SDK) media framework can be embedded into an application to get multimedia capabilities.
+
The '''libVLC''' (VLC {{SDK}}) media framework can be embedded into an application to get multimedia capabilities.
  
Since VLC is based on [[libVLC]], one should be able to have the same features that {{VLC}} has.
+
'''libVLC''' is a cross-platform audio and video API that provides a comprehensive multimedia API that can be used across mobile, server and desktop to render video and output audio as well as encode and stream.
 +
 
 +
Since VLC is based on libVLC, one should be able to have the same features that {{VLC}} has.
  
 
The libVLC media framework is already used by several applications; see [[LibVLC_Users|who uses libVLC?]]
 
The libVLC media framework is already used by several applications; see [[LibVLC_Users|who uses libVLC?]]
 +
 +
== Features ==
 +
 +
libVLC notably can:
 +
* Play every media file formats, every codec and every streaming protocols ''(RTSP, RTMP, Multicast, HLS/Dash/HDS, etc..)''
 +
* Run on every platform, from desktop ''(Windows, Linux, Mac)'' to mobile ''(Android, iOS)'' and TVs ''(AppleTV, Android TV, Tizen)'' and Consoles ''(PS4/5, Xbox)''
 +
* Hardware and efficient decoding on every platform, up to 8K
 +
* Network browsing for distant filesystems ''(SMB, FTP, SFTP, NFS...)'' and servers ''(UPnP, DLNA)''
 +
* Playback of Audio CD, DVD and Bluray with menu navigation
 +
* Support for 8K and HDR, including tonemapping for SDR streams
 +
* Audio passthrough with SPDIF and HDMI, including for Audio HD codecs, like DD+, TrueHD or DTS-HD
 +
* Support for complex video and audio filters
 +
* Support for 360/VR video and 3D audio playback, including Ambisonics
 +
* Able to cast and stream to distant renderers, like Chromecast and UPnP renderers.
 +
 +
== libVLC, license and proprietary applications ==
 +
 +
Since libVLC is licensed under LGPLv2, one can do applications based on libVLC which are not licensed under the GPL ''(different open source licenses, or non-open source applications)''. One must comply with the LGPL terms, for libVLCcore, VLC plugins and libVLC.
 +
 +
What it means, in layman's terms, is that you can use libVLC in your app, without open sourcing it, as long as the modifications to the VLC core and plugins are re-shared to the users and community. Also, you need to separate clearly your app from libVLC ''(use of dynamic linking makes it much easier)''.<br>
 +
It is however strongly advised to only use LGPL plugins.
 +
 +
=== Proprietary plugins ===
 +
 +
It is possible to also have proprietary plugins around VLC, as long as you can comply to the LGPL, for all libraries involved.<br>
 +
Distribution must be separated.
 +
 +
Again, in layman's terms, if you have a proprietary plugin, you should:
 +
* use libvlccore as a dynamic library,
 +
* link your plugin to libvlccore and other LGPL libraries dynamically,
 +
* make sure libVLC does not depend on your specific plugin,
 +
* be able to remove the plugin and still have a working application.
  
 
== Documentation ==
 
== Documentation ==
  
Please refer to the [http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc.html Doxygen documentation], which is the reference documentation.
+
Please refer to the [https://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc.html Doxygen documentation], which is the reference documentation.
  
''Make sure that the documentation matches the LibVLC version.'' (if not, you can build it from the source code)
+
<u>''Make sure that the documentation matches the LibVLC version.''</u> (if not, you can build it from the source code)
  
 
Some further topics are covered here:
 
Some further topics are covered here:
  
* [[LibVLC_Memory_Management| LibVLC Memory Management]] explained: covers the basics on the _new(), _retain(), _release().
+
* [[LibVLC Memory Management]] explained: covers the basics on the <code>_new()</code>, <code>_retain()</code>, <code>_release()</code>.
* [[LibVLC_Media_List_Management| LibVLC Media List Management]] explained: covers the basics on setting up a playlist.
+
* [[LibVLC Media List Management]] explained: covers the basics on setting up a playlist.
 
* [[GenerateLibFromDll|Generate a .lib for using libVLC on Windows]] (before libVLC 2.1.0)
 
* [[GenerateLibFromDll|Generate a .lib for using libVLC on Windows]] (before libVLC 2.1.0)
 +
  
 
== Examples ==
 
== Examples ==
Line 23: Line 58:
 
* [[LibVLC_Tutorial|Current version (1.1.x and later)]]
 
* [[LibVLC_Tutorial|Current version (1.1.x and later)]]
 
* Gtk Player: {{VLCSourceFile|name=doc/libvlc/gtk_player.c}}
 
* Gtk Player: {{VLCSourceFile|name=doc/libvlc/gtk_player.c}}
* Qt Player: {{VLCSourceFile|name=doc/libvlc/QtPlayer}}
+
* Qt Player: {{VLCSourceFile|name=doc/libvlc/QtPlayer/player.cpp}}
 
* WxWidgets Player: {{VLCSourceFile|name=doc/libvlc/wx_player.cpp}}
 
* WxWidgets Player: {{VLCSourceFile|name=doc/libvlc/wx_player.cpp}}
  
Line 33: Line 68:
  
 
=== More complex examples ===
 
=== More complex examples ===
* [http://git.videolan.org/?p=libvlc-demos.git;a=tree;f=vlcinfo;hb=HEAD MediaInfo clone]
+
* {{VLCSourceFolder|p=libvlc-demos.git|vlcinfo|l=MediaInfo clone}}
* [http://git.videolan.org/?p=libvlc-demos.git;a=tree;f=webcam;hb=HEAD Webcam / Cheese clone]
+
* {{VLCSourceFolder|p=libvlc-demos.git|webcam|l=Webcam / Cheese clone}}
  
 
=== libVLC on Android ===
 
=== libVLC on Android ===
* [https://bitbucket.org/edwardcw/libvlc-android-sample LibVLC on Android sample]
+
* [https://code.videolan.org/videolan/libvlc-android-samples LibVLC on Android sample]
  
=== VLCKit for Cocoa (iOS/MacOS) ===
+
=== VLCKit for Cocoa (iOS/macOS) ===
 
You can find details on features and implementation on a [[VLCKit|designated page]].
 
You can find details on features and implementation on a [[VLCKit|designated page]].
  
==== Mac OS X ====
+
==== macOS ====
* [http://git.videolan.org/?p=vlc-bindings/VLCKit.git;a=tree;f=Examples_OSX/BasicPlayerWithPlaylist;hb=HEAD Simple playlist player for Mac OS X].
+
* [https://code.videolan.org/videolan/VLCKit/tree/master/Examples/macOS/BasicPlayerWithPlaylist Simple playlist player for macOS].
* [http://git.videolan.org/?p=vlc-bindings/VLCKit.git;a=tree;f=Examples_OSX/iPodConverter;hb=HEAD iPod Converter for Mac OS X].
+
* [https://code.videolan.org/videolan/VLCKit/tree/master/Examples/macOS/iPodConverter iPod Converter for macOS].
* [http://git.videolan.org/?p=vlc-bindings/VLCKit.git;a=tree;f=Examples_OSX/FlashVideoDownloader;hb=HEAD Flash Video Downloader for Mac OS X].
+
* [https://code.videolan.org/videolan/VLCKit/tree/master/Examples/macOS/FlashVideoDownloader Flash Video Downloader for macOS].
  
 
==== iOS ====
 
==== iOS ====
* [http://git.videolan.org/?p=vlc-bindings/VLCKit.git;a=tree;f=Examples_iOS/SimplePlayback;hb=HEAD Simple player for iOS].
+
* [https://code.videolan.org/videolan/VLCKit/tree/master/Examples/iOS/SimplePlayback Simple player for iOS].
* [http://git.videolan.org/?p=vlc-bindings/VLCKit.git;a=tree;f=Examples_iOS/DropIn-Player;hb=HEAD Drop-in player for integration in iOS apps].
+
* [https://code.videolan.org/videolan/VLCKit/tree/master/Examples/iOS/DropIn-Player Drop-in player for integration in iOS apps].
 +
 
 +
=== Crossplatform .NET/Mono support with LibVLCSharp ===
 +
* [https://code.videolan.org/videolan/LibVLCSharp/tree/master/Samples Simple playback samples (iOS/Android/Mac/Windows/Xamarin.Forms)].
 +
* [https://code.videolan.org/mfkl/libvlcsharp-samples Advanced samples].
  
 
=== Outdated samples ===
 
=== Outdated samples ===
 
* [[LibVLC_Tutorial_0.9|Versions 0.9.x and 1.0.x]]
 
* [[LibVLC_Tutorial_0.9|Versions 0.9.x and 1.0.x]]
 
* [[LibVLC_Tutorial_086c|Version 0.8.6]]
 
* [[LibVLC_Tutorial_086c|Version 0.8.6]]
* [[LibVLC_Visual_C|Visual C++]] '' (uses "old" legacy API) ''
+
* [[LibVLC_Visual_C++|Visual C++]] '' (uses "old" legacy API) ''
 
* [[IceVLCPlayer|VCL component for Delphi]] (out-of-date)
 
* [[IceVLCPlayer|VCL component for Delphi]] (out-of-date)
  
 
== Language & platform bindings ==
 
== Language & platform bindings ==
 
LibVLC is a C library. It has bindings to the following languages and frameworks:
 
LibVLC is a C library. It has bindings to the following languages and frameworks:
* C++, using the C library
+
* C++, using the [https://code.videolan.org/videolan/libvlcpp libvlcpp] library
 
* The [[Web plugin]] for ActiveX (e.g. MSIE) and NPAPI (e.g. Firefox)
 
* The [[Web plugin]] for ActiveX (e.g. MSIE) and NPAPI (e.g. Firefox)
* [http://code.google.com/p/fbvlc/ FBVLC browser plugin]
+
* [http://WebChimera.org WebChimera] browser plugin with [http://nwjs.io/ NW.js] support
* [[Mac OS X Framework|Objective-C for iOS and Mac OS]]
+
* [https://github.com/RSATom/WebChimera.js WebChimera.js] - another way to bind libvlc to node.js/io.js/NW.js/Electron
 +
* [[VLCKit|Objective-C/Swift for iOS and macOS]]
 +
* [[Perl bindings|Perl]]
 
* [[PythonBinding|Python]]
 
* [[PythonBinding|Python]]
* [http://phonon.kde.org/ Phonon (Qt/KDE) in C++]]
+
* [http://phonon.kde.org/ Phonon (Qt/KDE) in C++]
* [[Java bindings]]
+
* [[Java bindings|Java]]
* [http://git.videolan.org/?p=vlc-ports/android.git;a=shortlog libVLC android Java]
+
* [https://code.videolan.org/videolan/vlc-android/tree/master/libvlc/jni Java/Scala/Kotlin/JNI Android]
* [http://github.com/jteeuwen/go-vlc GO]
+
* [https://code.videolan.org/videolan/libvlcsharp C#/F#/.NET]
* [https://github.com/RSATom/QmlVlc Qt 5 QML binding]
+
* [https://code.videolan.org/videolan/vlc-winrt/tree/master/modules/libvlcppcx C++/CX]
* [http://projects.tano.si/vlc-qt Qt bindings - VLC-Qt]
+
* [https://github.com/adrg/libvlc-go Go]
 +
* [https://github.com/garkimasera/vlc-rs Rust]
 +
* [http://github.com/RSATom/QmlVlc QmlVlc] - Qt 5 QML binding
 +
* [https://github.com/vlc-qt/vlc-qt VLC-Qt] - Qt bindings
 
* [[wxVLCBackend|wxWidgets MediaCtrl backend]] also in C++
 
* [[wxVLCBackend|wxWidgets MediaCtrl backend]] also in C++
 
* [[Using libvlc with Delphi]]
 
* [[Using libvlc with Delphi]]
 
* [http://sourceforge.net/projects/paslibvlc/ Pascal/Delphi]
 
* [http://sourceforge.net/projects/paslibvlc/ Pascal/Delphi]
* .Net / CIL
+
* [http://wiki.tcl-lang.org/48382 Tcl]
 
* [[ActiveX]] with the built-in VLC browser plugin for MSIE (obsolete)
 
* [[ActiveX]] with the built-in VLC browser plugin for MSIE (obsolete)
  
[[Category:LibVLC]]
+
== Compiling ==
 +
To build LibVLC you need [[VLC source code]] and follow [[Compile_VLC|VLC compilation instructions]] since LibVLC it is directly shipped in VLC source code.<br />
 +
You will find headers in vlc-src/include/vlc and libvlc.so binaries in the ''hidden'' folder vlc-src/lib/.libs.<br />
 +
When using your custom LibVLC build you will need to define the environment variable <var>VLC_PLUGIN_PATH</var> pointing to VLC modules located in vlc-src/modules.
 +
 
 +
[[Category:LibVLC|*]]

Latest revision as of 03:47, 2 November 2021

The libVLC (VLC SDK) media framework can be embedded into an application to get multimedia capabilities.

libVLC is a cross-platform audio and video API that provides a comprehensive multimedia API that can be used across mobile, server and desktop to render video and output audio as well as encode and stream.

Since VLC is based on libVLC, one should be able to have the same features that VLC media player has.

The libVLC media framework is already used by several applications; see who uses libVLC?

Features

libVLC notably can:

  • Play every media file formats, every codec and every streaming protocols (RTSP, RTMP, Multicast, HLS/Dash/HDS, etc..)
  • Run on every platform, from desktop (Windows, Linux, Mac) to mobile (Android, iOS) and TVs (AppleTV, Android TV, Tizen) and Consoles (PS4/5, Xbox)
  • Hardware and efficient decoding on every platform, up to 8K
  • Network browsing for distant filesystems (SMB, FTP, SFTP, NFS...) and servers (UPnP, DLNA)
  • Playback of Audio CD, DVD and Bluray with menu navigation
  • Support for 8K and HDR, including tonemapping for SDR streams
  • Audio passthrough with SPDIF and HDMI, including for Audio HD codecs, like DD+, TrueHD or DTS-HD
  • Support for complex video and audio filters
  • Support for 360/VR video and 3D audio playback, including Ambisonics
  • Able to cast and stream to distant renderers, like Chromecast and UPnP renderers.

libVLC, license and proprietary applications

Since libVLC is licensed under LGPLv2, one can do applications based on libVLC which are not licensed under the GPL (different open source licenses, or non-open source applications). One must comply with the LGPL terms, for libVLCcore, VLC plugins and libVLC.

What it means, in layman's terms, is that you can use libVLC in your app, without open sourcing it, as long as the modifications to the VLC core and plugins are re-shared to the users and community. Also, you need to separate clearly your app from libVLC (use of dynamic linking makes it much easier).
It is however strongly advised to only use LGPL plugins.

Proprietary plugins

It is possible to also have proprietary plugins around VLC, as long as you can comply to the LGPL, for all libraries involved.
Distribution must be separated.

Again, in layman's terms, if you have a proprietary plugin, you should:

  • use libvlccore as a dynamic library,
  • link your plugin to libvlccore and other LGPL libraries dynamically,
  • make sure libVLC does not depend on your specific plugin,
  • be able to remove the plugin and still have a working application.

Documentation

Please refer to the Doxygen documentation, which is the reference documentation.

Make sure that the documentation matches the LibVLC version. (if not, you can build it from the source code)

Some further topics are covered here:


Examples

Playback

Rendering and streaming

More complex examples

libVLC on Android

VLCKit for Cocoa (iOS/macOS)

You can find details on features and implementation on a designated page.

macOS

iOS

Crossplatform .NET/Mono support with LibVLCSharp

Outdated samples

Language & platform bindings

LibVLC is a C library. It has bindings to the following languages and frameworks:

Compiling

To build LibVLC you need VLC source code and follow VLC compilation instructions since LibVLC it is directly shipped in VLC source code.
You will find headers in vlc-src/include/vlc and libvlc.so binaries in the hidden folder vlc-src/lib/.libs.
When using your custom LibVLC build you will need to define the environment variable VLC_PLUGIN_PATH pointing to VLC modules located in vlc-src/modules.