Module vlc
[hide private]
[frames] | no frames]

Module vlc

source code

This module provides bindings for the LibVLC public API, see http://wiki.videolan.org/LibVLC.

You can find the documentation and a README file with some examples at https://www.olivieraubert.net/vlc/python-ctypes/.

Basically, the most important class is Instance, which is used to create a libvlc instance. From this instance, you then create MediaPlayer and MediaListPlayer instances.

Alternatively, you may create instances of the MediaPlayer and MediaListPlayer class directly and an instance of Instance will be implicitly created. The latter can be obtained using the get_instance method of MediaPlayer and MediaListPlayer.


Version: 3.0.11115

Classes [hide private]
  VLCException
Exception raised by libvlc methods.
  memoize_parameterless
Decorator.
  _Cstruct
(INTERNAL) Base class for ctypes structures.
  _Ctype
(INTERNAL) Base class for ctypes.
  ListPOINTER
Just like a POINTER but accept a list of etype elements as an argument.
  Log
  Log_ptr
  FILE
  FILE_ptr
  _Enum
(INTERNAL) Base class
  LogLevel
Logging messages level.
  MediaDiscovererCategory
Category of a media discoverer See libvlc_media_discoverer_list_get().
  DialogQuestionType
@defgroup libvlc_dialog libvlc dialog @ingroup libvlc @{ @file libvlc dialog external api.
  EventType
Event types.
  Meta
Meta data types.
  State
Note the order of libvlc_state_t enum must match exactly the order of See mediacontrol_playerstatus, See input_state_e enums, and videolan.libvlc.state (at bindings/cil/src/media.cs).
  TrackType
N/A
  VideoOrient
N/A
  VideoProjection
N/A
  MediaType
Media type See libvlc_media_get_type.
  MediaParseFlag
Parse flags used by libvlc_media_parse_with_options() See libvlc_media_parse_with_options.
  MediaParsedStatus
Parse status used sent by libvlc_media_parse_with_options() or returned by libvlc_media_get_parsed_status() See libvlc_media_parse_with_options See libvlc_media_get_parsed_status.
  MediaSlaveType
Type of a media slave: subtitle or audio.
  VideoMarqueeOption
Marq options definition.
  NavigateMode
Navigation mode.
  Position
Enumeration of values used to set position (e.g.
  TeletextKey
Enumeration of teletext keys than can be passed via libvlc_video_set_teletext().
  VideoLogoOption
Option values for libvlc_video_{get,set}_logo_{int,string}.
  VideoAdjustOption
Option values for libvlc_video_{get,set}_adjust_{int,float,bool}.
  AudioOutputDeviceTypes
Audio device types.
  AudioOutputChannel
Audio channels.
  MediaPlayerRole
Media player roles.
  PlaybackMode
Defines playback modes for playlist.
  AudioOutput
  LogMessage
  MediaEvent
  MediaStats
  MediaTrackInfo
  AudioTrack
  VideoTrack
  SubtitleTrack
  MediaTrackTracks
  MediaTrack
  PlaylistItem
  Rectangle
  TrackDescription
  EventUnion
  Event
  ModuleDescription
  AudioOutputDevice
  TitleDescription
  ChapterDescription
  VideoViewpoint
  MediaDiscovererDescription
  MediaSlave
  RDDescription
  MediaThumbnailRequest
  Direct3dDeviceSetup
  Direct3dDeviceCfg
  Direct3dCfg
  VideoOutputCfg
  Direct3dHdr10Metadata
  VideoSetupDeviceCfg
  VideoSetupDeviceInfo
  VideoRenderCfg
  Callback
Callback function notification.
  LogCb
Callback prototype for LibVLC log message handler.
  MediaOpenCb
Callback prototype to open a custom bitstream input media.
  MediaReadCb
Callback prototype to read data from a custom bitstream input media.
  MediaSeekCb
Callback prototype to seek a custom bitstream input media.
  MediaCloseCb
Callback prototype to close a custom bitstream input media.
  VideoLockCb
Callback prototype to allocate and lock a picture buffer.
  VideoUnlockCb
Callback prototype to unlock a picture buffer.
  VideoDisplayCb
Callback prototype to display a picture.
  VideoFormatCb
Callback prototype to configure picture buffers format.
  VideoCleanupCb
Callback prototype to configure picture buffers format.
  AudioPlayCb
Callback prototype for audio playback.
  AudioPauseCb
Callback prototype for audio pause.
  AudioResumeCb
Callback prototype for audio resumption.
  AudioFlushCb
Callback prototype for audio buffer flush.
  AudioDrainCb
Callback prototype for audio buffer drain.
  AudioSetVolumeCb
Callback prototype for audio volume change.
  AudioSetupCb
Callback prototype to setup the audio playback.
  AudioCleanupCb
Callback prototype for audio playback cleanup.
  CallbackDecorators
Class holding various method decorators for callback functions.
  cb
Class holding various method decorators for callback functions.
  AudioEqualizer
Create a new default equalizer, with all frequency values zeroed.
  EventManager
Create an event manager with callback handler.
  Instance
Create a new Instance instance.
  LogIterator
Create a new VLC log iterator.
  Media
Create a new Media instance.
  MediaDiscoverer
N/A
  MediaLibrary
N/A
  MediaList
Create a new MediaList instance.
  MediaListPlayer
Create a new MediaListPlayer instance.
  MediaPlayer
Create a new MediaPlayer instance.
  Renderer
N/A
  RendererDiscoverer
N/A
Functions [hide private]
 
str_to_bytes(s)
Translate string or bytes to bytes.
source code
 
bytes_to_str(b)
Translate bytes to unicode string.
source code
 
find_lib() source code
 
get_default_instance()
Return the default VLC.Instance.
source code
 
try_fspath(path)
Try calling os.fspath os.fspath is only available from py3.6
source code
 
_Cfunction(name, flags, errcheck, *types)
(INTERNAL) New ctypes function binding.
source code
 
_Cobject(cls, ctype)
(INTERNAL) New instance from ctypes.
source code
 
_Constructor(cls, ptr=<__builtin__.object object>)
(INTERNAL) New wrapper from ctypes.
source code
 
string_result(result, func, arguments)
Errcheck function.
source code
 
class_result(classname)
Errcheck function.
source code
 
track_description_list(head)
Convert a TrackDescription linked list to a Python list (and release the former).
source code
 
module_description_list(head)
Convert a ModuleDescription linked list to a Python list (and release the former).
source code
 
libvlc_clearerr()
Clears the LibVLC error status for the current thread.
source code
 
libvlc_vprinterr(fmt, ap)
Sets the LibVLC error status and message for the current thread.
source code
 
libvlc_new(argc, argv)
Create and initialize a libvlc instance.
source code
 
libvlc_release(p_instance)
Decrement the reference count of a libvlc instance, and destroy it if it reaches zero.
source code
 
libvlc_retain(p_instance)
Increments the reference count of a libvlc instance.
source code
 
libvlc_add_intf(p_instance, name)
Try to start a user interface for the libvlc instance.
source code
 
libvlc_set_user_agent(p_instance, name, http)
Sets the application name.
source code
 
libvlc_set_app_id(p_instance, id, version, icon)
Sets some meta-information about the application.
source code
 
libvlc_get_version()
Retrieve libvlc version.
source code
 
libvlc_get_compiler()
Retrieve libvlc compiler version.
source code
 
libvlc_get_changeset()
Retrieve libvlc changeset.
source code
 
libvlc_event_attach(p_event_manager, i_event_type, f_callback, user_data)
Register for an event notification.
source code
 
libvlc_event_detach(p_event_manager, i_event_type, f_callback, p_user_data)
Unregister an event notification.
source code
 
libvlc_event_type_name(event_type)
Get an event's type name.
source code
 
libvlc_log_get_context(ctx)
Gets log message debug infos.
source code
 
libvlc_log_get_object(ctx, id)
Gets log message info.
source code
 
libvlc_log_unset(p_instance)
Unsets the logging callback.
source code
 
libvlc_log_set(p_instance, cb, data)
Sets the logging callback for a LibVLC instance.
source code
 
libvlc_log_set_file(p_instance, stream)
Sets up logging to a file.
source code
 
libvlc_module_description_list_release(p_list)
Release a list of module descriptions.
source code
 
libvlc_audio_filter_list_get(p_instance)
Returns a list of audio filters that are available.
source code
 
libvlc_video_filter_list_get(p_instance)
Returns a list of video filters that are available.
source code
 
libvlc_clock()
Return the current time as defined by LibVLC.
source code
 
libvlc_media_discoverer_new(p_inst, psz_name)
Create a media discoverer object by name.
source code
 
libvlc_media_discoverer_start(p_mdis)
Start media discovery.
source code
 
libvlc_media_discoverer_stop(p_mdis)
Stop media discovery.
source code
 
libvlc_media_discoverer_release(p_mdis)
Release media discover object.
source code
 
libvlc_media_discoverer_media_list(p_mdis)
Get media service discover media list.
source code
 
libvlc_media_discoverer_is_running(p_mdis)
Query if media service discover object is running.
source code
 
libvlc_media_discoverer_list_get(p_inst, i_cat, ppp_services)
Get media discoverer services by category.
source code
 
libvlc_media_discoverer_list_release(pp_services, i_count)
Release an array of media discoverer services.
source code
 
libvlc_dialog_set_context(p_id, p_context)
Associate an opaque pointer with the dialog id.
source code
 
libvlc_dialog_get_context(p_id)
Return the opaque pointer associated with the dialog id.
source code
 
libvlc_dialog_post_login(p_id, psz_username, psz_password, b_store)
Post a login answer After this call, p_id won't be valid anymore See libvlc_dialog_cbs.pf_display_login.
source code
 
libvlc_dialog_post_action(p_id, i_action)
Post a question answer After this call, p_id won't be valid anymore See libvlc_dialog_cbs.pf_display_question.
source code
 
libvlc_dialog_dismiss(p_id)
Dismiss a dialog After this call, p_id won't be valid anymore See libvlc_dialog_cbs.pf_cancel.
source code
 
libvlc_media_library_new(p_instance)
Create an new Media Library object.
source code
 
libvlc_media_library_release(p_mlib)
Release media library object.
source code
 
libvlc_media_library_retain(p_mlib)
Retain a reference to a media library object.
source code
 
libvlc_media_library_load(p_mlib)
Load media library.
source code
 
libvlc_media_library_media_list(p_mlib)
Get media library subitems.
source code
 
libvlc_vlm_release(p_instance)
Release the vlm instance related to the given Instance.
source code
 
libvlc_vlm_add_broadcast(p_instance, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop)
Add a broadcast, with one input.
source code
 
libvlc_vlm_add_vod(p_instance, psz_name, psz_input, i_options, ppsz_options, b_enabled, psz_mux)
Add a vod, with one input.
source code
 
libvlc_vlm_del_media(p_instance, psz_name)
Delete a media (VOD or broadcast).
source code
 
libvlc_vlm_set_enabled(p_instance, psz_name, b_enabled)
Enable or disable a media (VOD or broadcast).
source code
 
libvlc_vlm_set_output(p_instance, psz_name, psz_output)
Set the output for a media.
source code
 
libvlc_vlm_set_input(p_instance, psz_name, psz_input)
Set a media's input MRL.
source code
 
libvlc_vlm_add_input(p_instance, psz_name, psz_input)
Add a media's input MRL.
source code
 
libvlc_vlm_set_loop(p_instance, psz_name, b_loop)
Set a media's loop status.
source code
 
libvlc_vlm_set_mux(p_instance, psz_name, psz_mux)
Set a media's vod muxer.
source code
 
libvlc_vlm_change_media(p_instance, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop)
Edit the parameters of a media.
source code
 
libvlc_vlm_play_media(p_instance, psz_name)
Play the named broadcast.
source code
 
libvlc_vlm_stop_media(p_instance, psz_name)
Stop the named broadcast.
source code
 
libvlc_vlm_pause_media(p_instance, psz_name)
Pause the named broadcast.
source code
 
libvlc_vlm_seek_media(p_instance, psz_name, f_percentage)
Seek in the named broadcast.
source code
 
libvlc_vlm_show_media(p_instance, psz_name)
Return information about the named media as a JSON string representation.
source code
 
libvlc_vlm_get_media_instance_position(p_instance, psz_name, i_instance)
Get vlm_media instance position by name or instance id.
source code
 
libvlc_vlm_get_media_instance_time(p_instance, psz_name, i_instance)
Get vlm_media instance time by name or instance id.
source code
 
libvlc_vlm_get_media_instance_length(p_instance, psz_name, i_instance)
Get vlm_media instance length by name or instance id.
source code
 
libvlc_vlm_get_media_instance_rate(p_instance, psz_name, i_instance)
Get vlm_media instance playback rate by name or instance id.
source code
 
libvlc_vlm_get_media_instance_title(p_instance, psz_name, i_instance)
Get vlm_media instance title number by name or instance id.
source code
 
libvlc_vlm_get_media_instance_chapter(p_instance, psz_name, i_instance)
Get vlm_media instance chapter number by name or instance id.
source code
 
libvlc_vlm_get_media_instance_seekable(p_instance, psz_name, i_instance)
Is libvlc instance seekable ?
source code
 
libvlc_vlm_get_event_manager(p_instance)
Get libvlc_event_manager from a vlm media.
source code
 
libvlc_media_new_location(p_instance, psz_mrl)
Create a media with a certain given media resource location, for instance a valid URL.
source code
 
libvlc_media_new_path(p_instance, path)
Create a media for a certain file path.
source code
 
libvlc_media_new_fd(p_instance, fd)
Create a media for an already open file descriptor.
source code
 
libvlc_media_new_callbacks(instance, open_cb, read_cb, seek_cb, close_cb, opaque)
Create a media with custom callbacks to read the data from.
source code
 
libvlc_media_new_as_node(p_instance, psz_name)
Create a media as an empty node with a given name.
source code
 
libvlc_media_add_option(p_md, psz_options)
Add an option to the media.
source code
 
libvlc_media_add_option_flag(p_md, psz_options, i_flags)
Add an option to the media with configurable flags.
source code
 
libvlc_media_retain(p_md)
Retain a reference to a media descriptor object (Media).
source code
 
libvlc_media_release(p_md)
Decrement the reference count of a media descriptor object.
source code
 
libvlc_media_get_mrl(p_md)
Get the media resource locator (mrl) from a media descriptor object.
source code
 
libvlc_media_duplicate(p_md)
Duplicate a media descriptor object.
source code
 
libvlc_media_get_meta(p_md, e_meta)
Read the meta of the media.
source code
 
libvlc_media_set_meta(p_md, e_meta, psz_value)
Set the meta of the media (this function will not save the meta, call libvlc_media_save_meta in order to save the meta).
source code
 
libvlc_media_save_meta(p_md)
Save the meta previously set.
source code
 
libvlc_media_get_state(p_md)
Get current state of media descriptor object.
source code
 
libvlc_media_get_stats(p_md, p_stats)
Get the current statistics about the media.
source code
 
libvlc_media_subitems(p_md)
Get subitems of media descriptor object.
source code
 
libvlc_media_event_manager(p_md)
Get event manager from media descriptor object.
source code
 
libvlc_media_get_duration(p_md)
Get duration (in ms) of media descriptor object item.
source code
 
libvlc_media_parse_with_options(p_md, parse_flag, timeout)
Parse the media asynchronously with options.
source code
 
libvlc_media_parse_stop(p_md)
Stop the parsing of the media When the media parsing is stopped, the libvlc_MediaParsedChanged event will be sent with the libvlc_media_parsed_status_timeout status.
source code
 
libvlc_media_get_parsed_status(p_md)
Get Parsed status for media descriptor object.
source code
 
libvlc_media_set_user_data(p_md, p_new_user_data)
Sets media descriptor's user_data.
source code
 
libvlc_media_get_user_data(p_md)
Get media descriptor's user_data.
source code
 
libvlc_media_tracks_get(p_md, tracks)
Get media descriptor's elementary streams description Note, you need to call libvlc_media_parse() or play the media at least once before calling this function.
source code
 
libvlc_media_get_codec_description(i_type, i_codec)
Get codec description from media elementary stream.
source code
 
libvlc_media_tracks_release(p_tracks, i_count)
Release media descriptor's elementary streams description array.
source code
 
libvlc_media_get_type(p_md)
Get the media type of the media descriptor object.
source code
 
libvlc_media_slaves_add(p_md, i_type, i_priority, psz_uri)
Add a slave to the current media.
source code
 
libvlc_media_slaves_clear(p_md)
Clear all slaves previously added by libvlc_media_slaves_add() or internally.
source code
 
libvlc_media_slaves_get(p_md, ppp_slaves)
Get a media descriptor's slave list The list will contain slaves parsed by VLC or previously added by libvlc_media_slaves_add().
source code
 
libvlc_media_slaves_release(pp_slaves, i_count)
Release a media descriptor's slave list.
source code
 
libvlc_renderer_item_hold(p_item)
Hold a renderer item, i.e.
source code
 
libvlc_renderer_item_release(p_item)
Releases a renderer item, i.e.
source code
 
libvlc_renderer_item_name(p_item)
Get the human readable name of a renderer item.
source code
 
libvlc_renderer_item_type(p_item)
Get the type (not translated) of a renderer item.
source code
 
libvlc_renderer_item_icon_uri(p_item)
Get the icon uri of a renderer item.
source code
 
libvlc_renderer_item_flags(p_item)
Get the flags of a renderer item See LIBVLC_RENDERER_CAN_AUDIO See LIBVLC_RENDERER_CAN_VIDEO.
source code
 
libvlc_renderer_discoverer_new(p_inst, psz_name)
Create a renderer discoverer object by name After this object is created, you should attach to events in order to be notified of the discoverer events.
source code
 
libvlc_renderer_discoverer_release(p_rd)
Release a renderer discoverer object.
source code
 
libvlc_renderer_discoverer_start(p_rd)
Start renderer discovery To stop it, call libvlc_renderer_discoverer_stop() or libvlc_renderer_discoverer_release() directly.
source code
 
libvlc_renderer_discoverer_stop(p_rd)
Stop renderer discovery.
source code
 
libvlc_renderer_discoverer_event_manager(p_rd)
Get the event manager of the renderer discoverer The possible events to attach are @ref libvlc_RendererDiscovererItemAdded and @ref libvlc_RendererDiscovererItemDeleted.
source code
 
libvlc_renderer_discoverer_list_get(p_inst, ppp_services)
Get media discoverer services See libvlc_renderer_list_release().
source code
 
libvlc_renderer_discoverer_list_release(pp_services, i_count)
Release an array of media discoverer services See libvlc_renderer_discoverer_list_get().
source code
 
libvlc_media_list_new(p_instance)
Create an empty media list.
source code
 
libvlc_media_list_release(p_ml)
Release media list created with libvlc_media_list_new().
source code
 
libvlc_media_list_retain(p_ml)
Retain reference to a media list.
source code
 
libvlc_media_list_set_media(p_ml, p_md)
Associate media instance with this media list instance.
source code
 
libvlc_media_list_media(p_ml)
Get media instance from this media list instance.
source code
 
libvlc_media_list_add_media(p_ml, p_md)
Add media instance to media list The libvlc_media_list_lock should be held upon entering this function.
source code
 
libvlc_media_list_insert_media(p_ml, p_md, i_pos)
Insert media instance in media list on a position The libvlc_media_list_lock should be held upon entering this function.
source code
 
libvlc_media_list_remove_index(p_ml, i_pos)
Remove media instance from media list on a position The libvlc_media_list_lock should be held upon entering this function.
source code
 
libvlc_media_list_count(p_ml)
Get count on media list items The libvlc_media_list_lock should be held upon entering this function.
source code
 
libvlc_media_list_item_at_index(p_ml, i_pos)
List media instance in media list at a position The libvlc_media_list_lock should be held upon entering this function.
source code
 
libvlc_media_list_index_of_item(p_ml, p_md)
Find index position of List media instance in media list.
source code
 
libvlc_media_list_is_readonly(p_ml)
This indicates if this media list is read-only from a user point of view.
source code
 
libvlc_media_list_lock(p_ml)
Get lock on media list items.
source code
 
libvlc_media_list_unlock(p_ml)
Release lock on media list items The libvlc_media_list_lock should be held upon entering this function.
source code
 
libvlc_media_list_event_manager(p_ml)
Get libvlc_event_manager from this media list instance.
source code
 
libvlc_media_player_get_fps(p_mi)
Get movie fps rate This function is provided for backward compatibility.
source code
 
libvlc_media_player_set_agl(p_mi, drawable)
\deprecated Use libvlc_media_player_set_nsobject() instead.
source code
 
libvlc_media_player_get_agl(p_mi)
\deprecated Use libvlc_media_player_get_nsobject() instead.
source code
 
libvlc_track_description_release(p_track_description)
\deprecated Use libvlc_track_description_list_release() instead.
source code
 
libvlc_video_get_height(p_mi)
Get current video height.
source code
 
libvlc_video_get_width(p_mi)
Get current video width.
source code
 
libvlc_video_get_title_description(p_mi)
Get the description of available titles.
source code
 
libvlc_video_get_chapter_description(p_mi, i_title)
Get the description of available chapters for specific title.
source code
 
libvlc_video_set_subtitle_file(p_mi, psz_subtitle)
Set new video subtitle file.
source code
 
libvlc_toggle_teletext(p_mi)
Toggle teletext transparent status on video output.
source code
 
libvlc_audio_output_device_count(p_instance, psz_audio_output)
Backward compatibility stub.
source code
 
libvlc_audio_output_device_longname(p_instance, psz_output, i_device)
Backward compatibility stub.
source code
 
libvlc_audio_output_device_id(p_instance, psz_audio_output, i_device)
Backward compatibility stub.
source code
 
libvlc_media_parse(p_md)
Parse a media.
source code
 
libvlc_media_parse_async(p_md)
Parse a media.
source code
 
libvlc_media_is_parsed(p_md)
Return true is the media descriptor object is parsed \deprecated This can return true in case of failure.
source code
 
libvlc_media_get_tracks_info(p_md)
Get media descriptor's elementary streams description Note, you need to call libvlc_media_parse() or play the media at least once before calling this function.
source code
 
libvlc_media_discoverer_new_from_name(p_inst, psz_name)
\deprecated Use libvlc_media_discoverer_new() and libvlc_media_discoverer_start().
source code
 
libvlc_media_discoverer_localized_name(p_mdis)
Get media service discover object its localized name.
source code
 
libvlc_media_discoverer_event_manager(p_mdis)
Get event manager from media service discover object.
source code
 
libvlc_wait(p_instance)
Waits until an interface causes the instance to exit.
source code
 
libvlc_get_log_verbosity(p_instance)
Always returns minus one.
source code
 
libvlc_set_log_verbosity(p_instance, level)
This function does nothing.
source code
 
libvlc_log_open(p_instance)
This function does nothing useful.
source code
 
libvlc_log_close(p_log)
Frees memory allocated by libvlc_log_open().
source code
 
libvlc_log_count(p_log)
Always returns zero.
source code
 
libvlc_log_clear(p_log)
This function does nothing.
source code
 
libvlc_log_get_iterator(p_log)
This function does nothing useful.
source code
 
libvlc_log_iterator_free(p_iter)
Frees memory allocated by libvlc_log_get_iterator().
source code
 
libvlc_log_iterator_has_next(p_iter)
Always returns zero.
source code
 
libvlc_log_iterator_next(p_iter, p_buf)
Always returns None.
source code
 
libvlc_playlist_play(p_instance, i_id, i_options, ppsz_options)
Start playing (if there is any item in the playlist).
source code
 
libvlc_media_player_new(p_libvlc_instance)
Create an empty Media Player object.
source code
 
libvlc_media_player_new_from_media(p_md)
Create a Media Player object from a Media.
source code
 
libvlc_media_player_release(p_mi)
Release a media_player after use Decrement the reference count of a media player object.
source code
 
libvlc_media_player_retain(p_mi)
Retain a reference to a media player object.
source code
 
libvlc_media_player_set_media(p_mi, p_md)
Set the media that will be used by the media_player.
source code
 
libvlc_media_player_get_media(p_mi)
Get the media used by the media_player.
source code
 
libvlc_media_player_event_manager(p_mi)
Get the Event Manager from which the media player send event.
source code
 
libvlc_media_player_is_playing(p_mi)
is_playing.
source code
 
libvlc_media_player_play(p_mi)
Play.
source code
 
libvlc_media_player_set_pause(mp, do_pause)
Pause or resume (no effect if there is no media).
source code
 
libvlc_media_player_pause(p_mi)
Toggle pause (no effect if there is no media).
source code
 
libvlc_media_player_stop(p_mi)
Stop (no effect if there is no media).
source code
 
libvlc_media_player_set_renderer(p_mi, p_item)
Set a renderer to the media player
source code
 
libvlc_video_set_callbacks(mp, lock, unlock, display, opaque)
Set callbacks and private data to render decoded video to a custom area in memory.
source code
 
libvlc_video_set_format(mp, chroma, width, height, pitch)
Set decoded video chroma and dimensions.
source code
 
libvlc_video_set_format_callbacks(mp, setup, cleanup)
Set decoded video chroma and dimensions.
source code
 
libvlc_media_player_set_nsobject(p_mi, drawable)
Set the NSView handler where the media player should render its video output.
source code
 
libvlc_media_player_get_nsobject(p_mi)
Get the NSView handler previously set with libvlc_media_player_set_nsobject().
source code
 
libvlc_media_player_set_xwindow(p_mi, drawable)
Set an X Window System drawable where the media player should render its video output.
source code
 
libvlc_media_player_get_xwindow(p_mi)
Get the X Window System window identifier previously set with libvlc_media_player_set_xwindow().
source code
 
libvlc_media_player_set_hwnd(p_mi, drawable)
Set a Win32/Win64 API window handle (HWND) where the media player should render its video output.
source code
 
libvlc_media_player_get_hwnd(p_mi)
Get the Windows API window handle (HWND) previously set with libvlc_media_player_set_hwnd().
source code
 
libvlc_media_player_set_android_context(p_mi, p_awindow_handler)
Set the android context.
source code
 
libvlc_media_player_set_evas_object(p_mi, p_evas_object)
Set the EFL Evas Object.
source code
 
libvlc_audio_set_callbacks(mp, play, pause, resume, flush, drain, opaque)
Sets callbacks and private data for decoded audio.
source code
 
libvlc_audio_set_volume_callback(mp, set_volume)
Set callbacks and private data for decoded audio.
source code
 
libvlc_audio_set_format_callbacks(mp, setup, cleanup)
Sets decoded audio format via callbacks.
source code
 
libvlc_audio_set_format(mp, format, rate, channels)
Sets a fixed decoded audio format.
source code
 
libvlc_media_player_get_length(p_mi)
Get the current movie length (in ms).
source code
 
libvlc_media_player_get_time(p_mi)
Get the current movie time (in ms).
source code
 
libvlc_media_player_set_time(p_mi, i_time)
Set the movie time (in ms).
source code
 
libvlc_media_player_get_position(p_mi)
Get movie position as percentage between 0.0 and 1.0.
source code
 
libvlc_media_player_set_position(p_mi, f_pos)
Set movie position as percentage between 0.0 and 1.0.
source code
 
libvlc_media_player_set_chapter(p_mi, i_chapter)
Set movie chapter (if applicable).
source code
 
libvlc_media_player_get_chapter(p_mi)
Get movie chapter.
source code
 
libvlc_media_player_get_chapter_count(p_mi)
Get movie chapter count.
source code
 
libvlc_media_player_will_play(p_mi)
Is the player able to play.
source code
 
libvlc_media_player_get_chapter_count_for_title(p_mi, i_title)
Get title chapter count.
source code
 
libvlc_media_player_set_title(p_mi, i_title)
Set movie title.
source code
 
libvlc_media_player_get_title(p_mi)
Get movie title.
source code
 
libvlc_media_player_get_title_count(p_mi)
Get movie title count.
source code
 
libvlc_media_player_previous_chapter(p_mi)
Set previous chapter (if applicable).
source code
 
libvlc_media_player_next_chapter(p_mi)
Set next chapter (if applicable).
source code
 
libvlc_media_player_get_rate(p_mi)
Get the requested movie play rate.
source code
 
libvlc_media_player_set_rate(p_mi, rate)
Set movie play rate.
source code
 
libvlc_media_player_get_state(p_mi)
Get current movie state.
source code
 
libvlc_media_player_has_vout(p_mi)
How many video outputs does this media player have?
source code
 
libvlc_media_player_is_seekable(p_mi)
Is this media player seekable?
source code
 
libvlc_media_player_can_pause(p_mi)
Can this media player be paused?
source code
 
libvlc_media_player_program_scrambled(p_mi)
Check if the current program is scrambled.
source code
 
libvlc_media_player_next_frame(p_mi)
Display the next frame (if supported).
source code
 
libvlc_media_player_navigate(p_mi, navigate)
Navigate through DVD Menu.
source code
 
libvlc_media_player_set_video_title_display(p_mi, position, timeout)
Set if, and how, the video title will be shown when media is played.
source code
 
libvlc_media_player_add_slave(p_mi, i_type, psz_uri, b_select)
Add a slave to the current media player.
source code
 
libvlc_track_description_list_release(p_track_description)
Release (free) TrackDescription.
source code
 
libvlc_toggle_fullscreen(p_mi)
Toggle fullscreen status on non-embedded video outputs.
source code
 
libvlc_set_fullscreen(p_mi, b_fullscreen)
Enable or disable fullscreen.
source code
 
libvlc_get_fullscreen(p_mi)
Get current fullscreen status.
source code
 
libvlc_video_set_key_input(p_mi, on)
Enable or disable key press events handling, according to the LibVLC hotkeys configuration.
source code
 
libvlc_video_set_mouse_input(p_mi, on)
Enable or disable mouse click events handling.
source code
 
libvlc_video_get_size(p_mi, num)
Get the pixel dimensions of a video.
source code
 
libvlc_video_get_cursor(p_mi, num)
Get the mouse pointer coordinates over a video.
source code
 
libvlc_video_get_scale(p_mi)
Get the current video scaling factor.
source code
 
libvlc_video_set_scale(p_mi, f_factor)
Set the video scaling factor.
source code
 
libvlc_video_get_aspect_ratio(p_mi)
Get current video aspect ratio.
source code
 
libvlc_video_set_aspect_ratio(p_mi, psz_aspect)
Set new video aspect ratio.
source code
 
libvlc_video_new_viewpoint()
Create a video viewpoint structure.
source code
 
libvlc_video_update_viewpoint(p_mi, p_viewpoint, b_absolute)
Update the video viewpoint information.
source code
 
libvlc_video_get_spu(p_mi)
Get current video subtitle.
source code
 
libvlc_video_get_spu_count(p_mi)
Get the number of available video subtitles.
source code
 
libvlc_video_get_spu_description(p_mi)
Get the description of available video subtitles.
source code
 
libvlc_video_set_spu(p_mi, i_spu)
Set new video subtitle.
source code
 
libvlc_video_get_spu_delay(p_mi)
Get the current subtitle delay.
source code
 
libvlc_video_set_spu_delay(p_mi, i_delay)
Set the subtitle delay.
source code
 
libvlc_media_player_get_full_title_descriptions(p_mi, titles)
Get the full description of available titles.
source code
 
libvlc_title_descriptions_release(p_titles, i_count)
Release a title description.
source code
 
libvlc_media_player_get_full_chapter_descriptions(p_mi, i_chapters_of_title, pp_chapters)
Get the full description of available chapters.
source code
 
libvlc_chapter_descriptions_release(p_chapters, i_count)
Release a chapter description.
source code
 
libvlc_video_get_crop_geometry(p_mi)
Get current crop filter geometry.
source code
 
libvlc_video_set_crop_geometry(p_mi, psz_geometry)
Set new crop filter geometry.
source code
 
libvlc_video_get_teletext(p_mi)
Get current teletext page requested or 0 if it's disabled.
source code
 
libvlc_video_set_teletext(p_mi, i_page)
Set new teletext page to retrieve.
source code
 
libvlc_video_get_track_count(p_mi)
Get number of available video tracks.
source code
 
libvlc_video_get_track_description(p_mi)
Get the description of available video tracks.
source code
 
libvlc_video_get_track(p_mi)
Get current video track.
source code
 
libvlc_video_set_track(p_mi, i_track)
Set video track.
source code
 
libvlc_video_take_snapshot(p_mi, num, psz_filepath, i_width, i_height)
Take a snapshot of the current video window.
source code
 
libvlc_video_set_deinterlace(p_mi, psz_mode)
Enable or disable deinterlace filter.
source code
 
libvlc_video_get_marquee_int(p_mi, option)
Get an integer marquee option value.
source code
 
libvlc_video_get_marquee_string(p_mi, option)
Get a string marquee option value.
source code
 
libvlc_video_set_marquee_int(p_mi, option, i_val)
Enable, disable or set an integer marquee option Setting libvlc_marquee_Enable has the side effect of enabling (arg !0) or disabling (arg 0) the marq filter.
source code
 
libvlc_video_set_marquee_string(p_mi, option, psz_text)
Set a marquee string option.
source code
 
libvlc_video_get_logo_int(p_mi, option)
Get integer logo option.
source code
 
libvlc_video_set_logo_int(p_mi, option, value)
Set logo option as integer.
source code
 
libvlc_video_set_logo_string(p_mi, option, psz_value)
Set logo option as string.
source code
 
libvlc_video_get_adjust_int(p_mi, option)
Get integer adjust option.
source code
 
libvlc_video_set_adjust_int(p_mi, option, value)
Set adjust option as integer.
source code
 
libvlc_video_get_adjust_float(p_mi, option)
Get float adjust option.
source code
 
libvlc_video_set_adjust_float(p_mi, option, value)
Set adjust option as float.
source code
 
libvlc_audio_output_list_get(p_instance)
Gets the list of available audio output modules.
source code
 
libvlc_audio_output_list_release(p_list)
Frees the list of available audio output modules.
source code
 
libvlc_audio_output_set(p_mi, psz_name)
Selects an audio output module.
source code
 
libvlc_audio_output_device_enum(mp)
Gets a list of potential audio output devices, See libvlc_audio_output_device_set().
source code
 
libvlc_audio_output_device_list_get(p_instance, aout)
Gets a list of audio output devices for a given audio output module, See libvlc_audio_output_device_set().
source code
 
libvlc_audio_output_device_list_release(p_list)
Frees a list of available audio output devices.
source code
 
libvlc_audio_output_device_set(mp, module, device_id)
Configures an explicit audio output device.
source code
 
libvlc_audio_output_device_get(mp)
Get the current audio output device identifier.
source code
 
libvlc_audio_toggle_mute(p_mi)
Toggle mute status.
source code
 
libvlc_audio_get_mute(p_mi)
Get current mute status.
source code
 
libvlc_audio_set_mute(p_mi, status)
Set mute status.
source code
 
libvlc_audio_get_volume(p_mi)
Get current software audio volume.
source code
 
libvlc_audio_set_volume(p_mi, i_volume)
Set current software audio volume.
source code
 
libvlc_audio_get_track_count(p_mi)
Get number of available audio tracks.
source code
 
libvlc_audio_get_track_description(p_mi)
Get the description of available audio tracks.
source code
 
libvlc_audio_get_track(p_mi)
Get current audio track.
source code
 
libvlc_audio_set_track(p_mi, i_track)
Set current audio track.
source code
 
libvlc_audio_get_channel(p_mi)
Get current audio channel.
source code
 
libvlc_audio_set_channel(p_mi, channel)
Set current audio channel.
source code
 
libvlc_audio_get_delay(p_mi)
Get current audio delay.
source code
 
libvlc_audio_set_delay(p_mi, i_delay)
Set current audio delay.
source code
 
libvlc_audio_equalizer_get_preset_count()
Get the number of equalizer presets.
source code
 
libvlc_audio_equalizer_get_preset_name(u_index)
Get the name of a particular equalizer preset.
source code
 
libvlc_audio_equalizer_get_band_count()
Get the number of distinct frequency bands for an equalizer.
source code
 
libvlc_audio_equalizer_get_band_frequency(u_index)
Get a particular equalizer band frequency.
source code
 
libvlc_audio_equalizer_new()
Create a new default equalizer, with all frequency values zeroed.
source code
 
libvlc_audio_equalizer_new_from_preset(u_index)
Create a new equalizer, with initial frequency values copied from an existing preset.
source code
 
libvlc_audio_equalizer_release(p_equalizer)
Release a previously created equalizer instance.
source code
 
libvlc_audio_equalizer_set_preamp(p_equalizer, f_preamp)
Set a new pre-amplification value for an equalizer.
source code
 
libvlc_audio_equalizer_get_preamp(p_equalizer)
Get the current pre-amplification value from an equalizer.
source code
 
libvlc_audio_equalizer_set_amp_at_index(p_equalizer, f_amp, u_band)
Set a new amplification value for a particular equalizer frequency band.
source code
 
libvlc_audio_equalizer_get_amp_at_index(p_equalizer, u_band)
Get the amplification value for a particular equalizer frequency band.
source code
 
libvlc_media_player_set_equalizer(p_mi, p_equalizer)
Apply new equalizer settings to a media player.
source code
 
libvlc_media_player_get_role(p_mi)
Gets the media role.
source code
 
libvlc_media_player_set_role(p_mi, role)
Sets the media role.
source code
 
libvlc_media_list_player_new(p_instance)
Create new media_list_player.
source code
 
libvlc_media_list_player_release(p_mlp)
Release a media_list_player after use Decrement the reference count of a media player object.
source code
 
libvlc_media_list_player_retain(p_mlp)
Retain a reference to a media player list object.
source code
 
libvlc_media_list_player_event_manager(p_mlp)
Return the event manager of this media_list_player.
source code
 
libvlc_media_list_player_set_media_player(p_mlp, p_mi)
Replace media player in media_list_player with this instance.
source code
 
libvlc_media_list_player_get_media_player(p_mlp)
Get media player of the media_list_player instance.
source code
 
libvlc_media_list_player_set_media_list(p_mlp, p_mlist)
Set the media list associated with the player.
source code
 
libvlc_media_list_player_play(p_mlp)
Play media list.
source code
 
libvlc_media_list_player_pause(p_mlp)
Toggle pause (or resume) media list.
source code
 
libvlc_media_list_player_set_pause(p_mlp, do_pause)
Pause or resume media list.
source code
 
libvlc_media_list_player_is_playing(p_mlp)
Is media list playing?
source code
 
libvlc_media_list_player_get_state(p_mlp)
Get current libvlc_state of media list player.
source code
 
libvlc_media_list_player_play_item_at_index(p_mlp, i_index)
Play media list item at position index.
source code
 
libvlc_media_list_player_play_item(p_mlp, p_md)
Play the given media item.
source code
 
libvlc_media_list_player_stop(p_mlp)
Stop playing media list.
source code
 
libvlc_media_list_player_next(p_mlp)
Play next item from media list.
source code
 
libvlc_media_list_player_previous(p_mlp)
Play previous item from media list.
source code
 
libvlc_media_list_player_set_playback_mode(p_mlp, e_mode)
Sets the playback mode for the playlist.
source code
 
callbackmethod(callback)
Now obsolete @callbackmethod decorator.
source code
 
libvlc_free(ptr)
Frees an heap allocation returned by a LibVLC function.
source code
 
_dot2int(v)
(INTERNAL) Convert 'i.i.i[.i]' str to int.
source code
 
hex_version()
Return the version of these bindings in hex or 0 if unavailable.
source code
 
libvlc_hex_version()
Return the libvlc version in hex or 0 if unavailable.
source code
 
debug_callback(event, *args, **kwds)
Example callback, useful for debugging.
source code
Variables [hide private]
  logger = <logging.Logger object>
  __libvlc_version__ = '3.0.11'
  __generator_version__ = '1.15'
  build_date = 'Sat Jul 25 15:07:40 2020 3.0.11'
  DEFAULT_ENCODING = 'utf-8'
  PYTHON3 = False
  _internal_guard = <__builtin__.object object>
  _Ints = (<type 'int'>, <type 'long'>)
  _Seqs = (<type 'list'>, <type 'tuple'>)
  _default_instance = None
  _Cfunctions = {}
  _Globals = {'AudioCleanupCb': <class 'vlc.AudioCleanupCb'>, 'A...
  PyFile_FromFd = ctypes.pythonapi.PyFile_FromFd
  PyFile_AsFd = ctypes.pythonapi.PyObject_AsFileDescriptor
  PyFile_FromFile = ctypes.pythonapi.PyFile_FromFile
  PyFile_AsFile = ctypes.pythonapi.PyFile_AsFile
  libc_path = find_library('c')
  libc = ctypes.CDLL(libc_path)
  __package__ = None
  dll = <CDLL 'libvlc.so.5', handle 559e4c088d40 at 7ff531dc6950>
  plugin_path = None
Function Details [hide private]

string_result(result, func, arguments)

source code 

Errcheck function. Returns a string and frees the original pointer.

It assumes the result is a char *.

class_result(classname)

source code 

Errcheck function. Returns a function that creates the specified class.

libvlc_clearerr()

source code 

Clears the LibVLC error status for the current thread. This is optional. By default, the error status is automatically overridden when a new error occurs, and destroyed when the thread exits.

libvlc_vprinterr(fmt, ap)

source code 

Sets the LibVLC error status and message for the current thread. Any previous error is overridden.

Parameters:
  • fmt - the format string.
  • ap - the arguments.
Returns:
a nul terminated string in any case.

libvlc_new(argc, argv)

source code 
Create and initialize a libvlc instance.
This functions accept a list of "command line" arguments similar to the
main(). These arguments affect the LibVLC instance default configuration.
@note
LibVLC may create threads. Therefore, any thread-unsafe process
initialization must be performed before calling L{libvlc_new}(). In particular
and where applicable:
- setlocale() and textdomain(),
- setenv(), unsetenv() and putenv(),
- with the X11 display system, XInitThreads()
  (see also L{libvlc_media_player_set_xwindow}()) and
- on Microsoft Windows, SetErrorMode().
- sigprocmask() shall never be invoked; pthread_sigmask() can be used.
On POSIX systems, the SIGCHLD signal B{must not} be ignored, i.e. the
signal handler must set to SIG_DFL or a function pointer, not SIG_IGN.
Also while LibVLC is active, the wait() function shall not be called, and
any call to waitpid() shall use a strictly positive value for the first
parameter (i.e. the PID). Failure to follow those rules may lead to a
deadlock or a busy loop.
Also on POSIX systems, it is recommended that the SIGPIPE signal be blocked,
even if it is not, in principles, necessary, e.g.:
@code
@endcode
On Microsoft Windows Vista/2008, the process error mode
SEM_FAILCRITICALERRORS flag B{must} be set before using LibVLC.
On later versions, that is optional and unnecessary.
Also on Microsoft Windows (Vista and any later version), setting the default
DLL directories to SYSTEM32 exclusively is strongly recommended for
security reasons:
@code
@endcode.
@param argc: the number of arguments (should be 0).
@param argv: list of arguments (should be None).
@return: the libvlc instance or None in case of error.
@version Arguments are meant to be passed from the command line to LibVLC, just like VLC media player does. The list of valid arguments depends on the LibVLC version, the operating system and platform, and set of available LibVLC plugins. Invalid or unsupported arguments will cause the function to fail (i.e. return None). Also, some arguments may alter the behaviour or otherwise interfere with other LibVLC functions. @warning There is absolutely no warranty or promise of forward, backward and cross-platform compatibility with regards to L{libvlc_new}() arguments. We recommend that you do not use them, other than when debugging.

libvlc_release(p_instance)

source code 

Decrement the reference count of a libvlc instance, and destroy it if it reaches zero.

Parameters:
  • p_instance - the instance to destroy.

libvlc_retain(p_instance)

source code 

Increments the reference count of a libvlc instance. The initial reference count is 1 after libvlc_new() returns.

Parameters:
  • p_instance - the instance to reference.

libvlc_add_intf(p_instance, name)

source code 

Try to start a user interface for the libvlc instance.

Parameters:
  • p_instance - the instance.
  • name - interface name, or None for default.
Returns:
0 on success, -1 on error.

libvlc_set_user_agent(p_instance, name, http)

source code 

Sets the application name. LibVLC passes this as the user agent string when a protocol requires it.

Parameters:
  • p_instance - LibVLC instance.
  • name - human-readable application name, e.g. "FooBar player 1.2.3".
  • http - HTTP User Agent, e.g. "FooBar/1.2.3 Python/2.6.0".

Version: LibVLC 1.1.1 or later.

libvlc_set_app_id(p_instance, id, version, icon)

source code 

Sets some meta-information about the application. See also libvlc_set_user_agent().

Parameters:
  • p_instance - LibVLC instance.
  • id - Java-style application identifier, e.g. "com.acme.foobar".
  • version - application version numbers, e.g. "1.2.3".
  • icon - application icon name, e.g. "foobar".

Version: LibVLC 2.1.0 or later.

libvlc_get_version()

source code 

Retrieve libvlc version. Example: "1.1.0-git The Luggage".

Returns:
a string containing the libvlc version.

libvlc_get_compiler()

source code 

Retrieve libvlc compiler version. Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)".

Returns:
a string containing the libvlc compiler version.

libvlc_get_changeset()

source code 

Retrieve libvlc changeset. Example: "aa9bce0bc4".

Returns:
a string containing the libvlc changeset.

libvlc_event_attach(p_event_manager, i_event_type, f_callback, user_data)

source code 

Register for an event notification.

Parameters:
  • p_event_manager - the event manager to which you want to attach to. Generally it is obtained by vlc_my_object_event_manager() where my_object is the object you want to listen to.
  • i_event_type - the desired event to which we want to listen.
  • f_callback - the function to call when i_event_type occurs.
  • user_data - user provided data to carry with the event.
Returns:
0 on success, ENOMEM on error.

libvlc_event_detach(p_event_manager, i_event_type, f_callback, p_user_data)

source code 

Unregister an event notification.

Parameters:
  • p_event_manager - the event manager.
  • i_event_type - the desired event to which we want to unregister.
  • f_callback - the function to call when i_event_type occurs.
  • p_user_data - user provided data to carry with the event.

libvlc_event_type_name(event_type)

source code 

Get an event's type name.

Parameters:
  • event_type - the desired event.

libvlc_log_get_context(ctx)

source code 
Gets log message debug infos.
This function retrieves self-debug information about a log message:
- the name of the VLC module emitting the message,
- the name of the source code module (i.e. file) and
- the line number within the source code module.
The returned module name and file name will be None if unknown.
The returned line number will similarly be zero if unknown.
@param ctx: message context (as passed to the @ref libvlc_log_cb callback).
@return: module module name storage (or None), file source code file name storage (or None), line source code file line number storage (or None).
@version: LibVLC 2.1.0 or later.

libvlc_log_get_object(ctx, id)

source code 
Gets log message info.
This function retrieves meta-information about a log message:
- the type name of the VLC object emitting the message,
- the object header if any, and
- a temporaly-unique object identifier.
This information is mainly meant for B{manual} troubleshooting.
The returned type name may be "generic" if unknown, but it cannot be None.
The returned header will be None if unset; in current versions, the header
is used to distinguish for VLM inputs.
The returned object ID will be zero if the message is not associated with
any VLC object.
@param ctx: message context (as passed to the @ref libvlc_log_cb callback).
@return: name object name storage (or None), header object header (or None), line source code file line number storage (or None).
@version: LibVLC 2.1.0 or later.

libvlc_log_unset(p_instance)

source code 

Unsets the logging callback. This function deregisters the logging callback for a LibVLC instance. This is rarely needed as the callback is implicitly unset when the instance is destroyed.

Parameters:
  • p_instance - libvlc instance.

Note: This function will wait for any pending callbacks invocation to complete (causing a deadlock if called from within the callback).

Version: LibVLC 2.1.0 or later.

libvlc_log_set(p_instance, cb, data)

source code 

Sets the logging callback for a LibVLC instance. This function is thread-safe: it will wait for any pending callbacks invocation to complete.

Parameters:
  • cb - callback function pointer.
  • data - opaque data pointer for the callback function @note Some log messages (especially debug) are emitted by LibVLC while is being initialized. These messages cannot be captured with this interface. @warning A deadlock may occur if this function is called from the callback.
  • p_instance - libvlc instance.

Version: LibVLC 2.1.0 or later.

libvlc_log_set_file(p_instance, stream)

source code 

Sets up logging to a file.

Parameters:
  • p_instance - libvlc instance.
  • stream - FILE pointer opened for writing (the FILE pointer must remain valid until libvlc_log_unset()).

Version: LibVLC 2.1.0 or later.

libvlc_module_description_list_release(p_list)

source code 

Release a list of module descriptions.

Parameters:
  • p_list - the list to be released.

libvlc_audio_filter_list_get(p_instance)

source code 

Returns a list of audio filters that are available.

Parameters:
  • p_instance - libvlc instance.
Returns:
a list of module descriptions. It should be freed with libvlc_module_description_list_release(). In case of an error, None is returned. See ModuleDescription See libvlc_module_description_list_release.

libvlc_video_filter_list_get(p_instance)

source code 

Returns a list of video filters that are available.

Parameters:
  • p_instance - libvlc instance.
Returns:
a list of module descriptions. It should be freed with libvlc_module_description_list_release(). In case of an error, None is returned. See ModuleDescription See libvlc_module_description_list_release.

libvlc_clock()

source code 

Return the current time as defined by LibVLC. The unit is the microsecond. Time increases monotonically (regardless of time zone changes and RTC adjustements). The origin is arbitrary but consistent across the whole system (e.g. the system uptim, the time since the system was booted).

Note: On systems that support it, the POSIX monotonic clock is used.

libvlc_media_discoverer_new(p_inst, psz_name)

source code 

Create a media discoverer object by name. After this object is created, you should attach to media_list events in order to be notified of new items discovered. You need to call libvlc_media_discoverer_start() in order to start the discovery. See libvlc_media_discoverer_media_list See libvlc_media_discoverer_event_manager See libvlc_media_discoverer_start.

Parameters:
  • p_inst - libvlc instance.
  • psz_name - service name; use libvlc_media_discoverer_list_get() to get a list of the discoverer names available in this libVLC instance.
Returns:
media discover object or None in case of error.

Version: LibVLC 3.0.0 or later.

libvlc_media_discoverer_start(p_mdis)

source code 

Start media discovery. To stop it, call libvlc_media_discoverer_stop() or libvlc_media_discoverer_list_release() directly. See libvlc_media_discoverer_stop.

Parameters:
  • p_mdis - media discover object.
Returns:
-1 in case of error, 0 otherwise.

Version: LibVLC 3.0.0 or later.

libvlc_media_discoverer_stop(p_mdis)

source code 

Stop media discovery. See libvlc_media_discoverer_start.

Parameters:
  • p_mdis - media discover object.

Version: LibVLC 3.0.0 or later.

libvlc_media_discoverer_release(p_mdis)

source code 

Release media discover object. If the reference count reaches 0, then the object will be released.

Parameters:
  • p_mdis - media service discover object.

libvlc_media_discoverer_media_list(p_mdis)

source code 

Get media service discover media list.

Parameters:
  • p_mdis - media service discover object.
Returns:
list of media items.

libvlc_media_discoverer_is_running(p_mdis)

source code 

Query if media service discover object is running.

Parameters:
  • p_mdis - media service discover object.
Returns:
true if running, false if not \libvlc_return_bool.

libvlc_media_discoverer_list_get(p_inst, i_cat, ppp_services)

source code 

Get media discoverer services by category.

Parameters:
  • p_inst - libvlc instance.
  • i_cat - category of services to fetch.
  • ppp_services - address to store an allocated array of media discoverer services (must be freed with libvlc_media_discoverer_list_release() by the caller) [OUT].
Returns:
the number of media discoverer services (0 on error).

Version: LibVLC 3.0.0 and later.

libvlc_media_discoverer_list_release(pp_services, i_count)

source code 

Release an array of media discoverer services.

Parameters:
  • pp_services - array to release.
  • i_count - number of elements in the array.

Version: LibVLC 3.0.0 and later. See libvlc_media_discoverer_list_get().

libvlc_dialog_set_context(p_id, p_context)

source code 

Associate an opaque pointer with the dialog id.

Version: LibVLC 3.0.0 and later.

libvlc_dialog_get_context(p_id)

source code 

Return the opaque pointer associated with the dialog id.

Version: LibVLC 3.0.0 and later.

libvlc_dialog_post_login(p_id, psz_username, psz_password, b_store)

source code 

Post a login answer After this call, p_id won't be valid anymore See libvlc_dialog_cbs.pf_display_login.

Parameters:
  • p_id - id of the dialog.
  • psz_username - valid and non empty string.
  • psz_password - valid string (can be empty).
  • b_store - if true, store the credentials.
Returns:
0 on success, or -1 on error.

Version: LibVLC 3.0.0 and later.

libvlc_dialog_post_action(p_id, i_action)

source code 

Post a question answer After this call, p_id won't be valid anymore See libvlc_dialog_cbs.pf_display_question.

Parameters:
  • p_id - id of the dialog.
  • i_action - 1 for action1, 2 for action2.
Returns:
0 on success, or -1 on error.

Version: LibVLC 3.0.0 and later.

libvlc_dialog_dismiss(p_id)

source code 

Dismiss a dialog After this call, p_id won't be valid anymore See libvlc_dialog_cbs.pf_cancel.

Parameters:
  • p_id - id of the dialog.
Returns:
0 on success, or -1 on error.

Version: LibVLC 3.0.0 and later.

libvlc_media_library_new(p_instance)

source code 

Create an new Media Library object.

Parameters:
  • p_instance - the libvlc instance.
Returns:
a new object or None on error.

libvlc_media_library_release(p_mlib)

source code 

Release media library object. This functions decrements the reference count of the media library object. If it reaches 0, then the object will be released.

Parameters:
  • p_mlib - media library object.

libvlc_media_library_retain(p_mlib)

source code 

Retain a reference to a media library object. This function will increment the reference counting for this object. Use libvlc_media_library_release() to decrement the reference count.

Parameters:
  • p_mlib - media library object.

libvlc_media_library_load(p_mlib)

source code 

Load media library.

Parameters:
  • p_mlib - media library object.
Returns:
0 on success, -1 on error.

libvlc_media_library_media_list(p_mlib)

source code 

Get media library subitems.

Parameters:
  • p_mlib - media library object.
Returns:
media list subitems.

libvlc_vlm_release(p_instance)

source code 

Release the vlm instance related to the given Instance.

Parameters:
  • p_instance - the instance.

libvlc_vlm_add_broadcast(p_instance, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop)

source code 

Add a broadcast, with one input.

Parameters:
  • p_instance - the instance.
  • psz_name - the name of the new broadcast.
  • psz_input - the input MRL.
  • psz_output - the output MRL (the parameter to the "sout" variable).
  • i_options - number of additional options.
  • ppsz_options - additional options.
  • b_enabled - boolean for enabling the new broadcast.
  • b_loop - Should this broadcast be played in loop ?
Returns:
0 on success, -1 on error.

libvlc_vlm_add_vod(p_instance, psz_name, psz_input, i_options, ppsz_options, b_enabled, psz_mux)

source code 

Add a vod, with one input.

Parameters:
  • p_instance - the instance.
  • psz_name - the name of the new vod media.
  • psz_input - the input MRL.
  • i_options - number of additional options.
  • ppsz_options - additional options.
  • b_enabled - boolean for enabling the new vod.
  • psz_mux - the muxer of the vod media.
Returns:
0 on success, -1 on error.

libvlc_vlm_del_media(p_instance, psz_name)

source code 

Delete a media (VOD or broadcast).

Parameters:
  • p_instance - the instance.
  • psz_name - the media to delete.
Returns:
0 on success, -1 on error.

libvlc_vlm_set_enabled(p_instance, psz_name, b_enabled)

source code 

Enable or disable a media (VOD or broadcast).

Parameters:
  • p_instance - the instance.
  • psz_name - the media to work on.
  • b_enabled - the new status.
Returns:
0 on success, -1 on error.

libvlc_vlm_set_output(p_instance, psz_name, psz_output)

source code 

Set the output for a media.

Parameters:
  • p_instance - the instance.
  • psz_name - the media to work on.
  • psz_output - the output MRL (the parameter to the "sout" variable).
Returns:
0 on success, -1 on error.

libvlc_vlm_set_input(p_instance, psz_name, psz_input)

source code 

Set a media's input MRL. This will delete all existing inputs and add the specified one.

Parameters:
  • p_instance - the instance.
  • psz_name - the media to work on.
  • psz_input - the input MRL.
Returns:
0 on success, -1 on error.

libvlc_vlm_add_input(p_instance, psz_name, psz_input)

source code 

Add a media's input MRL. This will add the specified one.

Parameters:
  • p_instance - the instance.
  • psz_name - the media to work on.
  • psz_input - the input MRL.
Returns:
0 on success, -1 on error.

libvlc_vlm_set_loop(p_instance, psz_name, b_loop)

source code 

Set a media's loop status.

Parameters:
  • p_instance - the instance.
  • psz_name - the media to work on.
  • b_loop - the new status.
Returns:
0 on success, -1 on error.

libvlc_vlm_set_mux(p_instance, psz_name, psz_mux)

source code 

Set a media's vod muxer.

Parameters:
  • p_instance - the instance.
  • psz_name - the media to work on.
  • psz_mux - the new muxer.
Returns:
0 on success, -1 on error.

libvlc_vlm_change_media(p_instance, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop)

source code 

Edit the parameters of a media. This will delete all existing inputs and add the specified one.

Parameters:
  • p_instance - the instance.
  • psz_name - the name of the new broadcast.
  • psz_input - the input MRL.
  • psz_output - the output MRL (the parameter to the "sout" variable).
  • i_options - number of additional options.
  • ppsz_options - additional options.
  • b_enabled - boolean for enabling the new broadcast.
  • b_loop - Should this broadcast be played in loop ?
Returns:
0 on success, -1 on error.

libvlc_vlm_play_media(p_instance, psz_name)

source code 

Play the named broadcast.

Parameters:
  • p_instance - the instance.
  • psz_name - the name of the broadcast.
Returns:
0 on success, -1 on error.

libvlc_vlm_stop_media(p_instance, psz_name)

source code 

Stop the named broadcast.

Parameters:
  • p_instance - the instance.
  • psz_name - the name of the broadcast.
Returns:
0 on success, -1 on error.

libvlc_vlm_pause_media(p_instance, psz_name)

source code 

Pause the named broadcast.

Parameters:
  • p_instance - the instance.
  • psz_name - the name of the broadcast.
Returns:
0 on success, -1 on error.

libvlc_vlm_seek_media(p_instance, psz_name, f_percentage)

source code 

Seek in the named broadcast.

Parameters:
  • p_instance - the instance.
  • psz_name - the name of the broadcast.
  • f_percentage - the percentage to seek to.
Returns:
0 on success, -1 on error.

libvlc_vlm_show_media(p_instance, psz_name)

source code 

Return information about the named media as a JSON string representation. This function is mainly intended for debugging use, if you want programmatic access to the state of a vlm_media_instance_t, please use the corresponding libvlc_vlm_get_media_instance_xxx -functions. Currently there are no such functions available for vlm_media_t though.

Parameters:
  • p_instance - the instance.
  • psz_name - the name of the media, if the name is an empty string, all media is described.
Returns:
string with information about named media, or None on error.

libvlc_vlm_get_media_instance_position(p_instance, psz_name, i_instance)

source code 

Get vlm_media instance position by name or instance id.

Parameters:
  • p_instance - a libvlc instance.
  • psz_name - name of vlm media instance.
  • i_instance - instance id.
Returns:
position as float or -1. on error.

libvlc_vlm_get_media_instance_time(p_instance, psz_name, i_instance)

source code 

Get vlm_media instance time by name or instance id.

Parameters:
  • p_instance - a libvlc instance.
  • psz_name - name of vlm media instance.
  • i_instance - instance id.
Returns:
time as integer or -1 on error.

libvlc_vlm_get_media_instance_length(p_instance, psz_name, i_instance)

source code 

Get vlm_media instance length by name or instance id.

Parameters:
  • p_instance - a libvlc instance.
  • psz_name - name of vlm media instance.
  • i_instance - instance id.
Returns:
length of media item or -1 on error.

libvlc_vlm_get_media_instance_rate(p_instance, psz_name, i_instance)

source code 

Get vlm_media instance playback rate by name or instance id.

Parameters:
  • p_instance - a libvlc instance.
  • psz_name - name of vlm media instance.
  • i_instance - instance id.
Returns:
playback rate or -1 on error.

libvlc_vlm_get_media_instance_title(p_instance, psz_name, i_instance)

source code 

Get vlm_media instance title number by name or instance id.

Parameters:
  • p_instance - a libvlc instance.
  • psz_name - name of vlm media instance.
  • i_instance - instance id.
Returns:
title as number or -1 on error.

Bug: will always return 0.

libvlc_vlm_get_media_instance_chapter(p_instance, psz_name, i_instance)

source code 

Get vlm_media instance chapter number by name or instance id.

Parameters:
  • p_instance - a libvlc instance.
  • psz_name - name of vlm media instance.
  • i_instance - instance id.
Returns:
chapter as number or -1 on error.

Bug: will always return 0.

libvlc_vlm_get_media_instance_seekable(p_instance, psz_name, i_instance)

source code 

Is libvlc instance seekable ?

Parameters:
  • p_instance - a libvlc instance.
  • psz_name - name of vlm media instance.
  • i_instance - instance id.
Returns:
1 if seekable, 0 if not, -1 if media does not exist.

Bug: will always return 0.

libvlc_vlm_get_event_manager(p_instance)

source code 

Get libvlc_event_manager from a vlm media. The p_event_manager is immutable, so you don't have to hold the lock.

Parameters:
  • p_instance - a libvlc instance.
Returns:
libvlc_event_manager.

libvlc_media_new_location(p_instance, psz_mrl)

source code 

Create a media with a certain given media resource location, for instance a valid URL.

Parameters:
  • p_instance - the instance.
  • psz_mrl - the media location.
Returns:
the newly created media or None on error.

Note: To refer to a local file with this function, the file://... URI syntax must be used (see IETF RFC3986). We recommend using libvlc_media_new_path() instead when dealing with local files. See libvlc_media_release.

libvlc_media_new_path(p_instance, path)

source code 

Create a media for a certain file path. See libvlc_media_release.

Parameters:
  • p_instance - the instance.
  • path - local filesystem path.
Returns:
the newly created media or None on error.

libvlc_media_new_fd(p_instance, fd)

source code 

Create a media for an already open file descriptor. The file descriptor shall be open for reading (or reading and writing). Regular file descriptors, pipe read descriptors and character device descriptors (including TTYs) are supported on all platforms. Block device descriptors are supported where available. Directory descriptors are supported on systems that provide fdopendir(). Sockets are supported on all platforms where they are file descriptors, i.e. all except Windows.

Parameters:
  • p_instance - the instance.
  • fd - open file descriptor.
Returns:
the newly created media or None on error.

Note: This library will not automatically close the file descriptor under any circumstance. Nevertheless, a file descriptor can usually only be rendered once in a media player. To render it a second time, the file descriptor should probably be rewound to the beginning with lseek(). See libvlc_media_release.

Version: LibVLC 1.1.5 and later.

libvlc_media_new_callbacks(instance, open_cb, read_cb, seek_cb, close_cb, opaque)

source code 

Create a media with custom callbacks to read the data from.

Parameters:
  • instance - LibVLC instance.
  • open_cb - callback to open the custom bitstream input media.
  • read_cb - callback to read data (must not be None).
  • seek_cb - callback to seek, or None if seeking is not supported.
  • close_cb - callback to close the media, or None if unnecessary.
  • opaque - data pointer for the open callback.
Returns:
the newly created media or None on error @note If open_cb is None, the opaque pointer will be passed to read_cb, seek_cb and close_cb, and the stream size will be treated as unknown. @note The callbacks may be called asynchronously (from another thread). A single stream instance need not be reentrant. However the open_cb needs to be reentrant if the media is used by multiple player instances. @warning The callbacks may be used until all or any player instances that were supplied the media item are stopped. See libvlc_media_release.

Version: LibVLC 3.0.0 and later.

libvlc_media_new_as_node(p_instance, psz_name)

source code 

Create a media as an empty node with a given name. See libvlc_media_release.

Parameters:
  • p_instance - the instance.
  • psz_name - the name of the node.
Returns:
the new empty media or None on error.

libvlc_media_add_option(p_md, psz_options)

source code 

Add an option to the media. This option will be used to determine how the media_player will read the media. This allows to use VLC's advanced reading/streaming options on a per-media basis.

Parameters:
  • p_md - the media descriptor.
  • psz_options - the options (as a string).

Note: The options are listed in 'vlc --long-help' from the command line, e.g. "-sout-all". Keep in mind that available options and their semantics vary across LibVLC versions and builds.

Warning: Not all options affects Media objects: Specifically, due to architectural issues most audio and video options, such as text renderer options, have no effects on an individual media. These options must be set through libvlc_new() instead.

libvlc_media_add_option_flag(p_md, psz_options, i_flags)

source code 

Add an option to the media with configurable flags. This option will be used to determine how the media_player will read the media. This allows to use VLC's advanced reading/streaming options on a per-media basis. The options are detailed in vlc --long-help, for instance "--sout-all". Note that all options are not usable on medias: specifically, due to architectural issues, video-related options such as text renderer options cannot be set on a single media. They must be set on the whole libvlc instance instead.

Parameters:
  • p_md - the media descriptor.
  • psz_options - the options (as a string).
  • i_flags - the flags for this option.

libvlc_media_retain(p_md)

source code 

Retain a reference to a media descriptor object (Media). Use libvlc_media_release() to decrement the reference count of a media descriptor object.

Parameters:
  • p_md - the media descriptor.

libvlc_media_release(p_md)

source code 

Decrement the reference count of a media descriptor object. If the reference count is 0, then libvlc_media_release() will release the media descriptor object. It will send out an libvlc_MediaFreed event to all listeners. If the media descriptor object has been released it should not be used again.

Parameters:
  • p_md - the media descriptor.

libvlc_media_get_mrl(p_md)

source code 

Get the media resource locator (mrl) from a media descriptor object.

Parameters:
  • p_md - a media descriptor object.
Returns:
string with mrl of media descriptor object.

libvlc_media_duplicate(p_md)

source code 

Duplicate a media descriptor object.

Parameters:
  • p_md - a media descriptor object.

libvlc_media_get_meta(p_md, e_meta)

source code 

Read the meta of the media. If the media has not yet been parsed this will return None. See libvlc_media_parse See libvlc_media_parse_with_options See libvlc_MediaMetaChanged.

Parameters:
  • p_md - the media descriptor.
  • e_meta - the meta to read.
Returns:
the media's meta.

libvlc_media_set_meta(p_md, e_meta, psz_value)

source code 

Set the meta of the media (this function will not save the meta, call libvlc_media_save_meta in order to save the meta).

Parameters:
  • p_md - the media descriptor.
  • e_meta - the meta to write.
  • psz_value - the media's meta.

libvlc_media_save_meta(p_md)

source code 

Save the meta previously set.

Parameters:
  • p_md - the media desriptor.
Returns:
true if the write operation was successful.

libvlc_media_get_state(p_md)

source code 

Get current state of media descriptor object. Possible media states are libvlc_NothingSpecial=0, libvlc_Opening, libvlc_Playing, libvlc_Paused, libvlc_Stopped, libvlc_Ended, libvlc_Error. See State.

Parameters:
  • p_md - a media descriptor object.
Returns:
state of media descriptor object.

libvlc_media_get_stats(p_md, p_stats)

source code 

Get the current statistics about the media.

Parameters:
  • p_md - : media descriptor object.
  • p_stats - : structure that contain the statistics about the media (this structure must be allocated by the caller).
Returns:
true if the statistics are available, false otherwise \libvlc_return_bool.

libvlc_media_subitems(p_md)

source code 

Get subitems of media descriptor object. This will increment the reference count of supplied media descriptor object. Use libvlc_media_list_release() to decrement the reference counting.

Parameters:
  • p_md - media descriptor object.
Returns:
list of media descriptor subitems or None.

libvlc_media_event_manager(p_md)

source code 

Get event manager from media descriptor object. NOTE: this function doesn't increment reference counting.

Parameters:
  • p_md - a media descriptor object.
Returns:
event manager object.

libvlc_media_get_duration(p_md)

source code 

Get duration (in ms) of media descriptor object item.

Parameters:
  • p_md - media descriptor object.
Returns:
duration of media item or -1 on error.

libvlc_media_parse_with_options(p_md, parse_flag, timeout)

source code 

Parse the media asynchronously with options. This fetches (local or network) art, meta data and/or tracks information. This method is the extended version of libvlc_media_parse_with_options(). To track when this is over you can listen to libvlc_MediaParsedChanged event. However if this functions returns an error, you will not receive any events. It uses a flag to specify parse options (see MediaParseFlag). All these flags can be combined. By default, media is parsed if it's a local file.

Parameters:
  • p_md - media descriptor object.
  • parse_flag - parse options:
  • timeout - maximum time allowed to preparse the media. If -1, the default "preparse-timeout" option will be used as a timeout. If 0, it will wait indefinitely. If > 0, the timeout will be used (in milliseconds).
Returns:
-1 in case of error, 0 otherwise.

Note: Parsing can be aborted with libvlc_media_parse_stop(). See libvlc_MediaParsedChanged See libvlc_media_get_meta See libvlc_media_tracks_get See libvlc_media_get_parsed_status See MediaParseFlag.

Version: LibVLC 3.0.0 or later.

libvlc_media_parse_stop(p_md)

source code 

Stop the parsing of the media When the media parsing is stopped, the libvlc_MediaParsedChanged event will be sent with the libvlc_media_parsed_status_timeout status. See libvlc_media_parse_with_options.

Parameters:
  • p_md - media descriptor object.

Version: LibVLC 3.0.0 or later.

libvlc_media_get_parsed_status(p_md)

source code 

Get Parsed status for media descriptor object. See libvlc_MediaParsedChanged See MediaParsedStatus.

Parameters:
  • p_md - media descriptor object.
Returns:
a value of the MediaParsedStatus enum.

Version: LibVLC 3.0.0 or later.

libvlc_media_set_user_data(p_md, p_new_user_data)

source code 

Sets media descriptor's user_data. user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to an native object that references a Media pointer.

Parameters:
  • p_md - media descriptor object.
  • p_new_user_data - pointer to user data.

libvlc_media_get_user_data(p_md)

source code 

Get media descriptor's user_data. user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to an native object that references a Media pointer.

Parameters:
  • p_md - media descriptor object.

libvlc_media_tracks_get(p_md, tracks)

source code 

Get media descriptor's elementary streams description Note, you need to call libvlc_media_parse() or play the media at least once before calling this function. Not doing this will result in an empty array.

Parameters:
  • p_md - media descriptor object.
  • tracks - address to store an allocated array of Elementary Streams descriptions (must be freed with libvlc_media_tracks_release.
Returns:
the number of Elementary Streams (zero on error).

Version: LibVLC 2.1.0 and later.

libvlc_media_get_codec_description(i_type, i_codec)

source code 

Get codec description from media elementary stream.

Parameters:
Returns:
codec description.

Version: LibVLC 3.0.0 and later. See MediaTrack.

libvlc_media_tracks_release(p_tracks, i_count)

source code 

Release media descriptor's elementary streams description array.

Parameters:
  • p_tracks - tracks info array to release.
  • i_count - number of elements in the array.

Version: LibVLC 2.1.0 and later.

libvlc_media_get_type(p_md)

source code 

Get the media type of the media descriptor object.

Parameters:
  • p_md - media descriptor object.
Returns:
media type.

Version: LibVLC 3.0.0 and later. See MediaType.

libvlc_media_slaves_add(p_md, i_type, i_priority, psz_uri)

source code 

Add a slave to the current media. A slave is an external input source that may contains an additional subtitle track (like a .srt) or an additional audio track (like a .ac3).

Parameters:
  • p_md - media descriptor object.
  • i_type - subtitle or audio.
  • i_priority - from 0 (low priority) to 4 (high priority).
  • psz_uri - Uri of the slave (should contain a valid scheme).
Returns:
0 on success, -1 on error.

Note: This function must be called before the media is parsed (via libvlc_media_parse_with_options()) or before the media is played (via libvlc_media_player_play()).

Version: LibVLC 3.0.0 and later.

libvlc_media_slaves_clear(p_md)

source code 

Clear all slaves previously added by libvlc_media_slaves_add() or internally.

Parameters:
  • p_md - media descriptor object.

Version: LibVLC 3.0.0 and later.

libvlc_media_slaves_get(p_md, ppp_slaves)

source code 

Get a media descriptor's slave list The list will contain slaves parsed by VLC or previously added by libvlc_media_slaves_add(). The typical use case of this function is to save a list of slave in a database for a later use.

Parameters:
  • p_md - media descriptor object.
  • ppp_slaves - address to store an allocated array of slaves (must be freed with libvlc_media_slaves_release()) [OUT].
Returns:
the number of slaves (zero on error).

Version: LibVLC 3.0.0 and later. See libvlc_media_slaves_add.

libvlc_media_slaves_release(pp_slaves, i_count)

source code 

Release a media descriptor's slave list.

Parameters:
  • pp_slaves - slave array to release.
  • i_count - number of elements in the array.

Version: LibVLC 3.0.0 and later.

libvlc_renderer_item_hold(p_item)

source code 

Hold a renderer item, i.e. creates a new reference This functions need to called from the libvlc_RendererDiscovererItemAdded callback if the libvlc user wants to use this item after. (for display or for passing it to the mediaplayer for example).

Returns:
the current item.

Version: LibVLC 3.0.0 or later.

libvlc_renderer_item_release(p_item)

source code 

Releases a renderer item, i.e. decrements its reference counter.

Version: LibVLC 3.0.0 or later.

libvlc_renderer_item_name(p_item)

source code 

Get the human readable name of a renderer item.

Returns:
the name of the item (can't be None, must *not* be freed).

Version: LibVLC 3.0.0 or later.

libvlc_renderer_item_type(p_item)

source code 

Get the type (not translated) of a renderer item. For now, the type can only be "chromecast" ("upnp", "airplay" may come later).

Returns:
the type of the item (can't be None, must *not* be freed).

Version: LibVLC 3.0.0 or later.

libvlc_renderer_item_icon_uri(p_item)

source code 

Get the icon uri of a renderer item.

Returns:
the uri of the item's icon (can be None, must *not* be freed).

Version: LibVLC 3.0.0 or later.

libvlc_renderer_item_flags(p_item)

source code 

Get the flags of a renderer item See LIBVLC_RENDERER_CAN_AUDIO See LIBVLC_RENDERER_CAN_VIDEO.

Returns:
bitwise flag: capabilities of the renderer, see.

Version: LibVLC 3.0.0 or later.

libvlc_renderer_discoverer_new(p_inst, psz_name)

source code 

Create a renderer discoverer object by name After this object is created, you should attach to events in order to be notified of the discoverer events. You need to call libvlc_renderer_discoverer_start() in order to start the discovery. See libvlc_renderer_discoverer_event_manager() See libvlc_renderer_discoverer_start().

Parameters:
Returns:
media discover object or None in case of error.

Version: LibVLC 3.0.0 or later.

libvlc_renderer_discoverer_release(p_rd)

source code 

Release a renderer discoverer object.

Parameters:
  • p_rd - renderer discoverer object.

Version: LibVLC 3.0.0 or later.

libvlc_renderer_discoverer_start(p_rd)

source code 

Start renderer discovery To stop it, call libvlc_renderer_discoverer_stop() or libvlc_renderer_discoverer_release() directly. See libvlc_renderer_discoverer_stop().

Parameters:
  • p_rd - renderer discoverer object.
Returns:
-1 in case of error, 0 otherwise.

Version: LibVLC 3.0.0 or later.

libvlc_renderer_discoverer_stop(p_rd)

source code 

Stop renderer discovery. See libvlc_renderer_discoverer_start().

Parameters:
  • p_rd - renderer discoverer object.

Version: LibVLC 3.0.0 or later.

libvlc_renderer_discoverer_event_manager(p_rd)

source code 

Get the event manager of the renderer discoverer The possible events to attach are @ref libvlc_RendererDiscovererItemAdded and @ref libvlc_RendererDiscovererItemDeleted. The @ref Renderer struct passed to event callbacks is owned by VLC, users should take care of holding/releasing this struct for their internal usage. See libvlc_event_t.u.renderer_discoverer_item_added.item See libvlc_event_t.u.renderer_discoverer_item_removed.item.

Returns:
a valid event manager (can't fail).

Version: LibVLC 3.0.0 or later.

libvlc_renderer_discoverer_list_get(p_inst, ppp_services)

source code 

Get media discoverer services See libvlc_renderer_list_release().

Parameters:
  • p_inst - libvlc instance.
  • ppp_services - address to store an allocated array of renderer discoverer services (must be freed with libvlc_renderer_list_release() by the caller) [OUT].
Returns:
the number of media discoverer services (0 on error).

Version: LibVLC 3.0.0 and later.

libvlc_renderer_discoverer_list_release(pp_services, i_count)

source code 

Release an array of media discoverer services See libvlc_renderer_discoverer_list_get().

Parameters:
  • pp_services - array to release.
  • i_count - number of elements in the array.

Version: LibVLC 3.0.0 and later.

libvlc_media_list_new(p_instance)

source code 

Create an empty media list.

Parameters:
  • p_instance - libvlc instance.
Returns:
empty media list, or None on error.

libvlc_media_list_release(p_ml)

source code 

Release media list created with libvlc_media_list_new().

Parameters:

libvlc_media_list_retain(p_ml)

source code 

Retain reference to a media list.

Parameters:

libvlc_media_list_set_media(p_ml, p_md)

source code 

Associate media instance with this media list instance. If another media instance was present it will be released. The libvlc_media_list_lock should NOT be held upon entering this function.

Parameters:
  • p_ml - a media list instance.
  • p_md - media instance to add.

libvlc_media_list_media(p_ml)

source code 

Get media instance from this media list instance. This action will increase the refcount on the media instance. The libvlc_media_list_lock should NOT be held upon entering this function.

Parameters:
  • p_ml - a media list instance.
Returns:
media instance.

libvlc_media_list_add_media(p_ml, p_md)

source code 

Add media instance to media list The libvlc_media_list_lock should be held upon entering this function.

Parameters:
  • p_ml - a media list instance.
  • p_md - a media instance.
Returns:
0 on success, -1 if the media list is read-only.

libvlc_media_list_insert_media(p_ml, p_md, i_pos)

source code 

Insert media instance in media list on a position The libvlc_media_list_lock should be held upon entering this function.

Parameters:
  • p_ml - a media list instance.
  • p_md - a media instance.
  • i_pos - position in array where to insert.
Returns:
0 on success, -1 if the media list is read-only.

libvlc_media_list_remove_index(p_ml, i_pos)

source code 

Remove media instance from media list on a position The libvlc_media_list_lock should be held upon entering this function.

Parameters:
  • p_ml - a media list instance.
  • i_pos - position in array where to insert.
Returns:
0 on success, -1 if the list is read-only or the item was not found.

libvlc_media_list_count(p_ml)

source code 

Get count on media list items The libvlc_media_list_lock should be held upon entering this function.

Parameters:
  • p_ml - a media list instance.
Returns:
number of items in media list.

libvlc_media_list_item_at_index(p_ml, i_pos)

source code 

List media instance in media list at a position The libvlc_media_list_lock should be held upon entering this function.

Parameters:
  • p_ml - a media list instance.
  • i_pos - position in array where to insert.
Returns:
media instance at position i_pos, or None if not found. In case of success, libvlc_media_retain() is called to increase the refcount on the media.

libvlc_media_list_index_of_item(p_ml, p_md)

source code 

Find index position of List media instance in media list. Warning: the function will return the first matched position. The libvlc_media_list_lock should be held upon entering this function.

Parameters:
  • p_ml - a media list instance.
  • p_md - media instance.
Returns:
position of media instance or -1 if media not found.

libvlc_media_list_is_readonly(p_ml)

source code 

This indicates if this media list is read-only from a user point of view.

Parameters:
  • p_ml - media list instance.
Returns:
1 on readonly, 0 on readwrite \libvlc_return_bool.

libvlc_media_list_lock(p_ml)

source code 

Get lock on media list items.

Parameters:
  • p_ml - a media list instance.

libvlc_media_list_unlock(p_ml)

source code 

Release lock on media list items The libvlc_media_list_lock should be held upon entering this function.

Parameters:
  • p_ml - a media list instance.

libvlc_media_list_event_manager(p_ml)

source code 

Get libvlc_event_manager from this media list instance. The p_event_manager is immutable, so you don't have to hold the lock.

Parameters:
  • p_ml - a media list instance.
Returns:
libvlc_event_manager.

libvlc_media_player_get_fps(p_mi)

source code 

Get movie fps rate This function is provided for backward compatibility. It cannot deal with multiple video tracks. In LibVLC versions prior to 3.0, it would also fail if the file format did not convey the frame rate explicitly. \deprecated Consider using libvlc_media_tracks_get() instead.

Parameters:
  • p_mi - the Media Player.
Returns:
frames per second (fps) for this playing movie, or 0 if unspecified.

libvlc_video_get_height(p_mi)

source code 

Get current video height. \deprecated Use libvlc_video_get_size() instead.

Parameters:
  • p_mi - the media player.
Returns:
the video pixel height or 0 if not applicable.

libvlc_video_get_width(p_mi)

source code 

Get current video width. \deprecated Use libvlc_video_get_size() instead.

Parameters:
  • p_mi - the media player.
Returns:
the video pixel width or 0 if not applicable.

libvlc_video_get_title_description(p_mi)

source code 

Get the description of available titles.

Parameters:
  • p_mi - the media player.
Returns:
list containing description of available titles. It must be freed with libvlc_track_description_list_release().

libvlc_video_get_chapter_description(p_mi, i_title)

source code 

Get the description of available chapters for specific title.

Parameters:
  • p_mi - the media player.
  • i_title - selected title.
Returns:
list containing description of available chapter for title i_title. It must be freed with libvlc_track_description_list_release().

libvlc_video_set_subtitle_file(p_mi, psz_subtitle)

source code 

Set new video subtitle file. \deprecated Use libvlc_media_player_add_slave() instead.

Parameters:
  • p_mi - the media player.
  • psz_subtitle - new video subtitle file.
Returns:
the success status (boolean).

libvlc_toggle_teletext(p_mi)

source code 

Toggle teletext transparent status on video output. \deprecated use libvlc_video_set_teletext() instead.

Parameters:
  • p_mi - the media player.

libvlc_audio_output_device_count(p_instance, psz_audio_output)

source code 

Backward compatibility stub. Do not use in new code. \deprecated Use libvlc_audio_output_device_list_get() instead.

Returns:
always 0.

libvlc_audio_output_device_longname(p_instance, psz_output, i_device)

source code 

Backward compatibility stub. Do not use in new code. \deprecated Use libvlc_audio_output_device_list_get() instead.

Returns:
always None.

libvlc_audio_output_device_id(p_instance, psz_audio_output, i_device)

source code 

Backward compatibility stub. Do not use in new code. \deprecated Use libvlc_audio_output_device_list_get() instead.

Returns:
always None.

libvlc_media_parse(p_md)

source code 
Parse a media.
This fetches (local) art, meta data and tracks information.
The method is synchronous.
\deprecated This function could block indefinitely.
            Use L{libvlc_media_parse_with_options}() instead
See L{libvlc_media_parse_with_options}
See L{libvlc_media_get_meta}
See L{libvlc_media_get_tracks_info}.
@param p_md: media descriptor object.

libvlc_media_parse_async(p_md)

source code 
Parse a media.
This fetches (local) art, meta data and tracks information.
The method is the asynchronous of L{libvlc_media_parse}().
To track when this is over you can listen to libvlc_MediaParsedChanged
event. However if the media was already parsed you will not receive this
event.
\deprecated You can't be sure to receive the libvlc_MediaParsedChanged
            event (you can wait indefinitely for this event).
            Use L{libvlc_media_parse_with_options}() instead
See L{libvlc_media_parse}
See libvlc_MediaParsedChanged
See L{libvlc_media_get_meta}
See L{libvlc_media_get_tracks_info}.
@param p_md: media descriptor object.

libvlc_media_is_parsed(p_md)

source code 
Return true is the media descriptor object is parsed
\deprecated This can return true in case of failure.
            Use L{libvlc_media_get_parsed_status}() instead
See libvlc_MediaParsedChanged.
@param p_md: media descriptor object.
@return: true if media object has been parsed otherwise it returns false \libvlc_return_bool.

libvlc_media_get_tracks_info(p_md)

source code 

Get media descriptor's elementary streams description Note, you need to call libvlc_media_parse() or play the media at least once before calling this function. Not doing this will result in an empty array. \deprecated Use libvlc_media_tracks_get() instead.

Parameters:
  • p_md - media descriptor object.
  • tracks - address to store an allocated array of Elementary Streams descriptions (must be freed by the caller) [OUT].
Returns:
the number of Elementary Streams.

libvlc_media_discoverer_localized_name(p_mdis)

source code 

Get media service discover object its localized name. \deprecated Useless, use libvlc_media_discoverer_list_get() to get the longname of the service discovery.

Parameters:
  • p_mdis - media discover object.
Returns:
localized name or None if the media_discoverer is not started.

libvlc_media_discoverer_event_manager(p_mdis)

source code 

Get event manager from media service discover object. \deprecated Useless, media_discoverer events are only triggered when calling libvlc_media_discoverer_start() and libvlc_media_discoverer_stop().

Parameters:
  • p_mdis - media service discover object.
Returns:
event manager object.

libvlc_wait(p_instance)

source code 

Waits until an interface causes the instance to exit. You should start at least one interface first, using libvlc_add_intf().

Parameters:
  • p_instance - the instance @warning This function wastes one thread doing basically nothing. libvlc_set_exit_handler() should be used instead.

libvlc_get_log_verbosity(p_instance)

source code 

Always returns minus one. This function is only provided for backward compatibility.

Parameters:
  • p_instance - ignored.
Returns:
always -1.

libvlc_set_log_verbosity(p_instance, level)

source code 

This function does nothing. It is only provided for backward compatibility.

Parameters:
  • p_instance - ignored.
  • level - ignored.

libvlc_log_open(p_instance)

source code 

This function does nothing useful. It is only provided for backward compatibility.

Parameters:
  • p_instance - libvlc instance.
Returns:
an unique pointer or None on error.

libvlc_log_close(p_log)

source code 

Frees memory allocated by libvlc_log_open().

Parameters:
  • p_log - libvlc log instance or None.

libvlc_log_count(p_log)

source code 

Always returns zero. This function is only provided for backward compatibility.

Parameters:
  • p_log - ignored.
Returns:
always zero.

libvlc_log_clear(p_log)

source code 

This function does nothing. It is only provided for backward compatibility.

Parameters:
  • p_log - ignored.

libvlc_log_get_iterator(p_log)

source code 

This function does nothing useful. It is only provided for backward compatibility.

Parameters:
  • p_log - ignored.
Returns:
an unique pointer or None on error or if the parameter was None.

libvlc_log_iterator_free(p_iter)

source code 

Frees memory allocated by libvlc_log_get_iterator().

Parameters:
  • p_iter - libvlc log iterator or None.

libvlc_log_iterator_has_next(p_iter)

source code 

Always returns zero. This function is only provided for backward compatibility.

Parameters:
  • p_iter - ignored.
Returns:
always zero.

libvlc_log_iterator_next(p_iter, p_buf)

source code 

Always returns None. This function is only provided for backward compatibility.

Parameters:
  • p_iter - libvlc log iterator or None.
  • p_buf - ignored.
Returns:
always None.

libvlc_playlist_play(p_instance, i_id, i_options, ppsz_options)

source code 

Start playing (if there is any item in the playlist). Additionnal playlist item options can be specified for addition to the item before it is played.

Parameters:
  • p_instance - the playlist instance.
  • i_id - the item to play. If this is a negative number, the next item will be selected. Otherwise, the item with the given ID will be played.
  • i_options - the number of options to add to the item.
  • ppsz_options - the options to add to the item.

libvlc_media_player_new(p_libvlc_instance)

source code 

Create an empty Media Player object.

Parameters:
  • p_libvlc_instance - the libvlc instance in which the Media Player should be created.
Returns:
a new media player object, or None on error.

libvlc_media_player_new_from_media(p_md)

source code 

Create a Media Player object from a Media.

Parameters:
  • p_md - the media. Afterwards the p_md can be safely destroyed.
Returns:
a new media player object, or None on error.

libvlc_media_player_release(p_mi)

source code 

Release a media_player after use Decrement the reference count of a media player object. If the reference count is 0, then libvlc_media_player_release() will release the media player object. If the media player object has been released, then it should not be used again.

Parameters:
  • p_mi - the Media Player to free.

libvlc_media_player_retain(p_mi)

source code 

Retain a reference to a media player object. Use libvlc_media_player_release() to decrement reference count.

Parameters:
  • p_mi - media player object.

libvlc_media_player_set_media(p_mi, p_md)

source code 

Set the media that will be used by the media_player. If any, previous md will be released.

Parameters:
  • p_mi - the Media Player.
  • p_md - the Media. Afterwards the p_md can be safely destroyed.

libvlc_media_player_get_media(p_mi)

source code 

Get the media used by the media_player.

Parameters:
  • p_mi - the Media Player.
Returns:
the media associated with p_mi, or None if no media is associated.

libvlc_media_player_event_manager(p_mi)

source code 

Get the Event Manager from which the media player send event.

Parameters:
  • p_mi - the Media Player.
Returns:
the event manager associated with p_mi.

libvlc_media_player_is_playing(p_mi)

source code 

is_playing.

Parameters:
  • p_mi - the Media Player.
Returns:
1 if the media player is playing, 0 otherwise \libvlc_return_bool.

libvlc_media_player_play(p_mi)

source code 

Play.

Parameters:
  • p_mi - the Media Player.
Returns:
0 if playback started (and was already started), or -1 on error.

libvlc_media_player_set_pause(mp, do_pause)

source code 

Pause or resume (no effect if there is no media).

Parameters:
  • mp - the Media Player.
  • do_pause - play/resume if zero, pause if non-zero.

Version: LibVLC 1.1.1 or later.

libvlc_media_player_pause(p_mi)

source code 

Toggle pause (no effect if there is no media).

Parameters:
  • p_mi - the Media Player.

libvlc_media_player_stop(p_mi)

source code 

Stop (no effect if there is no media).

Parameters:
  • p_mi - the Media Player.

libvlc_media_player_set_renderer(p_mi, p_item)

source code 

Set a renderer to the media player

Parameters:
Returns:
0 on success, -1 on error.

Note: must be called before the first call of libvlc_media_player_play() to take effect. See libvlc_renderer_discoverer_new.

Version: LibVLC 3.0.0 or later.

libvlc_video_set_callbacks(mp, lock, unlock, display, opaque)

source code 
Set callbacks and private data to render decoded video to a custom area
in memory.
Use L{libvlc_video_set_format}() or L{libvlc_video_set_format_callbacks}()
to configure the decoded format.
@warning: Rendering video into custom memory buffers is considerably less
efficient than rendering in a custom window as normal.
For optimal perfomances, VLC media player renders into a custom window, and
does not use this function and associated callbacks. It is B{highly
recommended} that other LibVLC-based application do likewise.
To embed video in a window, use libvlc_media_player_set_xid() or equivalent
depending on the operating system.
If window embedding does not fit the application use case, then a custom
LibVLC video output display plugin is required to maintain optimal video
rendering performances.
The following limitations affect performance:
- Hardware video decoding acceleration will either be disabled completely,
  or require (relatively slow) copy from video/DSP memory to main memory.
- Sub-pictures (subtitles, on-screen display, etc.) must be blent into the
  main picture by the CPU instead of the GPU.
- Depending on the video format, pixel format conversion, picture scaling,
  cropping and/or picture re-orientation, must be performed by the CPU
  instead of the GPU.
- Memory copying is required between LibVLC reference picture buffers and
  application buffers (between lock and unlock callbacks).
@param mp: the media player.
@param lock: callback to lock video memory (must not be None).
@param unlock: callback to unlock video memory (or None if not needed).
@param display: callback to display video (or None if not needed).
@param opaque: private pointer for the three callbacks (as first parameter).
@version: LibVLC 1.1.1 or later.

libvlc_video_set_format(mp, chroma, width, height, pitch)

source code 

Set decoded video chroma and dimensions. This only works in combination with libvlc_video_set_callbacks(), and is mutually exclusive with libvlc_video_set_format_callbacks().

Parameters:
  • mp - the media player.
  • chroma - a four-characters string identifying the chroma (e.g. "RV32" or "YUYV").
  • width - pixel width.
  • height - pixel height.
  • pitch - line pitch (in bytes).

Version: LibVLC 1.1.1 or later.

Bug: All pixel planes are expected to have the same pitch. To use the YCbCr color space with chrominance subsampling, consider using libvlc_video_set_format_callbacks() instead.

libvlc_video_set_format_callbacks(mp, setup, cleanup)

source code 

Set decoded video chroma and dimensions. This only works in combination with libvlc_video_set_callbacks().

Parameters:
  • mp - the media player.
  • setup - callback to select the video format (cannot be None).
  • cleanup - callback to release any allocated resources (or None).

Version: LibVLC 2.0.0 or later.

libvlc_media_player_set_nsobject(p_mi, drawable)

source code 
Set the NSView handler where the media player should render its video output.
Use the vout called "macosx".
The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
protocol:
@code.m
\@protocol VLCOpenGLVideoViewEmbedding <NSObject>
- (void)addVoutSubview:(NSView *)view;
- (void)removeVoutSubview:(NSView *)view;
\@end
@endcode
Or it can be an NSView object.
If you want to use it along with Qt see the QMacCocoaViewContainer. Then
the following code should work:
@code.mm

    NSView *video = [[NSView alloc] init];
    QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
    L{libvlc_media_player_set_nsobject}(mp, video);
    [video release];

@endcode
You can find a live example in VLCVideoView in VLCKit.framework.
@param p_mi: the Media Player.
@param drawable: the drawable that is either an NSView or an object following the VLCOpenGLVideoViewEmbedding protocol.

libvlc_media_player_get_nsobject(p_mi)

source code 

Get the NSView handler previously set with libvlc_media_player_set_nsobject().

Parameters:
  • p_mi - the Media Player.
Returns:
the NSView handler or 0 if none where set.

libvlc_media_player_set_xwindow(p_mi, drawable)

source code 

Set an X Window System drawable where the media player should render its video output. The call takes effect when the playback starts. If it is already started, it might need to be stopped before changes apply. If LibVLC was built without X11 output support, then this function has no effects. By default, LibVLC will capture input events on the video rendering area. Use libvlc_video_set_mouse_input() and libvlc_video_set_key_input() to disable that and deliver events to the parent window / to the application instead. By design, the X11 protocol delivers input events to only one recipient. @warning The application must call the XInitThreads() function from Xlib before libvlc_new(), and before any call to XOpenDisplay() directly or via any other library. Failure to call XInitThreads() will seriously impede LibVLC performance. Calling XOpenDisplay() before XInitThreads() will eventually crash the process. That is a limitation of Xlib.

Parameters:
  • p_mi - media player.
  • drawable - X11 window ID @note The specified identifier must correspond to an existing Input/Output class X11 window. Pixmaps are not currently supported. The default X11 server is assumed, i.e. that specified in the DISPLAY environment variable. @warning LibVLC can deal with invalid X11 handle errors, however some display drivers (EGL, GLX, VA and/or VDPAU) can unfortunately not. Thus the window handle must remain valid until playback is stopped, otherwise the process may abort or crash. @bug No more than one window handle per media player instance can be specified. If the media has multiple simultaneously active video tracks, extra tracks will be rendered into external windows beyond the control of the application.

libvlc_media_player_get_xwindow(p_mi)

source code 

Get the X Window System window identifier previously set with libvlc_media_player_set_xwindow(). Note that this will return the identifier even if VLC is not currently using it (for instance if it is playing an audio-only input).

Parameters:
  • p_mi - the Media Player.
Returns:
an X window ID, or 0 if none where set.

libvlc_media_player_set_hwnd(p_mi, drawable)

source code 

Set a Win32/Win64 API window handle (HWND) where the media player should render its video output. If LibVLC was built without Win32/Win64 API output support, then this has no effects.

Parameters:
  • p_mi - the Media Player.
  • drawable - windows handle of the drawable.

libvlc_media_player_get_hwnd(p_mi)

source code 

Get the Windows API window handle (HWND) previously set with libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC is not currently outputting any video to it.

Parameters:
  • p_mi - the Media Player.
Returns:
a window handle or None if there are none.

libvlc_media_player_set_android_context(p_mi, p_awindow_handler)

source code 

Set the android context.

Parameters:
  • p_mi - the media player.
  • p_awindow_handler - org.videolan.libvlc.AWindow jobject owned by the org.videolan.libvlc.MediaPlayer class from the libvlc-android project.

Version: LibVLC 3.0.0 and later.

libvlc_media_player_set_evas_object(p_mi, p_evas_object)

source code 

Set the EFL Evas Object.

Parameters:
  • p_mi - the media player.
  • p_evas_object - a valid EFL Evas Object (Evas_Object).
Returns:
-1 if an error was detected, 0 otherwise.

Version: LibVLC 3.0.0 and later.

libvlc_audio_set_callbacks(mp, play, pause, resume, flush, drain, opaque)

source code 

Sets callbacks and private data for decoded audio. Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks() to configure the decoded audio format.

Parameters:
  • mp - the media player.
  • play - callback to play audio samples (must not be None).
  • pause - callback to pause playback (or None to ignore).
  • resume - callback to resume playback (or None to ignore).
  • flush - callback to flush audio buffers (or None to ignore).
  • drain - callback to drain audio buffers (or None to ignore).
  • opaque - private pointer for the audio callbacks (as first parameter).

Note: The audio callbacks override any other audio output mechanism. If the callbacks are set, LibVLC will not output audio in any way.

Version: LibVLC 2.0.0 or later.

libvlc_audio_set_volume_callback(mp, set_volume)

source code 

Set callbacks and private data for decoded audio. This only works in combination with libvlc_audio_set_callbacks(). Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks() to configure the decoded audio format.

Parameters:
  • mp - the media player.
  • set_volume - callback to apply audio volume, or None to apply volume in software.

Version: LibVLC 2.0.0 or later.

libvlc_audio_set_format_callbacks(mp, setup, cleanup)

source code 

Sets decoded audio format via callbacks. This only works in combination with libvlc_audio_set_callbacks().

Parameters:
  • mp - the media player.
  • setup - callback to select the audio format (cannot be None).
  • cleanup - callback to release any allocated resources (or None).

Version: LibVLC 2.0.0 or later.

libvlc_audio_set_format(mp, format, rate, channels)

source code 

Sets a fixed decoded audio format. This only works in combination with libvlc_audio_set_callbacks(), and is mutually exclusive with libvlc_audio_set_format_callbacks().

Parameters:
  • mp - the media player.
  • format - a four-characters string identifying the sample format (e.g. "S16N" or "f32l").
  • rate - sample rate (expressed in Hz).
  • channels - channels count.

Version: LibVLC 2.0.0 or later.

libvlc_media_player_get_length(p_mi)

source code 

Get the current movie length (in ms).

Parameters:
  • p_mi - the Media Player.
Returns:
the movie length (in ms), or -1 if there is no media.

libvlc_media_player_get_time(p_mi)

source code 

Get the current movie time (in ms).

Parameters:
  • p_mi - the Media Player.
Returns:
the movie time (in ms), or -1 if there is no media.

libvlc_media_player_set_time(p_mi, i_time)

source code 

Set the movie time (in ms). This has no effect if no media is being played. Not all formats and protocols support this.

Parameters:
  • p_mi - the Media Player.
  • i_time - the movie time (in ms).

libvlc_media_player_get_position(p_mi)

source code 

Get movie position as percentage between 0.0 and 1.0.

Parameters:
  • p_mi - the Media Player.
Returns:
movie position, or -1. in case of error.

libvlc_media_player_set_position(p_mi, f_pos)

source code 

Set movie position as percentage between 0.0 and 1.0. This has no effect if playback is not enabled. This might not work depending on the underlying input format and protocol.

Parameters:
  • p_mi - the Media Player.
  • f_pos - the position.

libvlc_media_player_set_chapter(p_mi, i_chapter)

source code 

Set movie chapter (if applicable).

Parameters:
  • p_mi - the Media Player.
  • i_chapter - chapter number to play.

libvlc_media_player_get_chapter(p_mi)

source code 

Get movie chapter.

Parameters:
  • p_mi - the Media Player.
Returns:
chapter number currently playing, or -1 if there is no media.

libvlc_media_player_get_chapter_count(p_mi)

source code 

Get movie chapter count.

Parameters:
  • p_mi - the Media Player.
Returns:
number of chapters in movie, or -1.

libvlc_media_player_will_play(p_mi)

source code 

Is the player able to play.

Parameters:
  • p_mi - the Media Player.
Returns:
boolean \libvlc_return_bool.

libvlc_media_player_get_chapter_count_for_title(p_mi, i_title)

source code 

Get title chapter count.

Parameters:
  • p_mi - the Media Player.
  • i_title - title.
Returns:
number of chapters in title, or -1.

libvlc_media_player_set_title(p_mi, i_title)

source code 

Set movie title.

Parameters:
  • p_mi - the Media Player.
  • i_title - title number to play.

libvlc_media_player_get_title(p_mi)

source code 

Get movie title.

Parameters:
  • p_mi - the Media Player.
Returns:
title number currently playing, or -1.

libvlc_media_player_get_title_count(p_mi)

source code 

Get movie title count.

Parameters:
  • p_mi - the Media Player.
Returns:
title number count, or -1.

libvlc_media_player_previous_chapter(p_mi)

source code 

Set previous chapter (if applicable).

Parameters:
  • p_mi - the Media Player.

libvlc_media_player_next_chapter(p_mi)

source code 

Set next chapter (if applicable).

Parameters:
  • p_mi - the Media Player.

libvlc_media_player_get_rate(p_mi)

source code 

Get the requested movie play rate.

Parameters:
  • p_mi - the Media Player.
Returns:
movie play rate.

Warning: Depending on the underlying media, the requested rate may be different from the real playback rate.

libvlc_media_player_set_rate(p_mi, rate)

source code 

Set movie play rate.

Parameters:
  • p_mi - the Media Player.
  • rate - movie play rate to set.
Returns:
-1 if an error was detected, 0 otherwise (but even then, it might not actually work depending on the underlying media protocol).

libvlc_media_player_get_state(p_mi)

source code 

Get current movie state.

Parameters:
  • p_mi - the Media Player.
Returns:
the current state of the media player (playing, paused, ...) See State.

libvlc_media_player_has_vout(p_mi)

source code 

How many video outputs does this media player have?

Parameters:
  • p_mi - the media player.
Returns:
the number of video outputs.

libvlc_media_player_is_seekable(p_mi)

source code 

Is this media player seekable?

Parameters:
  • p_mi - the media player.
Returns:
true if the media player can seek \libvlc_return_bool.

libvlc_media_player_can_pause(p_mi)

source code 

Can this media player be paused?

Parameters:
  • p_mi - the media player.
Returns:
true if the media player can pause \libvlc_return_bool.

libvlc_media_player_program_scrambled(p_mi)

source code 

Check if the current program is scrambled.

Parameters:
  • p_mi - the media player.
Returns:
true if the current program is scrambled \libvlc_return_bool.

Version: LibVLC 2.2.0 or later.

libvlc_media_player_next_frame(p_mi)

source code 

Display the next frame (if supported).

Parameters:
  • p_mi - the media player.

libvlc_media_player_navigate(p_mi, navigate)

source code 

Navigate through DVD Menu.

Parameters:
  • p_mi - the Media Player.
  • navigate - the Navigation mode.

Version: libVLC 2.0.0 or later.

libvlc_media_player_set_video_title_display(p_mi, position, timeout)

source code 

Set if, and how, the video title will be shown when media is played.

Parameters:
  • p_mi - the media player.
  • position - position at which to display the title, or libvlc_position_disable to prevent the title from being displayed.
  • timeout - title display timeout in milliseconds (ignored if libvlc_position_disable).

Version: libVLC 2.1.0 or later.

libvlc_media_player_add_slave(p_mi, i_type, psz_uri, b_select)

source code 

Add a slave to the current media player.

Parameters:
  • p_mi - the media player.
  • i_type - subtitle or audio.
  • psz_uri - Uri of the slave (should contain a valid scheme).
  • b_select - True if this slave should be selected when it's loaded.
Returns:
0 on success, -1 on error.

Note: If the player is playing, the slave will be added directly. This call will also update the slave list of the attached Media.

Version: LibVLC 3.0.0 and later. See libvlc_media_slaves_add.

libvlc_track_description_list_release(p_track_description)

source code 

Release (free) TrackDescription.

Parameters:
  • p_track_description - the structure to release.

libvlc_toggle_fullscreen(p_mi)

source code 

Toggle fullscreen status on non-embedded video outputs.

Parameters:
  • p_mi - the media player.

Warning: The same limitations applies to this function as to libvlc_set_fullscreen().

libvlc_set_fullscreen(p_mi, b_fullscreen)

source code 

Enable or disable fullscreen.

Parameters:
  • p_mi - the media player.
  • b_fullscreen - boolean for fullscreen status.

Warning: With most window managers, only a top-level windows can be in full-screen mode. Hence, this function will not operate properly if libvlc_media_player_set_xwindow() was used to embed the video in a non-top-level window. In that case, the embedding window must be reparented to the root window before fullscreen mode is enabled. You will want to reparent it back to its normal parent when disabling fullscreen.

libvlc_get_fullscreen(p_mi)

source code 

Get current fullscreen status.

Parameters:
  • p_mi - the media player.
Returns:
the fullscreen status (boolean) \libvlc_return_bool.

libvlc_video_set_key_input(p_mi, on)

source code 

Enable or disable key press events handling, according to the LibVLC hotkeys configuration. By default and for historical reasons, keyboard events are handled by the LibVLC video widget.

Parameters:
  • p_mi - the media player.
  • on - true to handle key press events, false to ignore them.

Note: On X11, there can be only one subscriber for key press and mouse click events per window. If your application has subscribed to those events for the X window ID of the video widget, then LibVLC will not be able to handle key presses and mouse clicks in any case.

Warning: This function is only implemented for X11 and Win32 at the moment.

libvlc_video_set_mouse_input(p_mi, on)

source code 

Enable or disable mouse click events handling. By default, those events are handled. This is needed for DVD menus to work, as well as a few video filters such as "puzzle". See libvlc_video_set_key_input().

Parameters:
  • p_mi - the media player.
  • on - true to handle mouse click events, false to ignore them.

Warning: This function is only implemented for X11 and Win32 at the moment.

libvlc_video_get_size(p_mi, num)

source code 

Get the pixel dimensions of a video.

Parameters:
  • p_mi - media player.
  • num - number of the video (starting from, and most commonly 0).
Returns:
px pixel width, py pixel height.

libvlc_video_get_cursor(p_mi, num)

source code 

Get the mouse pointer coordinates over a video. Coordinates are expressed in terms of the decoded video resolution, not in terms of pixels on the screen/viewport (to get the latter, you can query your windowing system directly). Either of the coordinates may be negative or larger than the corresponding dimension of the video, if the cursor is outside the rendering area.

Parameters:
  • p_mi - media player.
  • num - number of the video (starting from, and most commonly 0).
Returns:
px abscissa, py ordinate.

Warning: The coordinates may be out-of-date if the pointer is not located on the video rendering area. LibVLC does not track the pointer if it is outside of the video widget.

Note: LibVLC does not support multiple pointers (it does of course support multiple input devices sharing the same pointer) at the moment.

libvlc_video_get_scale(p_mi)

source code 

Get the current video scaling factor. See also libvlc_video_set_scale().

Parameters:
  • p_mi - the media player.
Returns:
the currently configured zoom factor, or 0. if the video is set to fit to the output window/drawable automatically.

libvlc_video_set_scale(p_mi, f_factor)

source code 

Set the video scaling factor. That is the ratio of the number of pixels on screen to the number of pixels in the original decoded video in each dimension. Zero is a special value; it will adjust the video to the output window/drawable (in windowed mode) or the entire screen. Note that not all video outputs support scaling.

Parameters:
  • p_mi - the media player.
  • f_factor - the scaling factor, or zero.

libvlc_video_get_aspect_ratio(p_mi)

source code 

Get current video aspect ratio.

Parameters:
  • p_mi - the media player.
Returns:
the video aspect ratio or None if unspecified (the result must be released with free() or libvlc_free()).

libvlc_video_set_aspect_ratio(p_mi, psz_aspect)

source code 

Set new video aspect ratio.

Parameters:
  • p_mi - the media player.
  • psz_aspect - new video aspect-ratio or None to reset to default @note Invalid aspect ratios are ignored.

libvlc_video_new_viewpoint()

source code 

Create a video viewpoint structure.

Returns:
video viewpoint or None (the result must be released with free() or libvlc_free()).

Version: LibVLC 3.0.0 and later.

libvlc_video_update_viewpoint(p_mi, p_viewpoint, b_absolute)

source code 

Update the video viewpoint information.

Parameters:
  • p_mi - the media player.
  • p_viewpoint - video viewpoint allocated via libvlc_video_new_viewpoint().
  • b_absolute - if true replace the old viewpoint with the new one. If false, increase/decrease it.
Returns:
-1 in case of error, 0 otherwise @note the values are set asynchronously, it will be used by the next frame displayed.

Note: It is safe to call this function before the media player is started.

Version: LibVLC 3.0.0 and later.

libvlc_video_get_spu(p_mi)

source code 

Get current video subtitle.

Parameters:
  • p_mi - the media player.
Returns:
the video subtitle selected, or -1 if none.

libvlc_video_get_spu_count(p_mi)

source code 

Get the number of available video subtitles.

Parameters:
  • p_mi - the media player.
Returns:
the number of available video subtitles.

libvlc_video_get_spu_description(p_mi)

source code 

Get the description of available video subtitles.

Parameters:
  • p_mi - the media player.
Returns:
list containing description of available video subtitles. It must be freed with libvlc_track_description_list_release().

libvlc_video_set_spu(p_mi, i_spu)

source code 

Set new video subtitle.

Parameters:
  • p_mi - the media player.
  • i_spu - video subtitle track to select (i_id from track description).
Returns:
0 on success, -1 if out of range.

libvlc_video_get_spu_delay(p_mi)

source code 

Get the current subtitle delay. Positive values means subtitles are being displayed later, negative values earlier.

Parameters:
  • p_mi - media player.
Returns:
time (in microseconds) the display of subtitles is being delayed.

Version: LibVLC 2.0.0 or later.

libvlc_video_set_spu_delay(p_mi, i_delay)

source code 

Set the subtitle delay. This affects the timing of when the subtitle will be displayed. Positive values result in subtitles being displayed later, while negative values will result in subtitles being displayed earlier. The subtitle delay will be reset to zero each time the media changes.

Parameters:
  • p_mi - media player.
  • i_delay - time (in microseconds) the display of subtitles should be delayed.
Returns:
0 on success, -1 on error.

Version: LibVLC 2.0.0 or later.

libvlc_media_player_get_full_title_descriptions(p_mi, titles)

source code 

Get the full description of available titles.

Parameters:
  • p_mi - the media player.
  • titles - address to store an allocated array of title descriptions descriptions (must be freed with libvlc_title_descriptions_release() by the caller) [OUT].
Returns:
the number of titles (-1 on error).

Version: LibVLC 3.0.0 and later.

libvlc_title_descriptions_release(p_titles, i_count)

source code 

Release a title description.

Parameters:
  • p_titles - title description array to release.
  • i_count - number of title descriptions to release.

Version: LibVLC 3.0.0 and later.

libvlc_media_player_get_full_chapter_descriptions(p_mi, i_chapters_of_title, pp_chapters)

source code 

Get the full description of available chapters.

Parameters:
  • p_mi - the media player.
  • i_chapters_of_title - index of the title to query for chapters (uses current title if set to -1).
  • pp_chapters - address to store an allocated array of chapter descriptions descriptions (must be freed with libvlc_chapter_descriptions_release() by the caller) [OUT].
Returns:
the number of chapters (-1 on error).

Version: LibVLC 3.0.0 and later.

libvlc_chapter_descriptions_release(p_chapters, i_count)

source code 

Release a chapter description.

Parameters:
  • p_chapters - chapter description array to release.
  • i_count - number of chapter descriptions to release.

Version: LibVLC 3.0.0 and later.

libvlc_video_get_crop_geometry(p_mi)

source code 

Get current crop filter geometry.

Parameters:
  • p_mi - the media player.
Returns:
the crop filter geometry or None if unset.

libvlc_video_set_crop_geometry(p_mi, psz_geometry)

source code 

Set new crop filter geometry.

Parameters:
  • p_mi - the media player.
  • psz_geometry - new crop filter geometry (None to unset).

libvlc_video_get_teletext(p_mi)

source code 

Get current teletext page requested or 0 if it's disabled. Teletext is disabled by default, call libvlc_video_set_teletext() to enable it.

Parameters:
  • p_mi - the media player.
Returns:
the current teletext page requested.

libvlc_video_set_teletext(p_mi, i_page)

source code 

Set new teletext page to retrieve. This function can also be used to send a teletext key.

Parameters:
  • p_mi - the media player.
  • i_page - teletex page number requested. This value can be 0 to disable teletext, a number in the range ]0;1000[ to show the requested page, or a ef TeletextKey. 100 is the default teletext page.

libvlc_video_get_track_count(p_mi)

source code 

Get number of available video tracks.

Parameters:
  • p_mi - media player.
Returns:
the number of available video tracks (int).

libvlc_video_get_track_description(p_mi)

source code 

Get the description of available video tracks.

Parameters:
  • p_mi - media player.
Returns:
list with description of available video tracks, or None on error. It must be freed with libvlc_track_description_list_release().

libvlc_video_get_track(p_mi)

source code 

Get current video track.

Parameters:
  • p_mi - media player.
Returns:
the video track ID (int) or -1 if no active input.

libvlc_video_set_track(p_mi, i_track)

source code 

Set video track.

Parameters:
  • p_mi - media player.
  • i_track - the track ID (i_id field from track description).
Returns:
0 on success, -1 if out of range.

libvlc_video_take_snapshot(p_mi, num, psz_filepath, i_width, i_height)

source code 

Take a snapshot of the current video window. If i_width AND i_height is 0, original size is used. If i_width XOR i_height is 0, original aspect-ratio is preserved.

Parameters:
  • p_mi - media player instance.
  • num - number of video output (typically 0 for the first/only one).
  • psz_filepath - the path of a file or a folder to save the screenshot into.
  • i_width - the snapshot's width.
  • i_height - the snapshot's height.
Returns:
0 on success, -1 if the video was not found.

libvlc_video_set_deinterlace(p_mi, psz_mode)

source code 

Enable or disable deinterlace filter.

Parameters:
  • p_mi - libvlc media player.
  • psz_mode - type of deinterlace filter, None to disable.

libvlc_video_get_marquee_int(p_mi, option)

source code 

Get an integer marquee option value.

Parameters:
  • p_mi - libvlc media player.
  • option - marq option to get See libvlc_video_marquee_int_option_t.

libvlc_video_get_marquee_string(p_mi, option)

source code 

Get a string marquee option value.

Parameters:
  • p_mi - libvlc media player.
  • option - marq option to get See libvlc_video_marquee_string_option_t.

libvlc_video_set_marquee_int(p_mi, option, i_val)

source code 

Enable, disable or set an integer marquee option Setting libvlc_marquee_Enable has the side effect of enabling (arg !0) or disabling (arg 0) the marq filter.

Parameters:
  • p_mi - libvlc media player.
  • option - marq option to set See libvlc_video_marquee_int_option_t.
  • i_val - marq option value.

libvlc_video_set_marquee_string(p_mi, option, psz_text)

source code 

Set a marquee string option.

Parameters:
  • p_mi - libvlc media player.
  • option - marq option to set See libvlc_video_marquee_string_option_t.
  • psz_text - marq option value.

libvlc_video_get_logo_int(p_mi, option)

source code 

Get integer logo option.

Parameters:
  • p_mi - libvlc media player instance.
  • option - logo option to get, values of VideoLogoOption.

libvlc_video_set_logo_int(p_mi, option, value)

source code 

Set logo option as integer. Options that take a different type value are ignored. Passing libvlc_logo_enable as option value has the side effect of starting (arg !0) or stopping (arg 0) the logo filter.

Parameters:
  • p_mi - libvlc media player instance.
  • option - logo option to set, values of VideoLogoOption.
  • value - logo option value.

libvlc_video_set_logo_string(p_mi, option, psz_value)

source code 

Set logo option as string. Options that take a different type value are ignored.

Parameters:
  • p_mi - libvlc media player instance.
  • option - logo option to set, values of VideoLogoOption.
  • psz_value - logo option value.

libvlc_video_get_adjust_int(p_mi, option)

source code 

Get integer adjust option.

Parameters:
  • p_mi - libvlc media player instance.
  • option - adjust option to get, values of VideoAdjustOption.

Version: LibVLC 1.1.1 and later.

libvlc_video_set_adjust_int(p_mi, option, value)

source code 

Set adjust option as integer. Options that take a different type value are ignored. Passing libvlc_adjust_enable as option value has the side effect of starting (arg !0) or stopping (arg 0) the adjust filter.

Parameters:
  • p_mi - libvlc media player instance.
  • option - adust option to set, values of VideoAdjustOption.
  • value - adjust option value.

Version: LibVLC 1.1.1 and later.

libvlc_video_get_adjust_float(p_mi, option)

source code 

Get float adjust option.

Parameters:
  • p_mi - libvlc media player instance.
  • option - adjust option to get, values of VideoAdjustOption.

Version: LibVLC 1.1.1 and later.

libvlc_video_set_adjust_float(p_mi, option, value)

source code 

Set adjust option as float. Options that take a different type value are ignored.

Parameters:
  • p_mi - libvlc media player instance.
  • option - adust option to set, values of VideoAdjustOption.
  • value - adjust option value.

Version: LibVLC 1.1.1 and later.

libvlc_audio_output_list_get(p_instance)

source code 

Gets the list of available audio output modules.

Parameters:
  • p_instance - libvlc instance.
Returns:
list of available audio outputs. It must be freed with In case of error, None is returned.

libvlc_audio_output_list_release(p_list)

source code 

Frees the list of available audio output modules.

Parameters:
  • p_list - list with audio outputs for release.

libvlc_audio_output_set(p_mi, psz_name)

source code 

Selects an audio output module.

Parameters:
  • p_mi - media player.
  • psz_name - name of audio output, use psz_name of See AudioOutput.
Returns:
0 if function succeeded, -1 on error.

Note: Any change will take be effect only after playback is stopped and restarted. Audio output cannot be changed while playing.

libvlc_audio_output_device_enum(mp)

source code 

Gets a list of potential audio output devices, See libvlc_audio_output_device_set().

Parameters:
  • mp - media player.
Returns:
A None-terminated linked list of potential audio output devices. It must be freed with libvlc_audio_output_device_list_release().
Notes:
  • Not all audio outputs support enumerating devices. The audio output may be functional even if the list is empty (None).
  • The list may not be exhaustive.

Warning: Some audio output devices in the list might not actually work in some circumstances. By default, it is recommended to not specify any explicit audio device.

Version: LibVLC 2.2.0 or later.

libvlc_audio_output_device_list_get(p_instance, aout)

source code 

Gets a list of audio output devices for a given audio output module, See libvlc_audio_output_device_set().

Parameters:
Returns:
A None-terminated linked list of potential audio output devices. It must be freed with libvlc_audio_output_device_list_release().
Notes:
  • Not all audio outputs support this. In particular, an empty (None) list of devices does not imply that the specified audio output does not work.
  • The list might not be exhaustive.

Warning: Some audio output devices in the list might not actually work in some circumstances. By default, it is recommended to not specify any explicit audio device.

Version: LibVLC 2.1.0 or later.

libvlc_audio_output_device_list_release(p_list)

source code 

Frees a list of available audio output devices.

Parameters:
  • p_list - list with audio outputs for release.

Version: LibVLC 2.1.0 or later.

libvlc_audio_output_device_set(mp, module, device_id)

source code 

Configures an explicit audio output device. If the module paramater is None, audio output will be moved to the device specified by the device identifier string immediately. This is the recommended usage. A list of adequate potential device strings can be obtained with libvlc_audio_output_device_enum(). However passing None is supported in LibVLC version 2.2.0 and later only; in earlier versions, this function would have no effects when the module parameter was None. If the module parameter is not None, the device parameter of the corresponding audio output, if it exists, will be set to the specified string. Note that some audio output modules do not have such a parameter (notably MMDevice and PulseAudio). A list of adequate potential device strings can be obtained with libvlc_audio_output_device_list_get().

Parameters:
  • mp - media player.
  • module - If None, current audio output module. if non-None, name of audio output module.
  • device_id - device identifier string.
Returns:
Nothing. Errors are ignored (this is a design bug).

Note: This function does not select the specified audio output plugin. libvlc_audio_output_set() is used for that purpose.

Warning: The syntax for the device parameter depends on the audio output. Some audio output modules require further parameters (e.g. a channels map in the case of ALSA).

libvlc_audio_output_device_get(mp)

source code 

Get the current audio output device identifier. This complements libvlc_audio_output_device_set().

Parameters:
  • mp - media player.
Returns:
the current audio output device identifier None if no device is selected or in case of error (the result must be released with free() or libvlc_free()).

Warning: The initial value for the current audio output device identifier may not be set or may be some unknown value. A LibVLC application should compare this value against the known device identifiers (e.g. those that were previously retrieved by a call to libvlc_audio_output_device_enum or libvlc_audio_output_device_list_get) to find the current audio output device. It is possible that the selected audio output device changes (an external change) without a call to libvlc_audio_output_device_set. That may make this method unsuitable to use if a LibVLC application is attempting to track dynamic audio device changes as they happen.

Version: LibVLC 3.0.0 or later.

libvlc_audio_toggle_mute(p_mi)

source code 

Toggle mute status.

Parameters:
  • p_mi - media player @warning Toggling mute atomically is not always possible: On some platforms, other processes can mute the VLC audio playback stream asynchronously. Thus, there is a small race condition where toggling will not work. See also the limitations of libvlc_audio_set_mute().

libvlc_audio_get_mute(p_mi)

source code 

Get current mute status.

Parameters:
  • p_mi - media player.
Returns:
the mute status (boolean) if defined, -1 if undefined/unapplicable.

libvlc_audio_set_mute(p_mi, status)

source code 

Set mute status.

Parameters:
  • p_mi - media player.
  • status - If status is true then mute, otherwise unmute @warning This function does not always work. If there are no active audio playback stream, the mute status might not be available. If digital pass-through (S/PDIF, HDMI...) is in use, muting may be unapplicable. Also some audio output plugins do not support muting at all. @note To force silent playback, disable all audio tracks. This is more efficient and reliable than mute.

libvlc_audio_get_volume(p_mi)

source code 

Get current software audio volume.

Parameters:
  • p_mi - media player.
Returns:
the software volume in percents (0 = mute, 100 = nominal / 0dB).

libvlc_audio_set_volume(p_mi, i_volume)

source code 

Set current software audio volume.

Parameters:
  • p_mi - media player.
  • i_volume - the volume in percents (0 = mute, 100 = 0dB).
Returns:
0 if the volume was set, -1 if it was out of range.

libvlc_audio_get_track_count(p_mi)

source code 

Get number of available audio tracks.

Parameters:
  • p_mi - media player.
Returns:
the number of available audio tracks (int), or -1 if unavailable.

libvlc_audio_get_track_description(p_mi)

source code 

Get the description of available audio tracks.

Parameters:
  • p_mi - media player.
Returns:
list with description of available audio tracks, or None. It must be freed with libvlc_track_description_list_release().

libvlc_audio_get_track(p_mi)

source code 

Get current audio track.

Parameters:
  • p_mi - media player.
Returns:
the audio track ID or -1 if no active input.

libvlc_audio_set_track(p_mi, i_track)

source code 

Set current audio track.

Parameters:
  • p_mi - media player.
  • i_track - the track ID (i_id field from track description).
Returns:
0 on success, -1 on error.

libvlc_audio_get_channel(p_mi)

source code 

Get current audio channel.

Parameters:
  • p_mi - media player.
Returns:
the audio channel See AudioOutputChannel.

libvlc_audio_set_channel(p_mi, channel)

source code 

Set current audio channel.

Parameters:
Returns:
0 on success, -1 on error.

libvlc_audio_get_delay(p_mi)

source code 

Get current audio delay.

Parameters:
  • p_mi - media player.
Returns:
the audio delay (microseconds).

Version: LibVLC 1.1.1 or later.

libvlc_audio_set_delay(p_mi, i_delay)

source code 

Set current audio delay. The audio delay will be reset to zero each time the media changes.

Parameters:
  • p_mi - media player.
  • i_delay - the audio delay (microseconds).
Returns:
0 on success, -1 on error.

Version: LibVLC 1.1.1 or later.

libvlc_audio_equalizer_get_preset_count()

source code 

Get the number of equalizer presets.

Returns:
number of presets.

Version: LibVLC 2.2.0 or later.

libvlc_audio_equalizer_get_preset_name(u_index)

source code 

Get the name of a particular equalizer preset. This name can be used, for example, to prepare a preset label or menu in a user interface.

Parameters:
  • u_index - index of the preset, counting from zero.
Returns:
preset name, or None if there is no such preset.

Version: LibVLC 2.2.0 or later.

libvlc_audio_equalizer_get_band_count()

source code 

Get the number of distinct frequency bands for an equalizer.

Returns:
number of frequency bands.

Version: LibVLC 2.2.0 or later.

libvlc_audio_equalizer_get_band_frequency(u_index)

source code 

Get a particular equalizer band frequency. This value can be used, for example, to create a label for an equalizer band control in a user interface.

Parameters:
  • u_index - index of the band, counting from zero.
Returns:
equalizer band frequency (Hz), or -1 if there is no such band.

Version: LibVLC 2.2.0 or later.

libvlc_audio_equalizer_new()

source code 

Create a new default equalizer, with all frequency values zeroed. The new equalizer can subsequently be applied to a media player by invoking libvlc_media_player_set_equalizer(). The returned handle should be freed via libvlc_audio_equalizer_release() when it is no longer needed.

Returns:
opaque equalizer handle, or None on error.

Version: LibVLC 2.2.0 or later.

libvlc_audio_equalizer_new_from_preset(u_index)

source code 

Create a new equalizer, with initial frequency values copied from an existing preset. The new equalizer can subsequently be applied to a media player by invoking libvlc_media_player_set_equalizer(). The returned handle should be freed via libvlc_audio_equalizer_release() when it is no longer needed.

Parameters:
  • u_index - index of the preset, counting from zero.
Returns:
opaque equalizer handle, or None on error.

Version: LibVLC 2.2.0 or later.

libvlc_audio_equalizer_release(p_equalizer)

source code 

Release a previously created equalizer instance. The equalizer was previously created by using libvlc_audio_equalizer_new() or libvlc_audio_equalizer_new_from_preset(). It is safe to invoke this method with a None p_equalizer parameter for no effect.

Parameters:
  • p_equalizer - opaque equalizer handle, or None.

Version: LibVLC 2.2.0 or later.

libvlc_audio_equalizer_set_preamp(p_equalizer, f_preamp)

source code 

Set a new pre-amplification value for an equalizer. The new equalizer settings are subsequently applied to a media player by invoking libvlc_media_player_set_equalizer(). The supplied amplification value will be clamped to the -20.0 to +20.0 range.

Parameters:
  • p_equalizer - valid equalizer handle, must not be None.
  • f_preamp - preamp value (-20.0 to 20.0 Hz).
Returns:
zero on success, -1 on error.

Version: LibVLC 2.2.0 or later.

libvlc_audio_equalizer_get_preamp(p_equalizer)

source code 

Get the current pre-amplification value from an equalizer.

Parameters:
  • p_equalizer - valid equalizer handle, must not be None.
Returns:
preamp value (Hz).

Version: LibVLC 2.2.0 or later.

libvlc_audio_equalizer_set_amp_at_index(p_equalizer, f_amp, u_band)

source code 

Set a new amplification value for a particular equalizer frequency band. The new equalizer settings are subsequently applied to a media player by invoking libvlc_media_player_set_equalizer(). The supplied amplification value will be clamped to the -20.0 to +20.0 range.

Parameters:
  • p_equalizer - valid equalizer handle, must not be None.
  • f_amp - amplification value (-20.0 to 20.0 Hz).
  • u_band - index, counting from zero, of the frequency band to set.
Returns:
zero on success, -1 on error.

Version: LibVLC 2.2.0 or later.

libvlc_audio_equalizer_get_amp_at_index(p_equalizer, u_band)

source code 

Get the amplification value for a particular equalizer frequency band.

Parameters:
  • p_equalizer - valid equalizer handle, must not be None.
  • u_band - index, counting from zero, of the frequency band to get.
Returns:
amplification value (Hz); NaN if there is no such frequency band.

Version: LibVLC 2.2.0 or later.

libvlc_media_player_set_equalizer(p_mi, p_equalizer)

source code 

Apply new equalizer settings to a media player. The equalizer is first created by invoking libvlc_audio_equalizer_new() or libvlc_audio_equalizer_new_from_preset(). It is possible to apply new equalizer settings to a media player whether the media player is currently playing media or not. Invoking this method will immediately apply the new equalizer settings to the audio output of the currently playing media if there is any. If there is no currently playing media, the new equalizer settings will be applied later if and when new media is played. Equalizer settings will automatically be applied to subsequently played media. To disable the equalizer for a media player invoke this method passing None for the p_equalizer parameter. The media player does not keep a reference to the supplied equalizer so it is safe for an application to release the equalizer reference any time after this method returns.

Parameters:
  • p_mi - opaque media player handle.
  • p_equalizer - opaque equalizer handle, or None to disable the equalizer for this media player.
Returns:
zero on success, -1 on error.

Version: LibVLC 2.2.0 or later.

libvlc_media_player_get_role(p_mi)

source code 

Gets the media role.

Parameters:
  • p_mi - media player.
Returns:
the media player role ( ef libvlc_media_player_role_t).

Version: LibVLC 3.0.0 and later.

libvlc_media_player_set_role(p_mi, role)

source code 

Sets the media role.

Parameters:
  • p_mi - media player.
  • role - the media player role ( ef libvlc_media_player_role_t).
Returns:
0 on success, -1 on error.

libvlc_media_list_player_new(p_instance)

source code 

Create new media_list_player.

Parameters:
  • p_instance - libvlc instance.
Returns:
media list player instance or None on error.

libvlc_media_list_player_release(p_mlp)

source code 

Release a media_list_player after use Decrement the reference count of a media player object. If the reference count is 0, then libvlc_media_list_player_release() will release the media player object. If the media player object has been released, then it should not be used again.

Parameters:
  • p_mlp - media list player instance.

libvlc_media_list_player_retain(p_mlp)

source code 

Retain a reference to a media player list object. Use libvlc_media_list_player_release() to decrement reference count.

Parameters:
  • p_mlp - media player list object.

libvlc_media_list_player_event_manager(p_mlp)

source code 

Return the event manager of this media_list_player.

Parameters:
  • p_mlp - media list player instance.
Returns:
the event manager.

libvlc_media_list_player_set_media_player(p_mlp, p_mi)

source code 

Replace media player in media_list_player with this instance.

Parameters:
  • p_mlp - media list player instance.
  • p_mi - media player instance.

libvlc_media_list_player_get_media_player(p_mlp)

source code 

Get media player of the media_list_player instance.

Parameters:
  • p_mlp - media list player instance.
Returns:
media player instance @note the caller is responsible for releasing the returned instance.

libvlc_media_list_player_set_media_list(p_mlp, p_mlist)

source code 

Set the media list associated with the player.

Parameters:
  • p_mlp - media list player instance.
  • p_mlist - list of media.

libvlc_media_list_player_play(p_mlp)

source code 

Play media list.

Parameters:
  • p_mlp - media list player instance.

libvlc_media_list_player_pause(p_mlp)

source code 

Toggle pause (or resume) media list.

Parameters:
  • p_mlp - media list player instance.

libvlc_media_list_player_set_pause(p_mlp, do_pause)

source code 

Pause or resume media list.

Parameters:
  • p_mlp - media list player instance.
  • do_pause - play/resume if zero, pause if non-zero.

Version: LibVLC 3.0.0 or later.

libvlc_media_list_player_is_playing(p_mlp)

source code 

Is media list playing?

Parameters:
  • p_mlp - media list player instance.
Returns:
true for playing and false for not playing \libvlc_return_bool.

libvlc_media_list_player_get_state(p_mlp)

source code 

Get current libvlc_state of media list player.

Parameters:
  • p_mlp - media list player instance.
Returns:
State for media list player.

libvlc_media_list_player_play_item_at_index(p_mlp, i_index)

source code 

Play media list item at position index.

Parameters:
  • p_mlp - media list player instance.
  • i_index - index in media list to play.
Returns:
0 upon success -1 if the item wasn't found.

libvlc_media_list_player_play_item(p_mlp, p_md)

source code 

Play the given media item.

Parameters:
  • p_mlp - media list player instance.
  • p_md - the media instance.
Returns:
0 upon success, -1 if the media is not part of the media list.

libvlc_media_list_player_stop(p_mlp)

source code 

Stop playing media list.

Parameters:
  • p_mlp - media list player instance.

libvlc_media_list_player_next(p_mlp)

source code 

Play next item from media list.

Parameters:
  • p_mlp - media list player instance.
Returns:
0 upon success -1 if there is no next item.

libvlc_media_list_player_previous(p_mlp)

source code 

Play previous item from media list.

Parameters:
  • p_mlp - media list player instance.
Returns:
0 upon success -1 if there is no previous item.

libvlc_media_list_player_set_playback_mode(p_mlp, e_mode)

source code 

Sets the playback mode for the playlist.

Parameters:
  • p_mlp - media list player instance.
  • e_mode - playback mode specification.

libvlc_free(ptr)

source code 

Frees an heap allocation returned by a LibVLC function. If you know you're using the same underlying C run-time as the LibVLC implementation, then you can call ANSI C free() directly instead.

Parameters:
  • ptr - the pointer.

Variables Details [hide private]

_Globals

Value:
{'AudioCleanupCb': <class 'vlc.AudioCleanupCb'>,
 'AudioDrainCb': <class 'vlc.AudioDrainCb'>,
 'AudioEqualizer': <class 'vlc.AudioEqualizer'>,
 'AudioFlushCb': <class 'vlc.AudioFlushCb'>,
 'AudioOutput': <class 'vlc.AudioOutput'>,
 'AudioOutputChannel': <class 'vlc.AudioOutputChannel'>,
 'AudioOutputDevice': <class 'vlc.AudioOutputDevice'>,
 'AudioOutputDeviceTypes': <class 'vlc.AudioOutputDeviceTypes'>,
...