[vlc-devel] extracting file name from vlc (vinod kumar)

Harold André harold.andre at scentys.com
Wed May 22 17:11:47 CEST 2013

> hi,
> i am new vlc developer i want to extract the filename of the current video
> thats being played from which module i can get the lead please help me.
> thank you,

I am also a new developer vlc, so take my advice with caution.

To retrieve the name of the video currently being played I do this:

playlist_t *p_playlist = NULL;
input_thread_t *p_input = NULL;
input_item_t *p_item = NULL;
char *psz_uri = NULL;
char *psz_video_filename = NULL;

if(p_intf) p_playlist = pl_Get( p_intf );

if( p_playlist ) p_input = playlist_CurrentInput( p_playlist );

if( p_input) p_item = input_GetItem( p_input );

if( p_item ) {
    psz_uri = input_item_GetURI( p_item );
    psz_video_filename = input_item_GetName( p_item );

And to convert a URI to a local (UTF-8-encoded) file path, use:

"make_path(psz_uri)" and include "vlc_url.h"

I hope this help.

More information about the vlc-devel mailing list