https://doi.org/10.5201/ipol.2017.209
Tip revision: 0a2766f5dec8a9683f9baa9010aa47f168afea6e authored by Software Heritage on 02 November 2017, 00:00:00 UTC
ipol: Deposit 1313 in collection ipol
ipol: Deposit 1313 in collection ipol
Tip revision: 0a2766f
cmdline_execute.sh
#!/bin/bash
#this script is useful to execute the program from the command line
video=$1
outvideo=$2
motion_strategy=$3
sigma=$4
out_transform=$5
cooling=$6
mkdir tmp
input_raw_video=tmp/video.raw
output_raw_video=tmp/output_video.raw
#extract info from video
info=`avprobe -v error -show_streams $video`
info="${info#*codec_type=video}"
echo $info
echo
width=`echo ${info#*width=}| cut -d' ' -f 1`
height=`echo ${info#*height=}| cut -d' ' -f 1`
framerate=`echo ${info#*avg_frame_rate=}| cut -d' ' -f 1`
nframes=`echo ${info#*nb_frames=}| cut -d' ' -f 1`
size=${width}x${height}
echo Converting $video to $input_raw_video
avconv -v error -i $video -f rawvideo -pix_fmt rgb24 -y $input_raw_video
echo
echo Estadeo stabilization for video $input_raw_video to $output_raw_video
path=$(dirname "$0")
$path/estadeo $input_raw_video $width $height $nframes -o $output_raw_video -m $motion_strategy -r $sigma -w $out_transform -p $cooling -v $7
echo
echo Converting $output_raw_video to $outvideo
avconv -v error -f rawvideo -pix_fmt rgb24 -video_size $size -framerate $framerate -i $output_raw_video -pix_fmt yuv420p -y $outvideo
echo
rm -R tmp/