用于读取和写入媒体文件元数据的库
#TagLib#(又名 Taglib-sharp) 是一款 .NET 平台独立的库(已在 Windows/Linux 上测试),用于读取和写入媒体文件中的元数据,包括视频、音频和照片格式。这是一个方便的一个站点,可用于呈现或标记您的所有媒体集合,无论它们使用何种格式/容器。您可以读取/写入媒体的标准或更常见的标签/属性,也可以创建和检索自己的自定义标签。
它支持以下格式(通过文件扩展名):
var tfile = TagLib.File.Create(@"C:\My video.avi");
string title = tfile.Tag.Title;
TimeSpan duration = tfile.Properties.Duration;
Console.WriteLine("Title: {0}, duration: {1}", title, duration);
// change title in the file
tfile.Tag.Title = "my new title";
tfile.Save();var tfile = TagLib.File.Create(@"C:\My audio.mp3");
string title = tfile.Tag.Title;
TimeSpan duration = tfile.Properties.Duration;
Console.WriteLine("Title: {0}, duration: {1}", title, duration);
// change title in the file
tfile.Tag.Title = "my new title";
tfile.Save();var tfile = TagLib.File.Create(@"C:\My picture.jpg");
string title = tfile.Tag.Title;
var tag = tfile.Tag as TagLib.Image.CombinedImageTag;
DateTime? snapshot = tag.DateTime;
Console.WriteLine("Title: {0}, snapshot taken on {1}", title, snapshot);
// change title in the file
tfile.Tag.Title = "my new title";
tfile.Save();暂无开放 Issues,或尚未同步最近议题。