Save Media Information / metadata

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
JeremyCanfield
New Cone
New Cone
Posts: 2
Joined: 14 Jul 2015 17:00

Save Media Information / metadata

Postby JeremyCanfield » 14 Jul 2015 17:06

In VLC, if I select Tools -> Media Information, I can manually update the Media Information, such as the song name, band name, album name, et cetera. I've over 10,000 audio files, so it's going to take me a long time to update these one by one. I only want to do this job once. Some day, I'll probably want to move VLC to a new Hard Drive or Solid State Drive, and I wouldn't want to have to manually update the Media Information in VLC for over 10,000 audio files again, one by one.

When updating the Media Information, I assume this update must be written to some file somewhere. I looked in C:/Program Files/VideoLAN/, but was unable to locate a file that retains the revisions made to the Media Information. If there is a file that retains the revision made to the Media Information, when I want to install VLC on a new Hard Drive or Solid State Drive, then I could just copy the file over to the new Hard Drive or Solid State Drive.

Does anybody know if there is a file that saves the revisions made to the Media Information? If not, perhaps there is some other solution to this situation, or some better way of updating the Media Information, such as using the command line?

Thanks!
Jeremy

JeremyCanfield
New Cone
New Cone
Posts: 2
Joined: 14 Jul 2015 17:00

Re: Save Media Information / metadata

Postby JeremyCanfield » 18 Jul 2015 01:49

I found a solution to this. The first step to import our entire library into VLC, and to then save the playlist to an .XSPF file.
  • Left click on the Playlists option
    Right click in the middle panel, and select the root directory of the Music Folder
    Go into the Music Folder, and every audio file should be displayed
    Right click in the middle panel, and select Save Playlist to File
    Give the playlist a name, such as All_Music.XSPF
Then, we open the All_Music.XSPF using Notepad++. For every audio file (yes, every single audio file), between the <track> fields, we need the <title>, <creator> and <album> fields and data.

<track>
<location>file:///D:/Music/Nirvana/Nevermind/Nirvana%20Nevermind%2001%20Smells%20Like%20Teen%20Spirit.wav</location>
<title>Smells Like Teen Spirit</title>
<creator>Nirvana</creator>
<album>Smells Like Teen Spirit</album>
<image>file:///D:/Music/Nirvana/Nevermind/Folder.jpg</image>
<duration>267173</duration>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:id>0</vlc:id>
</extension>
</track>

There are a couple reasons why we update the .XSPF file instead of making the updates in VLC at Tools -> Media Information. One reason is we can complete the job quicker, using find and replace functions. Also, if you need to move VLC to a different Hard Drive or Solid State Drive, you can then copy the All_Music.xspf file to the new Hard Drive or Solid State Drive, and all of the Media Information will still be properly formatted.

Restart VLC and load the All_Music.XSPF playlist.

One major problem here is that I've +10,000 audio files, so I'd need to manually insert the <title>, <creator> and <album> fields and data +10,000 times. I looked into use the Regular Expressions (regex) option in Notepad++ to automatically insert the <title>, <creator> and <album> fields and data. However, there are some significant challenges with the Regular Expression option, so I'm still looking into this. So far, this is the regular expression I have.

Find -> \/([a-zA-Z0-9]+)\/(([a-zA-Z0-9]|%20)+)\/(([a-zA-Z0-9]|%20)+)\/
Replace -> <creator>\1</creator>\n<album>\2</album>\n<title>\3</title>

BZLederman
Blank Cone
Blank Cone
Posts: 39
Joined: 04 May 2017 14:16

Re: Save Media Information / metadata

Postby BZLederman » 26 Jun 2020 17:56

I also need to edit a lot of media files to add Genre and maybe other metadata. For me, it looks like it will be easier to generate
a file list and create the command line to do the change. So I tried this:

vlc -verbose=2 --meta-artist="Robert Benchley" --meta-genre="Comedy" "How to Eat.avi"

This didn't work. VLC started playing the file, but did nothing to the metadata.

There were no errors, but it didn't change the metadata. So I tried this:

vlc -verbose=2 "How to Watch Football.avi" --meta-artist="Robert Benchley" --meta genre="Comedy"

I tried this on one system, and it started vlc playing the file, and if I bring up "Tools->Media Information"
it says the new metadata is there: but in a batch file the system would have to wait until the video finished
playing before going on to the next one. And, if I stop the video playing, it does not save the metadata.
And even worse, if VLC is left active but not displaying anything, subsequent commands do nothing at all.

It seems to me that there ought to be a way to have a batch file with something like

@echo ON
vlc "q:\Videos\G-PG-R\Comedy\Benchley 'How To' shorts\How to Read.avi" --meta-artist="Robert Benchley" --meta-genre="Comedy"
vlc "q:\Videos\G-PG-R\Comedy\Benchley 'How To' shorts\How to Train a Dog.avi" --meta-artist="Robert Benchley" --meta-genre="Comedy"
vlc "q:\Videos\G-PG-R\Comedy\Benchley 'How To' shorts\How to Watch Football.avi" --meta-artist="Robert Benchley" --meta-genre="Comedy"

that will change the metadata and exit, if I had the correct commands.

Is there a way to do this? If not, what good are the --meta-xxxx command line commands? I'm guessing there is something
simple that I'm missing that would make vlc process the command line, change the file, and exit. What am I missing here?

BZLederman
Blank Cone
Blank Cone
Posts: 39
Joined: 04 May 2017 14:16

Re: Save Media Information / metadata

Postby BZLederman » 26 Jun 2020 18:39

I did some research and changed my command line to:

vlc -vvv --meta-artist="Robert Benchley" --meta-genre="Comedy" -I dummy --dummy-quiet --stop-time 3 "q:\Videos\G-PG-R\Comedy\Benchley 'How To' shorts\How to Behave.avi" vlc://quit

This is a little better, there is no video window, but there is still audio output (which I can live with). However, it does not change
the metadata.

Apparently, I'm still missing something. Any suggestions? Do I have to allow the entire video to play just to change the metadata?

Thanks.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 15 guests