Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.

libvlc-go logo

Go bindings for libVLC and high-level media player interface.

Build status documentation MIT license Awesome Go Buy me a coffee
Go report card GitHub contributors Discord channel GitHub open issues GitHub closed issues

The package can be useful for adding multimedia capabilities to applications through the provided player interfaces. It relies on Go modules in order to mirror each supported major version of libVLC.

Documentation for v3, which implements bindings for libVLC 3.X, can be found on
Documentation for v2, which implements bindings for libVLC 2.X, can be found on

libvlc-go media player libvlc-go screen recorder libvlc-go equalizer libvlc-go media discovery

Example applications:


The libVLC development files are required. Instructions for installing the VLC SDK on multiple operating systems can be found on the wiki pages of this project.


In order to support multiple versions of libVLC, the package contains a Go module for each major version of the API. Choose an installation option depending on the version of libVLC you want to use.

libVLC v3.X

go get

libVLC v2.X

go get

# Build for libVLC < v2.2.0
go build -tags legacy

All versions above also work for projects which are not using Go modules. However, consider switching to modules.


Examples for all supported API versions can be found at


package main

import (

    vlc ""

func main() {
    // Initialize libVLC. Additional command line arguments can be passed in
    // to libVLC by specifying them in the Init function.
    if err := vlc.Init("--no-video", "--quiet"); err != nil {
    defer vlc.Release()

    // Create a new player.
    player, err := vlc.NewPlayer()
    if err != nil {
    defer func() {

    // Add a media file from path or from URL.
    // Set player media from path:
    // media, err := player.LoadMediaFromPath("localpath/test.mp4")
    // Set player media from URL:
    media, err := player.LoadMediaFromURL("")
    if err != nil {
    defer media.Release()

    // Retrieve player event manager.
    manager, err := player.EventManager()
    if err != nil {

    // Register the media end reached event with the event manager.
    quit := make(chan struct{})
    eventCallback := func(event vlc.Event, userData interface{}) {

    eventID, err := manager.Attach(vlc.MediaPlayerEndReached, eventCallback, nil)
    if err != nil {
    defer manager.Detach(eventID)

    // Start playing the media.
    err = player.Play()
    if err != nil {


In action

A list of projects using libvlc-go, in alphabetical order. If you want to showcase your project in this section, please create a pull request with it.

  • Alio - Command-line music player with Emacs style key bindings.
  • Tripbot - An ongoing 24/7 slow-TV art project.

Stargazers over time

Stargazers over time


Contributions in the form of pull requests, issues or just general feedback, are always welcome.

Contributors: adrg, fenimore, tarrsalah, danielpellon, patknight, sndnvaps.

Discord server

libvlc-go is part of the libVLC Discord Community server. Feel free to come say hello!


For more information see the libVLC documentation.


Copyright (c) 2018 Adrian-George Bostan.

This project is licensed under the MIT license. See LICENSE for more details.