Reading and Writing MPEG Tags and Attributes


posted by Tobias
01-25-2011

Downloads: 657
File size: 91.9kB
Views: 2,134
Reading and Writing MPEG Tags and Attributes
Filed under: , , , , ,

MPTag provides a wrapper around the taglib-sharp.dll which is freely available and allows you to read and write multimedia tag information (http://taglib-sharp.sourcearchive.com/).

Simply unzip the package (you may want to right-click the zip file first and open its property dialog to remove download restrictions automatically applied by IE). Next, you can import the module into PowerShell:

Import-Module c:\somepath\mptag

This will automatically load the dll and provides you with the function Get-MediaInfo. It will return an object with media information for your media files. Call it like this:

$m = Get-MediaInfo c:\folder\video_or_music_file.xyz

Media information contained in $m now gets you all the info you want:

$m
$m.Tag
$m.Properties
$m.Properties.Codecs

You can even change information in $m and write it back using $m.Save() to change multimedia file attributes.

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.