3

I want to edit playlist files of VLC in Android as we can do in windows (.xspf files) I have searched in Android/data/org.videolan.vlc path but did't find anywhere.

2 Answers 2

5

The playlists and other media informations are stored in this database file:

/data/data/org.videolan.vlc/app_db/vlc_media.db 

The easiest method so far is to modify the playlists from inside the app by adding/removing media files from/to them.

However, if you have root access to your phone/tablet, an sqlite editor/reader (you can get one here), basic knowledge of SQL and a bit of patience you can modify the playlists by doing the following:

Navigate to /data/data/org.videolan.vlc/app_db and copy vlc_media.db to a folder you have full permission.

Open the copied file mentioned above with the SQL editor app. In the 'Tables' tab, you will see all the tables among them Playlist, Media, PlaylistMediaRelation, AudioTrack and VideoTrack.

In the 'Sql Editor' tab, insert the code below to get a list of all playlists and their files, then click on 'Run':

SELECT id_playlist, name, filename 
FROM Playlist
Inner Join playlistmediarelation ON playlist_id=id_playlist
Inner Join Media ON id_media=media_id
WHERE name = 'your_playlist_name'
ORDER BY id_playlist

To check your media files with their IDs:

SELECT id_media, filename
FROM Media

From these information, you can modify your playlist(s):

  • To insert/append media to playlist:

    INSERT INTO PlaylistMediaRelation(media_id,playlist_id) 
    VALUES(520,1)
    
  • To delete multiples media files:

    DELETE FROM PlaylistMediaRelation
    WHERE media_id IN (456, 520) AND playlist_id=2
    
  • To update a media:

    UPDATE PlaylistMediaRelation
    SET media_id=321
    WHERE media_id=476 AND playlist_id=7
    

Don't forget to copy the file back to the original folder.

Note: The numbers for id in the code are just examples.

4
  • Is there any app which stores Playlists files as plain text file (like vlc does as .xspf files) and capable of playing all kinds of media files including streaming?
    – Harry
    Commented Dec 25, 2017 at 4:17
  • The only app that i have found so far is this one. It is not a media player but it allows you to backup/export your playlist from system, Google Play Muic and Poweramp in plain text. Commented Dec 25, 2017 at 14:27
  • Try BlackPlayer. It can export playlists as m3u files. Commented Dec 25, 2017 at 14:54
  • The SQL Editor (github.com/sqlitebrowser/sqlitebrowser/releases) can not open that DB: "malformed database schema"... :-( Commented Nov 1, 2021 at 2:51
1

Just in case someone is having troubles to access the directory where VLC has the DB (/data/org.videolan.vlc), you can also export the database in Settings > Advanced > "Dump app database".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .