Giter VIP home page Giter VIP logo

untegrity's Introduction

Untegrity

Command line tool & node package for detecting and optionally removing corrupt videos one at a time or in mass.

Installation

First install FFMPEG (Found Here) and ensure it's path is set in your environment variables. You can test this by simply running the command ffmpeg

For usage from within a Node.js project

npm i -s untegrity

For command line usage

npm i -g untegrity

Command Line Basics

Commands are formatted like this

untegrity path [...options]

We can check the integrity of a given video file like this, also it can accept folders instead.

untegrity ./video.mp4

Here's an example of recursively searching through directories and deleting the corrupt video files using audio content validation

untegrity . -dra

Node.js Basics

We can check the integrity of a video like this

const {checkIntegrity} = require('untegrity')
const join = require('join')

async function run() {
	const valid = await checkIntegrity(join(__dirname, 'video.mp4'))
	if (valid) {
		console.log("Video Valid!)
	} else {
		console.log("Video Invalid :(")
	}
}

run().catch(console.log)

Command Line Arguments

Usage

untegrity videoPath [-t --type | --type] [-r | --recursive] [-d | --rm | --del | --remove | --delete] [-a | --audio | --audioMode] [--noBanner]
Flag Description
-r If doing a folder search check subdirectories recursively
-t Specify either a video or folder path type to prevent unwanted behavior
-d Delete corrupt videos found.
-a Run in Audio Mode (Videos validated via audio tracks, potentially inaccurate but much faster)
--noBanner If you don't love beautiful ascii art ;(

Node.js Methods

checkIntegrity

Checks the integrity of a single video

Usage

const {checkIntegrity} = require('untegrity')
const {join} = require('path')

checkIntegrity(join(__dirname, './movie.mp4')).then(valid => {
	if (valid) {
		console.log("Video Valid")
	} else {
		console.log("Video Invalid")
	}
}).catch(console.log)

untegrity's People

Contributors

l1lith avatar

Stargazers

Xavier Grangier avatar

Watchers

James Cloos avatar

Forkers

grangier

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.