Video file tagging

From Official Kodi Wiki
Jump to: navigation, search
Home icon grey.png   ▶ Video library ▶ Video file tagging
Incomplete.png INCOMPLETE:
This page or section is incomplete. Please add information or correct uncertain data which is marked with a ?
Emblem-important-yellow.png NOTICE:
This feature is currently for movies only. TV shows and music videos are not yet supported.
Emblem-important-yellow.png NOTICE:
This page describes an experimental and alternative way of adding movies to the library that is not dependent on file names or online scrapers.
Emblem-important-yellow.png NOTICE:
If you have already named and organized your files using Kodi's naming guidelines, then you can safely ignore this page and go to the next step.
Steps to create your Video Library
1. Video Guide Main Page
Prepare the Files
2. Naming & Folder Structure
2.1 Movies
2.2 TV Shows

Creating the Library
3. Add Sources & Scrape
4. Scraping Problems
Modify your Library
5. Update Video Library
6. Library Management
7. Artwork
7.1 Movie
7.2 TV Show
8. NFO Files
8.1 Movie
8.2 TV Show

Safeguard & Rebuild
9. Import-Export Library
10. Rebuild your Video Library

Kodi v18 Leia introduces support for embedded video tags using *.mkv and *.mp4 video files. They are similar in principle to the tags saved in audio files. Only limited movie support is available at this time.

1 Benefits of embedded video tags

There are multiple reasons why one would want to use this feature: Media may already contain useful metadata (the reverse however is also true - many files contain "junk" metadata, hence why the feature defaults to off). It gives one more control over the metadata than scrapers do (as scrapers may misclassify media and pull the wrong data). It does away with the need to have .nfo files. Since metadata travels with the media file, there is no longer a need for potentially thousands of these smaller files and can make directory management even easier. Using ultra-high resolution artwork/cover images that looks nicer on newer HD displays. (Pretty pictures!)

1.1 How does it change/differ from the old model?

Kodi has two options for metadata import: using an online scraper or using local information, traditionally in the form of .nfo files. Local tag reading is bundled into the "Local Information" arm, as logically, metadata is still local (i.e not network-drawn) information. Thus, one can still use a combination of .nfo files and embedded information if they choose "Local Information" rather than to use a scraper.

It is important to note however that .nfo files will override embedded information. Not all of Kodi's NFO features are supported by embedded metadata yet, so many users may wish to still use the NFO method. (

1.2 Settings

Kodi settings have the option to enable or disable the reading of video file tags at Settings > Media Settings > Videos > Use video tags. The default setting is disabled.

This page assumes this setting has been enabled.

2 Folder & File Structure

The use of Video File Tags does not absolve you from using the correct Folder and File structure for Movies, TV Shows and Music Videos as detailed in the previous pages.

3 Tagging

Stop hand.png These pages are maintained by the community and should not be considered an endorsement or recommendation. *

Note: User-friendly options for adding and editing embedded metadata may be lacking for your given platform. Be prepared for challenges when going down this path.

3.1 Windows

