Git Product home page Git Product logo

tv-intro-detection's Introduction

TV Intro Detection

This project tries to detect intros of tv series by comparing pairs of episodes to find the largest common subset of frames.

For setup details you can find the documentation here:

https://mueslimak3r.github.io/tv-intro-detection/

Notice

path_map.txt and env PATH_MAP now use :: to delimit path maps instead of :. This allows handling Windows paths

How the script compares videos

Each frame from the first quarter of each episode is extracted and a hash (https://pypi.org/project/ImageHash/) is made on the frame. Each frame hash is added to a long video hash.
In pairs the longest identical string is searched from the two video hashes.
Assumption: this is the intro

How the script finds your videos

When using jellyfin.py, the script queries the jellyfin server and is sent a list of all the tv shows in your library. With that list of shows, it then queries the jellyfin server for the seasons and episodes for each of the shows. Included in the results of those queries is the location on the filesystem for each item (show, season, episode).

To account for jellyfin potentially using a different filesystem path to access the media than the system running the script would (eg: running in docker, running the script on a separate computer with the media drives mounted as network shares), path mapping is used to translate the path jellyfin sees into a path that the script can use.

When running decode.py on its own, the -i parameter is used to specify a folder that contains video files. decode.py doesn't do any searching beyond that single folder, so typically the provided folder will be a "season folder" that contains all the video files for that season of a show.

Individual shows or seasons can be ignored by creating an empty file named .ignore-intros inside its folder.

Examples

scan your jellyfin library, store the result in json, verbose logging enabled, logging debug output to file enabled

export JELLYFIN_URL="https://myurl" && export JELLYFIN_USERNAME="myusername" && export JELLYFIN_PASSWORD='mypassword'

jellyfin.py -j -v -l

or in reverse order

jellyfin.py -j -v -l --reverse

monitor your jellyfin sessions and automatically skip intros using the stored json data

export JELLYFIN_URL="https://myurl" && export JELLYFIN_USERNAME="myusername" && export JELLYFIN_PASSWORD='mypassword'

jellyfin_auto_skip.py

manually scan a directory containing at least 2 video files, debug logging enabled, logging debug output to file enabled, delete fingerprint data afterward decode.py -i /path/to/tv/season -d -l -c

make the script aware of your host:container path mapping by editing path_map.txt

# use this file if you run jellyfin in a container
# examples:
#
# linux client, Jellyfin on linux
#
# /host/system/tv/path::/jellyfin/container/tv/path
#
# or
# Windows client, Jellyfin on Windows
#
# X:\some\path\TV::Y:\some\path\TV
#
# or
# Windows client, Jellyfin on linux
#
# or
# X:\some\path\TV::/jellyfin/container/tv/path

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.