diff options
author | Lockywolf <for_sbo.python3-videohash_2023-06-03@lockywolf.net> | 2023-06-10 08:09:47 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-06-10 08:09:47 +0700 |
commit | 2520f5414db51236c092f1c08408508079b1becd (patch) | |
tree | 5bee0898f768ac78732656211b6d06eff133d39a /python/python3-videohash | |
parent | b361d7db4ef2e20a8f85787c43753fff378b40fc (diff) |
python/python3-videohash: Added (detecting identical videos).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'python/python3-videohash')
-rw-r--r-- | python/python3-videohash/README | 14 | ||||
-rw-r--r-- | python/python3-videohash/python3-videohash.SlackBuild | 97 | ||||
-rw-r--r-- | python/python3-videohash/python3-videohash.info | 10 | ||||
-rw-r--r-- | python/python3-videohash/slack-desc | 19 |
4 files changed, 140 insertions, 0 deletions
diff --git a/python/python3-videohash/README b/python/python3-videohash/README new file mode 100644 index 0000000000000..4f510f70044b4 --- /dev/null +++ b/python/python3-videohash/README @@ -0,0 +1,14 @@ +The Python package for near duplicate video detection + +Videohash is a for **detecting near-duplicate videos (Perceptual Video +Hashing)**. It can take any input video and generate a 64-bit +equivalent hash value. Videohash is way more faster than comparing the +imagehash values of individual of the video and more reliable than +hashing. + +The video-hash-values for identical or near-duplicate videos are the +same or similar, implying that if the video is resized +upscaled/downscaled, transcoded, watermark added/removed, stabilized, +color changed, frame rate changed, changed aspect ratio, cropped, +black-bars added or removed, the hash-value should remain unchanged or +not vary substantially. diff --git a/python/python3-videohash/python3-videohash.SlackBuild b/python/python3-videohash/python3-videohash.SlackBuild new file mode 100644 index 0000000000000..f8d0ec347bf35 --- /dev/null +++ b/python/python3-videohash/python3-videohash.SlackBuild @@ -0,0 +1,97 @@ +#!/bin/bash + +# Slackware build script for python3-videohash + +# Copyright 2023, Lockywolf +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=python3-videohash +TGZNAM=videohash +VERSION=${VERSION:-3.0.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP + +rm -rf $TGZNAM-$VERSION +tar xvf $CWD/$TGZNAM-$VERSION.tar.gz +cd $TGZNAM-$VERSION + +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +python3 setup.py install --root=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + README.md LICENSE \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/python/python3-videohash/python3-videohash.info b/python/python3-videohash/python3-videohash.info new file mode 100644 index 0000000000000..e9e73c95baa0d --- /dev/null +++ b/python/python3-videohash/python3-videohash.info @@ -0,0 +1,10 @@ +PRGNAM="python3-videohash" +VERSION="3.0.1" +HOMEPAGE="https://github.com/akamhy/videohash" +DOWNLOAD="https://files.pythonhosted.org/packages/e8/97/aa964ed2a1a626201a4bff2a3cfa2d665c535894df3fda34c095d399297f/videohash-3.0.1.tar.gz" +MD5SUM="c1b7d165d5e0652d80c5468032b88354" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Lockywolf" +EMAIL="for_sbo.python3-videohash_2023-06-03@lockywolf.net" diff --git a/python/python3-videohash/slack-desc b/python/python3-videohash/slack-desc new file mode 100644 index 0000000000000..738540eed7f7f --- /dev/null +++ b/python/python3-videohash/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +python3-videohash: python3-videohash (library for detecting nearly-identical videos) +python3-videohash: +python3-videohash: Videohash is a lib for detecting near-duplicate videos (Perceptual +python3-videohash: VideoHashing). It can take any input video and generate a 64-bit +python3-videohash: equivalent hash value. Videohash is way more faster than +python3-videohash: comparing the imagehash values of individual of the video and +python3-videohash: more reliable than hashing. +python3-videohash: +python3-videohash: +python3-videohash: +python3-videohash: |