mono/taglib-sharp


Library for reading and writing metadata in media files

License: LGPL-2.1

Language: C#


TagLib#

Join the chat at https://gitter.im/mono/taglib-sharp

Linux Build Status Windows Build status

(aka Taglib-sharp) is a .NET platform-independent library (tested on Windows/Linux) for reading and writing metadata in media files, including video, audio, and photo formats. This is a convenient one-stop-shop to present or tag all your media collection, regardless of which format/container these might use. You can read/write the standard or more common tags/properties of a media, or you can also create and retrieve your own custom tags.

It supports the following formats (by file-extensions):

  • Video: mkv, ogv, avi, wmv, asf, mp4 (m4p, m4v), mpeg (mpg, mpe, mpv, mpg, m2v)
  • Audio: aa, aax, aac, aiff, ape, dsf, flac, m4a, m4b, m4p, mp3, mpc, mpp, ogg, oga, wav, wma, wv, webm
  • Images: bmp, gif, jpeg, pbm, pgm, ppm, pnm, pcx, png, tiff, dng, svg

It is API stable, with only API additions (not changes or removals) occuring in the 2.0 series.

Examples

Read/write metadata from a video

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();

Read/write metadata from a Audio file

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();

Read/write metadata from an Image

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();

Read/write custom tags from a specific format

var tfile = TagLib.File.Create(@"C:\My song.flac");
var custom = (TagLib.Ogg.XiphComment) tfile.GetTag(TagLib.TagTypes.Xiph);

// Read
string [] myfields = custom.GetField("MY_TAG");
Console.WriteLine("First MY_TAG entry: {0}", myfields[0]);

// Write
custom.SetField("MY_TAG", new string[] { "value1", "value2" });
custom.RemoveField("OTHER_FIELD");
rgFile.Save();

Website

TagLib# is available on GitHub: https://github.com/mono/taglib-sharp

  • Bugs: Create an issue
  • Chat: Join us at Gitter
  • Git: Get the source at git://github.com/mono/taglib-sharp.git

Building and Running

Command Line (Linux)

To Build From Git:

git clone https://github.com/mono/taglib-sharp.git
cd taglib-sharp
./autogen.sh && make

To Build From Tarball:

./configure && make

To Test:

make test

Mono Develop (Linux)

You can build from MonoDevelop using taglib-sharp.sln

Visual Studio (Windows):

You can open it in Visual Studio by using taglib-sharp.sln

Running regression by using Nunit 3 Test Adapter:

  1. Ensure NuGet packages have been restored
    1. See: https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore
  2. In Visual Studio, go to menu: Tools > Extensions and Updates > Online
  3. Search: Nunit 3 Test Adapter
  4. Download and install it
  5. Open from menu: Test > Windows > Test Explorer
  6. You can run your tests from this panel (not using the "Start" button)
  7. You can debug your tests from this panel:
    1. Double click on a test. Set some breakpoints in the test in the editor panel.
    2. right-click on the same test, select "Debug Selected tests".

To test some scenarios and take advantage of the debugger:

  1. Make the "debug" project the Startup project (Right-click on the project, select: "Set as StartUp Project")
  2. Just modify the "Program.cs"
  3. Set some breakpoints and hit the "Start" button

They also use TagLib#

Non exhaustive list of projects that use TagLib#:

And you, what do you use TagLib# for ? Reply here

Contributions

TagLib# is free/open source software, released under the LGPL. We welcome contributions! Please try to match our coding style, and include unit tests with any patches. Patches can be submitted by issuing a Pull Request (Git).

Project Statistics

Sourcerank 13
Repository Size 98.3 MB
Stars 633
Forks 228
Watchers 88
Open issues 48
Dependencies 0
Contributors 48
Tags 16
Created
Last updated
Last pushed

Top Contributors See all

Ruben Vermeersch bnickel Stephen Shaw Mike Gemünde Starwer Gabriel Burt Aaron Bockover Helmut Wahrmann Alexander Kojevnikov Paul Lange Alan McGovern Vincent Tavernier zductiv dulfe Stephane Delcroix Julien Moutte codingdave Ivailo Karamanolev PlatoniusIII Eberhard Beilharz

Packages Referencing this Repo

TagLibSharp
A library for for reading and writing metadata in media files, including video, audio, and photo ...
Latest release 2.2.0 - Updated - 633 stars
taglib-sharp-netstandard2.0
A library for reading and writing audio metatags. Fork to support .NetStandard 2.0 was created by...
Latest release 2.1.0 - Published - 633 stars
TagLibSharp-patched
A library for for reading and writing metadata in media files, including video, audio, and photo ...
Latest release 2.2.0-beta - Published - 633 stars
taglib
TagLib# (aka taglib-sharp) is a library for reading and writing metadata in media files, includin...
Latest release 2.1.0 - Updated - 633 stars

Recent Tags See all

TaglibSharp-2.2.0 July 22, 2019
taglib-sharp-2.1.0.0 July 03, 2012
taglib-sharp-2.0.5.0 July 01, 2012
taglib-sharp-2.0.4.0 April 13, 2011
taglib-sharp-2.0.3.7 March 20, 2010
taglib-sharp-2.0.3.6 February 24, 2010
taglib-sharp-2.0.3.5 February 21, 2010
taglib-sharp-2.0.3.4 January 21, 2010
taglib-sharp-2.0.3.3 September 30, 2009
taglib-sharp-2.0.3.2 February 16, 2009
taglib-sharp-2.0.3.1 January 20, 2009
taglib-sharp-banshee-0.13.2 December 28, 2007
taglib-sharp-banshee-0.13.1 August 19, 2007
taglib-sharp-banshee-0.13.0 August 02, 2007
taglib-sharp-1-1-final May 03, 2007

Interesting Forks See all

nuxleus/taglib-sharp
LIbrary for reading and writing metadata in media files
C# - LGPL-2.1 - Updated - 1 stars
sillsdev/taglib-sharp
LIbrary for reading and writing metadata in media files
C# - LGPL-2.1 - Last pushed - 1 stars - 1 forks
3rdandUrban-dev/taglib-sharp
LIbrary for reading and writing metadata in media files
C# - LGPL-2.1 - Updated - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-07-23 00:19:00 UTC

Login to resync this repository