Naming video files/Movies

From Official Kodi Wiki
< Naming video files
Revision as of 10:14, 11 September 2014 by Ned Scott (talk | contribs) (Split video files (file stacking))
Jump to: navigation, search

Adding videos to the library/Contents

Home icon grey.png   ▶ Video library ▶ Management ▶ Naming video files ▶ Movies

1 Naming conventions

In order to be scanned correctly, movie file names should only have the title and the year (optional) followed by the file extension. Media source flags can also be added via file names to indicate source/quality of the movie (see link for more info).

To improve matching add the year within parenthesis to the end of the file or foldername, depending on your scanning method and folder structure (before the extension, if filename), this naming standard seems to yield the best results.

Note: If the wrong movie is picked up even if foldername or filename is correct, the movie can have an earlier original title. This often happens to movies made in 1950's and after.

\Movies\Pulp Fiction (1994).avi
\Movies\Reservoir Dogs (1992).avi
\Movies\The Usual Suspects (1995).avi
\Movies\Avatar (2009)-cd1.mkv
\Movies\Avatar (2009)-cd2.mkv
\Movies\Avatar (2009)\somefilename.mkv
\Movies\The Usual Suspects (1995)\somefilename.avi
\Movies\The Usual Suspects (1995)\somefilename-cd1.avi
\Movies\The Usual Suspects (1995)\somefilename-cd2.avi
\Movies\Avatar (2009)\Avatar (2009)-cd1.mkv
\Movies\Avatar (2009)\Avatar (2009)-cd2.mkv

And for DVD-Video movies stored in file-mode on the harddrive or SMB NFS:

\Movies\Alien (1979)\VIDEO_TS.IFO
\Movies\Léon (1994)\VIDEO_TS.IFO
\Movies\Scarface (1983)\VIDEO_TS.IFO
Alternatively:
 \Movies\Alien (1979)\VIDEO_TS\VIDEO_TS.IFO
 \Movies\Léon (1994)\VIDEO_TS\VIDEO_TS.IFO
 \Movies\Scarface (1983)\VIDEO_TS\VIDEO_TS.IFO

Note: If using VIDEO_TS folder structure you must enable "recursive" lookup when adding the source directory.

2 Split video files (file stacking)

By using the following naming extensions and enabling XBMC -> Settings -> Videos -> File lists -> Combined split video items, you can enable "file stacking" for split video files. File stacking allows multiple video files to appear and play as if it were one movie file.

The following are default stacking extensions that can be added to file names

# can be 1 through 9 or A through D. No spaces between the "part" and number.

  • ​part#​
  • ​cd#​
  • ​dvd#​
  • ​pt#​
  • ​disk#​
  • ​disc#​


You can also use:

  • moviename#.ext

where # can be A through D.

Notes
  • Stacking is currently only applied to filenames, not the full path.
  • The default expressions will NOT stack files which use only a number as the volume token (eg movie1.avi, movie2.avi). This is intentional due to false positives which can occur with sequels in a flat directory layout. Some solutions to this problem (in order of best to worst) follow...
    1. Use a dir-per-movie directory layout, see the append example of the moviestacking advanced setting.
    2. Rename offending files to match one of the more specific volume tokens (ie. cd1, part1, etc).
    3. Create special-case regular expressions for those files that fail to stack (see #Advanced stacking options).

2.1 Advanced stacking options

File stacking can be tuned by the user to match obscure cases using the moviestacking advancedsettings.xml setting:

<moviestacking>

This is used by the file stacking algorithm to combine multi-part files and contains a list of "regular expressions". For stacking videos that are contained in folders, such as VIDEO_TS folders, see <folderstacking>

As of v9.11, video stacking regular expressions must contain exactly four (4) capture expressions.

Default:

<moviestacking>
  <!-- <cd/dvd/part/pt/disk/disc> <0-N> -->
  <regexp>(.*?)([ _.-]*(?:cd|dvd|p(?:ar)?t|dis[ck])[ _.-]*[0-9]+)(.*?)(\.[^.]+)$</regexp>
  <!-- <cd/dvd/part/pt/disk/disc> <a-d> -->
  <regexp>(.*?)([ _.-]*(?:cd|dvd|p(?:ar)?t|dis[ck])[ _.-]*[a-d])(.*?)(\.[^.]+)$</regexp>
  <!-- movienamea-xvid.avi, movienameb-xvid.avi -->
  <regexp>(.*?)([ ._-]*[a-d])(.*?)(\.[^.]+)$</regexp>
</moviestacking>

If the argument action="append" or append="yes" is supplied, the default moviestacking regular expressions will remain intact and the user specified ones will be added to the end.

Example:

<moviestacking action="append">
    <!-- This expression will match movename1-xvid.avi, moviename2-xvid.avi.
         Be warned that it will likely stack sequels in a flat directory layout,
         so it is only recommend in a dir-per-video layout. -->
  <regexp>(.*?)([ ._-]*[0-9])(.*?)(\.[^.]+)$</regexp>
</moviestacking>


If the argument action="prepend" is supplied, the default moviestacking regular expressions will remain intact and the user specified ones will be added to the beginning.

Example:

<moviestacking action="prepend">
  <regexp>(Title)(Volume)(Ignore)(Extension)</regexp>
</moviestacking>

If no argument is supplied, or the argument append="no" is supplied, the default moviestacking regular expressions are overwritten by the user specified ones.