Skip to content

Instantly share code, notes, and snippets.

@cathandnya
Created February 1, 2022 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cathandnya/08dd616eb910378dc25ecf58d4a9eaa8 to your computer and use it in GitHub Desktop.
Save cathandnya/08dd616eb910378dc25ecf58d4a9eaa8 to your computer and use it in GitHub Desktop.
#!/bin/zsh
# anaconda
source ~/opt/anaconda3/etc/profile.d/conda.sh
conda activate tecog
pip3 install -r requirements.txt
FFMPEG="/usr/local/bin/ffmpeg"
PYTHON="/usr/local/bin/python3"
INPUT=$1
OUTPUT=$2
TMPDIR="LR/calendar"
dirstr='./results/'
testpre='calendar'
rm -rf $TMPDIR
mkdir $TMPDIR
rm -rf "results/calendar"
# get fps
FPS=`$FFMPEG -i $INPUT 2>&1 | sed -n "s/.*, \(.*\) fp.*/\1/p"`
echo "fps: $FPS"
# to images
$FFMPEG -r $FPS -i $INPUT -vcodec png "${TMPDIR}/%08d.png" < /dev/null
# upscale
$PYTHON runGan.py 1
# make movie
$FFMPEG -y -r $FPS -i "results/calendar/output_%08d.png" -vcodec libx264 -pix_fmt yuv420p $OUTPUT < /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment