anchor.diff:  
   :NOFFMPEG
   
  -echo ffmpeg is found in %FFMPEGPATH%, download from: https://ffmpeg.zeranoe.com/builds/ and
  -echo unpack to program files directory
  +echo ffmpeg was not found in %FFMPEGPATH%, download from: https://ffmpeg.zeranoe.com/builds/
  +echo and unpack to program files directory
   goto END
   
   :FFMPEGERROR
  
positive.code: type ffmpeg >/dev/null 2>&1 || { echo >&2 "ffmpeg required but it's not installed. Aborting."; exit 1; }
  # TODO: add check for gear360pano.cmd script
  
  # Create temporary directory locally to stay compatible with other OSes
  FRAMESTEMPDIR=`mktemp -d -p .`
  OUTTEMPDIR=`mktemp -d -p .`
  IMAGETMPL="image%05d.jpg"
  STARTTS=`date +%s`
  
  # Stitch panorama (same file twice as input)
  echo "Extracting frames from video (this might take a while..."
  cmd="ffmpeg -i $1 -vf scale=7776:3888 $FRAMESTEMPDIR/$IMAGETMPL"
  run_command $cmd
  
  echo "Stitching frames..."
  for i in $FRAMESTEMPDIR/*.jpg; do
      echo Frame: $i
      OUTFILENAME=`basename $i`
      cmd="/bin/bash ./gear360pano.cmd $i $OUTTEMPDIR/$OUTFILENAME"
          run_command $cmd
  done
  
  echo "Recoding the video..."
  cmd="ffmpeg -f image2 -i $OUTTEMPDIR/$IMAGETMPL -r 30 -s 3840:1920 -vcodec libx264 $OUTNAME"
  run_command $cmd
          
  # Remove temporary directories
  clean_up
  
negative.code: ################################ Linux part here
  
  # http://stackoverflow.com/questions/59895/can-a-bash-script-tell-which-directory-it-is-stored-in
  DIR=$(dirname `which $0`)
  
  # Clean-up function
  clean_up() {
      echo "Removing temporary directories..."
      if [ -d "$FRAMESTMPDIR" ]; then
          rm -rf "$FRAMESTMPDIR"
      fi
      if [ -d "$OUTTEMPDIR" ]; then
          rm -rf "$OUTTEMPDIR"
      fi
  }
  
  # Function to check if a command fails
  # http://stackoverflow.com/questions/5195607/checking-bash-exit-status-of-several-commands-efficiently
  run_command() {
      "$@"
      local status=$?
      if [ $status -ne 0 ]; then
          echo "Error while running $1" >&2
          if [ $1 != "notify-send" ]; then 
             # Display error in a nice graphical popup if available
             run_command notify-send "Error while running $1"
          fi 
          clean_up
          exit 1
      fi
      return $status
  }
  
  # Do stuff to make this thing run on various POSIX operating systems
  # http://stackoverflow.com/questions/3466166/how-to-check-if-running-in-cygwin-mac-or-linux
  os_check() {
      case "$(uname -s)" in
  
      Darwin)
  