MP3tag is a Windows-based metadata editor for many different files and tag types, including MP4 and MKV (despite what it's name may suggest). While somewhat complex, it provides very fine-grained control over tagging, and is a worthwhile asset in any media management library.

MetaX is a user-friendly tagging solution. However, it is proprietary and paid ($10). It features much the same core features as MP3tag, but adds an online search functionality to grab metadata from providers such as iTunes, Amazon and others, as well as an autotag feature. This can be useful to people with enormous media collections where the time saved manually tagging justifies the price.

3.2 Mac

MP4 tagging
  • MetaZ is a free and open source metadata lookup and editor for Mac OS.

3.3 Linux

  • mp4v2
  • exiftool

3.4 A note on iTunes

Apple, in their wisdom, have created a subset of MP4 tags that are strictly speaking only meant for use with iTunes. However, most tagging software can read and write these iTunes tags. These tags are also quite useful but will not work with Kodi. Tags include the ability to store Cast (actors), Screenwriter and Director information, as well as age restriction data such as MPAA ratings.

The important point to note here is that just because your tagging software allows you to add these does not mean they will be used. After all, they are unstandardized and were created by Apple solely for use with iTunes and iOS/macOS devices.

4 Core Tags

While there are an absolute myriad of tags that one can use, many, if not most of these are unnecessary for video files. Remember that MP4 tags have to have fields for everything - TV shows, movies, music videos and music! We do not want to populate tags related to music (such as Artist) in a movie file. As such here are some of the most critical tags for video (TV show and Movie) files.

4.1 Title

It seems that Kodi will not import a media file without a valid title in the metadata tag. This makes it the most critical tag of all.

Title also differs from Filename - I may have a file called Blade_Runner_2049_(2017)Withalotofexcessinformation.mp4, But the title value can simply be "Blade Runner 2049". Kodi will then display "Blade Runner 2049).

4.2 Description

This describes the movie/TV Show. A snippet from iTunes' description of Blade Runner 2049 is as follows: "Thirty years after the events of the first film, a new blade runner, LAPD Officer K (Ryan Gosling), unearths a long buried secret that has the potential to plunge what’s left of society into chaos."

Descriptions thus actually describe the character or basic plot of a movie or TV Show. These will be displayed in Kodi when the file is selected.

Best practice at this point seems to be to mirror the Long Description and Short Description, as there does not seem to be any practical distinction between the two.

When using this tag with TV Shows, every episode can be individually described according to the plot of that particular episode.

4.3 Content Type

In MP4 there should be four choices: Music, Music Video, Movie and TV Show. The choice does not seem to matter at this point as Kodi can not distinguish files based on this tag, but rather relies on the manual setting when the directory was added. It might be useful to set this properly when tagging however, as a future change to allow Kodi to distinguish these tags may prove invaluable.

4.4 Cover/Picture

For some users, the singular greatest benefit to tags is being able to set your own cover image. Don't like the standard cover? Use the Collectors Edition or Digital Download cover.

4.5 TV Show Specific Tags

There are three more tags that should be filled in for TV Shows: Show (tvsh), numeric Season (tvsn) and Episode Number (tves) and the unique Production Code (tven). At the moment these tags do not seem to be of any practical use in Kodi, but should nevertheless be filled out as this may change.

5 Supported Tags

are the tags in this table for both mkv and mp4?
Both MP4 and MKV tags are supported, although they use fundamentally different methods of encoding metadata.
Is it ok to remove the music related tags? Are they separated accurately?
I cannot find these video related tags in mp3tag
To get to all the juicy video file related tags in mp3tag, right click on your video file and select "Extended Tags". From here one can see all the tags currently in a file. Add new ones by clicking on the Add button, selecting a Field (what tag to edit) and entering a value. The most critical one in all cases is TITLE, as it seems Kodi will not add a media file if this core tag is missing (and there is no .nfo file).
This will also allow you to add the cover artwork.
What format is this- id3, APE, Generic, MP4, other?
MP4 files use "moov" atoms embedded within the file. These are the same ones used in AAC audio files (such as m4a).
IMDBURL/TMDBURL is this one tag or two separate tags?

5.1 MP4 tag options

The below table shows the mp4tags (part of mp4v2) command line (CLI) options for all standard MP4 tags. Kodi roughly supports the ones applicable to movies.

Video File Tags
mp4v2 CLI parameter Type MP4 field Description
-B -podcast pcst NUM Set the podcast flag
-c -comment ©cmt STR Set a general comment
-C -copyright cprt STR Set the copyright information
-e -encodedby  ? STR Set the name of the person or company who encoded the file
-E -tool  ? STR Set the software used for encoding
-g -genre gnre / ©gen STR Set the genre name
-G -grouping ©grp STR Set the grouping name
-H -hdvideo hdvd NUM Set the HD flag (1/0)
-i -type stik STR Set the Media Type (tvshow, movie, music, ...)
-I -contentid cnID? NUM Set the content ID
-j -genreid ©gen / gnre? NUM Set the genre ID
-l -longdesc desc? STR Set the long description
-m -description desc? STR Set the short description
-M -episode tves NUM Set the episode number
-n -season tvsn NUM Set the season number
-N -network tvnn STR Set the TV network
-o -episodeid tven STR Set the TV episode ID
-O -category ©grp? STR Set the category
-p -playlistid  ? NUM Set the playlist ID
-P -picture PTH Set the picture as a .png, Cover
-S -show tvsh STR Set the TV show
-X -rating rtng STR Set the Rating (none, clean, explicit)
-y -year ©day NUM Set the release date
Music File Tags- TO BE REMOVED FROM LIST? or is it used for Music Videos?
 ? Tag Type Description
-A -album ©alb STR Set the album title, use TV Show or Work instead
-a -artist ©art STR Set the artist information
-b -tempo tmpo NUM Set the tempo (beats per minute)
-d -disk disk NUM Set the disk number, use Season instead
-D -disks disk NUM Set the number of disks
-L -lyrics ©lyr NUM Set the lyrics, Subtitles can be embedded, too
-R -albumartist aART STR Set the album artist
-s -song ©nam STR Set the song title
-t -track trkn NUM Set the track number, use Episode Number instead
-T -tracks trkn NUM Set the number of tracks
-w -writer ©wrt STR Set the composer information
-z -artistid NUM Set the artist ID
-Z -composerid NUM Set the composer ID

5.2 MKV tag options

MKV tagging currently does not support the Matroska tagging specification to fill library info, rather a Kodi standard NFO file can be embedded into MKV files.

  • An attachment named kodi-metadata will be scanned as an embedded .nfo file
  • An attachment named kodi-override-metadata will be scanned as a url nfo if combined with specifying IMDB/TMDB url. if alone, you get an override nfo

6 Artwork

For MKV you can have embedded images. currently limited to:

  • 'small_cover.png' or 'small_cover.jpg' for thumbnails
  • 'cover.png' or 'cover.jpg' for posters
  • 'fanart.png' or 'fanart.jpg' for fanart

'poster' images can be embedded in MP4 files.

Return to top

Next step: Add Source & Scrape