Unix for Artists: Fun with FFMPEG is a workshop hosted by the Echo Park Film Center.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 lines
900 B

#!/bin/bash -e
#####################################################
#
# This script exports all frames of your video into
# a directory named "frames" and then runs a convert
# command which does edge detection on each frame.
# Then all frames are stitched back into a ProRes
# video.
#
# Usage: bash ffmpeg/frames/loop.sh <input video> <output video>
#
#####################################################
INPUT="${1}"
OUTPUT="${2}"
# Check if output file extension is .mov
if [[ "${OUTPUT}" != *".mov" ]]; then
echo "Please use an .mov extension on your output file argument"
exit 1
fi
mkdir -p frames
ffmpeg -i "${INPUT}" frames/frame-%06d.png
FRAMES=frames/*.png
for frame in ${FRAMES}; do
echo "Running edge detection on $frame..."
convert "${frame}" -edge 1 "${frame}"
done
sleep 10
ffmpeg -f image2 -i frames/frame-%06d.png -c:v prores_ks -profile:v 3 "${OUTPUT}"
rm -rf frames