Skip to content

App scans through a directory and stores metadata of .mkv files into a MySQL database

License

Notifications You must be signed in to change notification settings

leoreinmann/MKV2MySQL

Repository files navigation

MKV2MySQL

Table of content

  1. General
  2. Folder strucure
  3. SQL Database

General

With enzyme the app scans through a directory and stores metadata of .mkv files into the MySQL database. The database and its user and password must be created by the user. The tables are created by the program. The scheme of the table is shown at SQL Database.
Following arguments are required:

positional arguments:
  database_name      the name of the database
  database_user      the user to connect to the database
  database_password  the password to connect to the database
  folder             the folder containing the .mkv files

options:
  -h, --help         show this help message and exit

With enzyme the app scans through a directory and stores metadata of .mkv files into a MySQL database.

Folder structure

The folder structure must be as following:

├── Robocop (2014)
│   └── RoboCop_t00.mkv
├── Rocky
│   ├── Rocky (1976)
│   │   └── Rocky_t00.mkv
│   ├── Rocky 2 (1979)
│   │   └── Rocky II_t00.mkv
│   ├── Rocky 3 (1982)
│   │   └── Rocky III_t00.mkv
│   ├── Rocky 4 (1985)
│   │   └── Rocky IV_t00.mkv
│   ├── Rocky 5 (1990)
│   │   └── Rocky V_t00.mkv
│   └── Rocky Balboa (2006)
│       └── title_t00.mkv

Explanation: The .mkv files must be located in a folder with the naming convention title (YEAR). It is possible to make collections as shown with the Rocky movies, but the naming convention must be met, otherwise the program will fail. Also make sure, that there only one .mkv file!

SQL Database

We store the relevant audio and video properties in seperate tables, audio_track and video_track. For the case we need more information about specific .mkv files, we provide the whole json from enzyme of the audio and video track.

movie

Field Type Null Key Default Extra
id int NO PRI NULL auto_increment
title varchar(255) YES NULL

audio_track

Field Type Null Key Default Extra
id int NO PRI NULL auto_increment
name varchar(255) YES NULL
codec_id varchar(255) YES NULL
language varchar(255) YES NULL
movie_id int YES MUL NULL

video_track

Field Type Null Key Default Extra
id int NO PRI NULL auto_increment
display_height int YES NULL
codec_id varchar(255) YES NULL
movie_id int YES MUL NULL

movie_json

Field Type Null Key Default Extra
id int NO PRI NULL auto_increment
movie_id int YES MUL NULL
json_data text YES NULL

About

App scans through a directory and stores metadata of .mkv files into a MySQL database

Resources

License

Stars

Watchers

Forks

Languages