Wednesday, March 24, 2010

Animated Sequence Using A Script

I wrote the following bash script that will take the video provided and change all the green in the video and make it red.



#!/bin/bash


# extract images from 00006.mts file

echo "Extracting Images"

ffmpeg -i 00006.mts -f image2 %d.ppm


# replace green from all images to red

echo "Replacing Green"

FILES=*.ppm
b=1

for a in $FILES
do

ppmchange -closeness=42 green red $b.ppm >$b-red.ppm
let b=$b+1
done

#convert manipulated images into a video

echo "Creating Video"

ffmpeg -f image2 -i %d-red.ppm GreenNowRed.avi




so this:



becomes this:

No comments:

Post a Comment