Bashrc Script for Filtering a Video
Below is my bashrc script that will accept an input video. It will then run FFMPEG to dump out the frames into a new directory with a reduced 1/FPS for speed of processing. It uses GraphicsMagick to apply a color filter to these frames that get dropped into a filtered directory. This image sequence is then converted back into a video with FFMPEG. Currently, there is no clean-up so all the image sequences will remain in the generated directories.
#! /bin/bash
echo "What video file do you want to filter?"
read output_file_name
mkdir frames
chmod 777 frames
cd frames
ffmpeg -i ../$output_file_name -r 1 -s 320x240 -f image2 %03d.jpeg
mkdir filtered
chmod 777 filtered
for img in `ls *.jpeg`
do
gm convert -modulate 115,0,100 \
-colorize 7,21,50 $img filtered/$img
done
cd filtered
ffmpeg -f image2 -i %03d.jpeg -r 12 -target vcd filtered.mpg
gm display filtered.mpg