unix4artists/ffmpeg/frames/basic.sh

30 lines
668 B
Bash
Raw Normal View History

2021-05-08 16:53:26 +00:00
#!/bin/bash -e
#####################################################
#
# This script splits a video into an image sequence
# and then stitches the image sequence back into a
# ProRes video.
#
# Usage: bash ffmpeg/frames/basic.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
sleep 20
ffmpeg -f image2 -i frames/frame-%06d.png -c:v prores_ks -profile:v 3 "${OUTPUT}"
rm -rf frames