Skip to content

Instantly share code, notes, and snippets.

View johnnoel's full-sized avatar

John Noel johnnoel

View GitHub Profile
@johnnoel
johnnoel / screenshots.sh
Created October 15, 2022 20:33
Video file screenshot script
# single video file
./screenshotter.sh video.mp4 250
# directory of files
find . -type f -maxdepth 1 -printf '"%f"\n' -exec screenshots.sh {} 250 \;
@johnnoel
johnnoel / Average.js
Created February 18, 2017 11:58
JavaScript ES6 Classes for perceptual image hashing
import Colour from './Colour';
import Resample from './Resample';
/**
* Average hash for images
*
* @author John Noel <john.noel@chaostangent.com>
* @see http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
* @see https://github.com/jenssegers/imagehash/blob/master/src/Implementations/AverageHash.php
*/
@johnnoel
johnnoel / screenshotter.php
Created October 11, 2012 17:20
PHP script for controlling mplayer to automatically take screenshots
<?php
define('DS', DIRECTORY_SEPARATOR);
$ssCount = 250;
$cmdMplayer = "e:\downloads\mplayer\mplayer\mplayer.exe";
$argsInfo = " -vo null -nosound -frames 0 -identify";
$argsCapture = " -quiet -nosound -vo jpeg:quality=90 -vf framestep=i{framestep} -fps 360 -lavdopts threads=4";
if($_SERVER['argc'] > 1)
{
@johnnoel
johnnoel / barcoder.php
Last active August 29, 2015 13:56
Creates "barcode" style images from video files, kind of like http://moviebarcode.tumblr.com/
<?php
$videoFiles = array();
if ($_SERVER['argc'] <= 1) {
die('No files passed in command line');
}
array_shift($_SERVER['argv']);
$videoFiles = $_SERVER['argv'];