<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Svlasov</id>
	<title>VideoLAN Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Svlasov"/>
	<link rel="alternate" type="text/html" href="https://wiki.videolan.org/Special:Contributions/Svlasov/"/>
	<updated>2026-11-04T18:56:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=LibVLC_Tutorial&amp;diff=18715</id>
		<title>LibVLC Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=LibVLC_Tutorial&amp;diff=18715"/>
		<updated>2011-02-18T11:18:40Z</updated>

		<summary type="html">&lt;p&gt;Svlasov: /* Linking against LibVLC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LibVLC Tutorial ==&lt;br /&gt;
&lt;br /&gt;
=== Installing the SDK ===&lt;br /&gt;
This code is written for LibVLC version 1.1.0 or later. It &#039;&#039;&#039;cannot&#039;&#039;&#039; be compiled with older versions.&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
VLC binary installers for Windows do not include the LibVLC SDK. It would be a waste of bandwidth and space for most users.&lt;br /&gt;
&lt;br /&gt;
You can find the SDK files, i.e. development headers and import libraries, from the plain ZIP packages in the &amp;lt;code&amp;gt;sdk&amp;lt;/code&amp;gt; directory. Alternatively, you can build VLC from source.&lt;br /&gt;
&lt;br /&gt;
See [[LibVLC_Tutorial_086c]] for some more instructions on getting the build working.&lt;br /&gt;
&lt;br /&gt;
==== Linux ====&lt;br /&gt;
You should find the necessary files (libvlc.so, libvlc.pc, header files...) in a binary package called libvlc-dev (Debian, Ubuntu...), libvlc-devel (RPM distros) or similar. Make sure that the version is recent enough before going forward.&lt;br /&gt;
&lt;br /&gt;
=== Linking against LibVLC ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cc example.c -lvlc -o example&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Linux/BSD, you may prefer to use pkg-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkg-config --print-errors &#039;libvlc &amp;gt;= 1.1.0&#039;&lt;br /&gt;
cc -c example.c -o example.o $(pkg-config --cflags libvlc)&lt;br /&gt;
cc example.o -o example $(pkg-config --libs libvlc)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sample LibVLC Code ===&lt;br /&gt;
This sample code will (try to) play back an URL.&lt;br /&gt;
There is also an [[LibVLC SampleCode SDL|example using SDL for video output]].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;vlc/vlc.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(int argc, char* argv[])&lt;br /&gt;
 {&lt;br /&gt;
     libvlc_instance_t * inst;&lt;br /&gt;
     libvlc_media_player_t *mp;&lt;br /&gt;
     libvlc_media_t *m;&lt;br /&gt;
     &lt;br /&gt;
     /* Load the VLC engine */&lt;br /&gt;
     inst = libvlc_new (0, NULL);&lt;br /&gt;
  &lt;br /&gt;
     /* Create a new item */&lt;br /&gt;
     m = libvlc_media_new_path (inst, &amp;quot;http://mycool.movie.com/test.mov&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
     /* Create a media player playing environement */&lt;br /&gt;
     mp = libvlc_media_player_new_from_media (m);&lt;br /&gt;
     &lt;br /&gt;
     /* No need to keep the media now */&lt;br /&gt;
     libvlc_media_release (m);&lt;br /&gt;
 &lt;br /&gt;
 #if 0&lt;br /&gt;
     /* This is a non working code that show how to hooks into a window,&lt;br /&gt;
      * if we have a window around */&lt;br /&gt;
      libvlc_media_player_set_xdrawable (mp, xdrawable);&lt;br /&gt;
     /* or on windows */&lt;br /&gt;
      libvlc_media_player_set_hwnd (mp, hwnd);&lt;br /&gt;
     /* or on mac os */&lt;br /&gt;
      libvlc_media_player_set_nsobject (mp, view);&lt;br /&gt;
  #endif&lt;br /&gt;
 &lt;br /&gt;
     /* play the media_player */&lt;br /&gt;
     libvlc_media_player_play (mp);&lt;br /&gt;
    &lt;br /&gt;
     sleep (10); /* Let it play a bit */&lt;br /&gt;
    &lt;br /&gt;
     /* Stop playing */&lt;br /&gt;
     libvlc_media_player_stop (mp);&lt;br /&gt;
 &lt;br /&gt;
     /* Free the media_player */&lt;br /&gt;
     libvlc_media_player_release (mp);&lt;br /&gt;
 &lt;br /&gt;
     libvlc_release (inst);&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svlasov</name></author>
	</entry>
</feed>