Newer
Older
Import / code / Scripts / Nautilus / Combine Videos
#!/bin/bash
IFS='
'
MERGE_ARGUMENTS=""
fpaths=`echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | sort`
outfile=`~/.gnome2/nautilus-scripts/.prompt-output.py`
for file in $fpaths
do
  if [ -f "$file" ]; then
	base=${file%.*}
	ext=${file##*.}
#	if [ "$ext" == "avi" ]; then
	    MERGE_ARGUMENTS="$MERGE_ARGUMENTS \"$file\""
	    outdir=`dirname "$file"`
#	fi
  fi
done

if [ -n "$MERGE_ARGUMENTS" ]; then
    cd "$outdir"

    if [ -e "$outfile" ]
    then
      x=0
      while [ -e "$outfile-$x" ]
      do
          x=`expr $x + 1`
      done
      outfile=$outfile-$x
    fi

    # eval avimerge -i "$MERGE_ARGUMENTS" -o \"$outfile.avi\"
    eval mencoder -oac copy -ovc copy -o \"$outfile\" "$MERGE_ARGUMENTS" 
    # eval mv "$MERGE_ARGUMENTS" ~/.Trash
    # eval rm -rf "$MERGE_ARGUMENTS"
fi

~/.gnome2/nautilus-scripts/.done.py "Finished creating \"$outfile\""