-
-
Notifications
You must be signed in to change notification settings - Fork 4
libvlc.Medium.AddOption
Andrew Lambert edited this page Nov 26, 2022
·
12 revisions
Sub AddOption(Options As String, Flags As UInt32 = 0)
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 to another and then write output into a file instead of playing the media to the user.
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 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=""C:\example\music.mp3""}")
Dim player As New VLCPlayer
player.Media = m
If Not player.Play() Then MsgBox("Unable to transcode!")
Do Until Not player.IsPlaying
App.YieldToNextThread
Loop
- Advanced streaming in the libvlc documentation
- libvlc_media_add_option in the libvlc documentation
- libvlc_media_add_option_flag in the libvlc documentation
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2016-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.
Entry-level points of interest denoted by "☜"