Skip to content

libvlc.Medium.AddOption

Andrew Lambert edited this page May 4, 2018 · 7 revisions

libvlc.Medium.AddOption

Method signature

 Sub AddOption(Options As String, Flags As UInt32 = 0)

Remarks

This method is used to apply advanced reading/streaming options to a single Medium object. These are VLC command-line options that change what libvlc will do when the Medium is played with a VLCPlayer. These options can, for example, transcode media from one format into another and then write output into a file instead of playing the media to the user.

Example

This example creates a Medium from an ogg/vorbis audio file, and then uses AddOption to instruct libvlc to transcode the audio stream into an MP3 file rather than playback normally:

  Dim player As New VLCPlayer
  Dim m As libvlc.Medium = GetFolderItem("C:\example\music.ogg")
  m.AddOption(":sout=#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=raw,dst=music.mp3}")
  player.Media = m
  If Not player.Play() Then MsgBox("Unable to transcode!")
  Do Until Not player.IsPlaying
    App.YieldToNextThread
  Loop

See also

Clone this wiki locally
You can’t perform that action at this time.