View Single Post
Old 4th May 2013, 01:16   #23  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,392
my (debian) ffmpeg / imagemagick try (1 strip = 1 frame)
Code:
#!/bin/bash

# produces a color-stripe (color fingerprint) png of a video file (1 pixel = 1 frame)

while [ $# -gt 0 ]; do

# make temporary folder and trap to clean up
TMPDIR=`mktemp -d`
trap "rm -rf $TMPDIR" EXIT

# expand path, so this can be used from cli as well (on relative paths)
# file=$(readlink -f "$1")
 file="$1"

ffmpeg -i "$file" -sws_flags neighbor -vf scale=2:2 -f image2 "$TMPDIR/out-%05d.png"
convert +append "$TMPDIR/out-*.png" -resize 1x1\! -resize 1x128\! "$file.png"

rm -rf $TMPDIR

    shift
done
(didn't bother with audio and could not figure out how to pipe ffmpeg to convert, improvements welcome)

examples:
http://shrani.si/f/16/OU/3fUvCjIb/shakira-loca.png
http://shrani.si/f/2Z/Mh/2eV7odGN/psy.png
__________________
certain other member

Last edited by smok3; 4th May 2013 at 20:12.
smok3 is offline   Reply With Quote