Wednesday, May 4, 2011

FFmpeg Test/homework

This is my ffmpeg code from the test/homework


It takes the still frames out of a movie, adds the frame numbers and an effect to each image (I have edge written in here, but it can be any imagemagick effect,I used sketch and charcoal too, but this one takes the least amount of time)


After it applies the effect to each image it then compiles them back into a movie called edge.mov and then deletes all the image files, so none are left behind.


Then you can play the video and see the effects it has, and the frame numbers.


I had alot of trouble with this assignment at first, but once I had time to sit down and work through it, I began to figure it out, and I'm really glad we got to do it as a homework assignment as well, because now that I've gotten it, I feel so much better on this subject.




rm edge.mov


ffmpeg -i jumps.mov -s hd720 -f image2 %07d-fresh.png

for((i=1; i<50; i++))

do

fresh=`printf "%07d-fresh.png" $i`





STRING="Frame Number $i"

echo $STRING



mogrify $fresh -draw "text 25,25 '$STRING'" $fresh

convert $fresh -edge 2 $fresh.bmp


#convert $fresh -colorspace gray -sketch 0x20+120 $fresh

#convert $fresh -colorspace gray \

#\( +clone -blur 0x2 \) +swap -compose divide -composite \

#-linear-stretch 5%x0% $fresh

done


ffmpeg -f image2 -i %07d-fresh.png.bmp -r 25 -b 10000k -s 1200x720 edge.mov


rm *.png

rm *.png.bmp

No comments:

Post a Comment