# HG changeset patch # User tom@acousticscale.org # Date 1329919423 0 # Node ID 2e53a3b925250f52962bb78c1ba7e05c57c62403 # Parent 0518da52cb356e44818fcae8edebe7c5883fe4a2 AIM-o-matic scripts for automated running of AIM on a server. diff -r 0518da52cb35 -r 2e53a3b92525 trunk/scripts/aim-o-matic/aim-o-matic.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trunk/scripts/aim-o-matic/aim-o-matic.php Wed Feb 22 14:03:43 2012 +0000 @@ -0,0 +1,17 @@ + 0 || $_FILES["config_file"]["error"]) { + echo "error: file upload failed"; + } else { + $id_string = uniqid("aim-o-matic", true); + $ext = pathinfo($_FILES["audio_file"]["name"], PATHINFO_EXTENSION); + move_uploaded_file($_FILES["audio_file"]["tmp_name"], "/home/ubuntu/upload/" . $id_string . "." . $ext); + move_uploaded_file($_FILES["config_file"]["tmp_name"], "/home/ubuntu/upload/" . $id_string . ".config"); + echo "Results will be avaiable shortly, here:
"; + echo "" . $id_string . ""; + } +} else { + echo "error: file too large"; +} + +?> diff -r 0518da52cb35 -r 2e53a3b92525 trunk/scripts/aim-o-matic/aim_o_matic_cronjob.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trunk/scripts/aim-o-matic/aim_o_matic_cronjob.sh Wed Feb 22 14:03:43 2012 +0000 @@ -0,0 +1,36 @@ +#!/bin/bash + +export PATH=$PATH:/usr/local/bin/ + +INPUT_DIR=/home/ubuntu/upload +DONE_DIR=/home/ubuntu/processed +mkdir ${DONE_DIR} +OUTPUT_DIR=/var/www/results +sudo mkdir $OUTPUT_DIR +sudo chmod o+w $OUTPUT_DIR +AIMC_DIR=/home/ubuntu/aimc/build/posix-release/ +AIMC=$AIMC_DIR/AIMCopy + +mkdir -p /tmp/aimc/ + +for t in `seq 1 580`; do +for f in `ls $INPUT_DIR/*.config`; do + b=`basename $f` + WORKING_ID=${b%.config} + THIS_OUTPUT_DIR=${OUTPUT_DIR}/${WORKING_ID} + OUTPUT_BASE=${THIS_OUTPUT_DIR}/${WORKING_ID} + mkdir ${THIS_OUTPUT_DIR} + SCRIPT_FILE=${OUTPUT_BASE}.script + PARAMS_FILE=${OUTPUT_BASE}.complete_params + GRAPH_FILE=${OUTPUT_BASE}.dot + GRAPH_IMAGE=${OUTPUT_BASE}.png + ext="wav" + echo ${INPUT_DIR}/${WORKING_ID}.${ext} ${THIS_OUTPUT_DIR}/${WORKING_ID} | cat >> ${SCRIPT_FILE} + rm /tmp/aimc/* + $AIMC -C ${f} -S ${SCRIPT_FILE} -D ${PARAMS_FILE} -G ${GRAPH_FILE} + dot -Tpng -o ${GRAPH_IMAGE} ${GRAPH_FILE} + sudo chown www-data ${THIS_OUTPUT_DIR} + mv ${INPUT_DIR}/${WORKING_ID}.* ${DONE_DIR}/ +done +sleep 1 +done diff -r 0518da52cb35 -r 2e53a3b92525 trunk/scripts/aim-o-matic/prepare_aws_instance.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trunk/scripts/aim-o-matic/prepare_aws_instance.sh Wed Feb 22 14:03:43 2012 +0000 @@ -0,0 +1,6 @@ +#!/bin/bash +sudo apt-get -y update +sudo apt-get -y install subversion +svn checkout http://aimc.googlecode.com/svn/trunk/ aimc +aimc/scripts/aim-o-matic/prepare_aws_instance_stage_2.sh + diff -r 0518da52cb35 -r 2e53a3b92525 trunk/scripts/aim-o-matic/prepare_aws_instance_stage_2.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trunk/scripts/aim-o-matic/prepare_aws_instance_stage_2.sh Wed Feb 22 14:03:43 2012 +0000 @@ -0,0 +1,8 @@ +#!/bin/bash +sudo apt-get -y install scons pkg-config libsndfile1-dev build-essential ffmpeg apache2 php5 libcairo-dev libapache2-mod-php5 graphviz +sudo a2enmod php5 +sudo apache2ctl restart +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR/../../ +scons + diff -r 0518da52cb35 -r 2e53a3b92525 trunk/scripts/aim-o-matic/upload-form.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trunk/scripts/aim-o-matic/upload-form.html Wed Feb 22 14:03:43 2012 +0000 @@ -0,0 +1,16 @@ + + + +
+ + + + +
+ +
+ + + + diff -r 0518da52cb35 -r 2e53a3b92525 trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc --- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc Tue Feb 21 11:56:47 2012 +0000 +++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc Wed Feb 22 14:03:43 2012 +0000 @@ -166,9 +166,9 @@ float frame_rate = global_parameters_->DefaultFloat("frame_rate", -1.0); char sCmdLine[1024]; //!\todo check that snprintf does not want a larger buffer snprintf(sCmdLine, sizeof(sCmdLine)/sizeof(sCmdLine[0]), - "%s -r %.2f -y -i \"%s\" -i \"%s%%06d.png\" " + "%s -y -i \"%s\" -i \"%s%%06d.png\" " "-sameq -r %.2f -ar 44100 -acodec pcm_s16le %s \"%s\"", - sffmpegPath, frame_rate, sound_filename_.c_str(), directory_.c_str(), + sffmpegPath, sound_filename_.c_str(), directory_.c_str(), frame_rate, sCodecOptions, movie_filename_.c_str()); printf(sCmdLine); printf("\n");