Creating Stop Motion Video

For fun today, Jesse constructed a stop motion scene with legos and a hand-drawn backdrop. Meanwhile, I wrote an animation process. I wrote it as two scripts: one to resize input from my camera, the other to actually animate the pictures.

My ImageMagick resize script is reasonably simple, and if you search for other animation techniques, you will see many scripts like this. To use all four cores on my processor, I fire off 5 resize jobs and then do a job wait for them to complete so that I do not bog my system down.

#!/bin/bash
set -x
set -e
# ----------------------------------------------------------------#
#  resize the input directory and put it in the output directory  #
#  and also re-names the files to simple numbered format          #
# ----------------------------------------------------------------#
i=0
j=1000
find 0-input/ -type f -iname "*.jpg" -printf "%f\n" \
| sort \
| while read f ; do
   g="1-resized/r-$j.png"
   echo "convert 0-input/$f -geometry 728x480! -normalize $g "
   convert "0-input/$f" -geometry 728x480! -normalize "$g" &
   i=$[ $i + 1 ]
   j=$[ $j + 1 ]
   if [ $i -eq 4 ]; then
      # wait a bit
      for job in `jobs -p`; do
         echo -n "...$job"
         wait $job 
      done
      i=0
   fi
   echo "!"
done
echo "done"

My animation script is not all that different from other animation scripts you can search for on google, either. However, mine does not loop, does no fades, and plays very slowly. The first ‘-r’ switch specifies how long the input frames should last, so in this case, about 750ms (1.25 frames/sec). The output frame rate is the second ‘-r’ switch.

#!/bin/bash
# -f : output format
# -r : frame rate
# -i : input file pattern
now=`date +%Y-%m-%d_%H%M`
ffmpeg  -r 1.25 -i "1-resized/r-1%03d.png" -r 24 "2-animated/animation-$now.mov"

I have a post of it on my G+.

Grumpy thots on SELinux

I just spent an hour trying to get a Samba share running on Fedora 20.
It used to not take that long, I’m familiar with how to get Samba running,
how to create shares, and how to manage valid users and masks.

But when it still doesn’t work? Well, what other thing do you do–you
TURN OFF SELinux. Why do the Fedora guys wonder at the SELinux hate?
Because SELinux doesn’t return any hint that SELinux policy violations
are the root cause of the strange errors you get when doing even mild
customizations of services…like adding a Samba share.

Please…why cannot I see something like:

smbd: SELinux policy prohibits read of /home/jed/3plibs

?

Would that be so difficult? I guess those things get reported in SOME log, but
NOT IN THE LOG YOU LOOK AT, which is the logs for the service you are configuring.