Git Product home page Git Product logo

fake-video-detector's Introduction

Fake Video (movie) detector

This script detects any fake videos you may have in your library, based upon an 'index' of screenshots that are taken from a random frame within a fake video.

It uses 'libpuzzle' to visually recognise similar images - this way if the quality or colour slightly varies between movies you download it should (in theory) still catch and match any fake videos.

If any matches are found the script will either log, or totally remove the file (I suggest you analyse your library, and first review the results before you configure it to auto-remove files).

It is intended to be used in combination with your PVR so you can automatically remove any rubbish content that may have been downloaded.


Docker Hub: ultimatepms/fake-video-detector

Docker Pulls

Some examples of fake videos:

Alt text


Prerequisites:

The script straight out of the box, you'll require:

  • Docker

Running without Docker:

If you must run the script without docker, you may use the copy of the script in the no-docker branch, however ffmpeg, libpizzle, and mogrify MUST be installed on your system - The non docker branch is no-longer maintained as of April 2019.

Installing:

Run ./setup.sh to install the 'fake-video' and 'bulk-search' commands into your local bash/zsh environment... You will also need to provide the FULL path to your media directory so it can be mapped into the docker container.

If you need to edit the volumes after you have run the install script, you may directly edit the alias in your ~/.zshrc and/or ~/.bashrc files.

If you are ONLY going to execute this from another process (i.e. Radarr or Sonarr) you may skip this step.

Running:

The script can be either run as a once-off command by passing a single video file to it (see all arguments supported below), or executed through a third party tool such as your Download Client (qBittorrent etc), or your PVR's "Post Processing" (Radarr, Sonarr, Couchpotato etc).

Running directly, with a single file

docker run -it --rm \
  -v "/path/to/movies:/path/to/movies" \
  ultimatepms/fake-video-detector:latest \
  fake-video --video="/path/to/movies/example.mp4"

Bulk Searching all your media files

This is a simple script that searches your directories & find's all video files (set to larger than 30mb) to process through the fake-video script. In addition it logs any matched videos to a fake-movie-paths.txt file, so you can manually review and remove any matching videos.

docker run -it --rm \
  -v "/path/to/movies:/path/to/movies" \
  ultimatepms/fake-video-detector:latest \
  bulk-search --search-location="/path/to/movies"

Note that files will not be auto-deleted with bulk-search unless you specify the flag --remove after the search-location parameter.

More advanced, supported arguments:

fake-video:

This is the main script which actually processes the video file. If you are integrating to your PVR or BitTorrent client this is the script you will want to execute. Arguments currently supported as as follows:

fake-video
	-h --help
	--video="<path>" 	 Specify full path to video file in double quotes
	--threshold="0.20" 	 The threshold (between 0 - 1) that a video is matched against - a value of 0 will be blacklisted, and 1 will count as passing. Suggest leaving at default of 0.20
	--build-thumbnails 	 Builds the 'blacklist-resized' directory, this needs to be run if you add or update thumbnails of blacklisted videos
	--silent 		 Suppresses all output - Will return an exit code of '1' for any matching fake videos, and '0' for all other scenarios
	--log 			 Logs result of each video into file (./fake-video.log) - Works well with --silent flag
	--remove 		 If specified, will auto-delete the file

bulk-search:

bulk-search
	-h --help
	--search-location="<path>" 	 Specify the directory you would like to search - Wildcards are accepted i.e. '/nas/*/Movies'
	--remove 			 If specified, will delete any files matched (DOES NOT RUN BY DEFAULT)

Contributing

IF YOU HAVE ANY ADDITIONAL FAKE VIDEO SCREENSHOTS, PLEASE ADD THEM INTO THE REPO AND SUBMIT A PR! - YOU MAY ALSO LOG AS AN ISSUE AND I WILL MANUALLY ADD THEM IN IF YOU'RE LAZY...

Adding more videos to blacklist:

Simply add a screenshot of a random point in time of your video into the blacklist-originals directory and run ./fake-video --build-thumbnails to rebuild the thumbnails database.

Here's a simple one-liner that will take a screenshot from the start of the video and store it in the blacklist-originals directory... (Note you will need to update the $INPUT_FILE variable with your file name)

ffmpeg -i "$INPUT_FILE" -vcodec mjpeg -vframes 1 -an -f rawvideo -ss 100 -preset veryfast "blacklist-originals/$RANDOM$RANDOM$RANDOM.jpg"

fake-video-detector's People

Contributors

ned-kelly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fake-video-detector's Issues

temp directory

Is there any way to specify the temp file location?
I keep getting /tmp/* etc can't be found, and it marks the video as failed.
my /tmp may be a bit small or something.

Unraid docker

Hey,

I'm using unraid, and I would just like to be aple to pull the docker, with everything within that docker to make this work.

Empty Folder

The libpuzzle folder is empty causing setup.sh to display the error below:

unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat fake-video-detector/libpuzzle-docker/Dockerfile: no such file or directory

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.