Skip to content

Instantly share code, notes, and snippets.

@Aketzu
Created December 17, 2014 23:53
Show Gist options
  • Save Aketzu/9e150a5293fef9613508 to your computer and use it in GitHub Desktop.
Save Aketzu/9e150a5293fef9613508 to your computer and use it in GitHub Desktop.
Moyashot
#capture screenshots, run in crontab
#!/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
USER=akolehma
export PATH USER
cd /mnt/asm
rm -f /tmp/.X11-unix/X11
vncserver :11 -geometry 1800x1400 2> /dev/null
export DISPLAY=:11
rm -rf /mnt/asm/.chrome
google-chrome --user-data-dir=/mnt/asm/.chrome --no-default-browser-check --no-first-run --disable-translate --start-fullscreen http://asmwinter.moya.fi/MoyaWeb/neomap/view.jsf 2>/dev/null >/dev/null &
sleep 10
scrot
fn=$(ls -rt *png | tail -1)
siz=$(stat -c%s $fn)
if [[ siz -gt 390000 ]]; then
mv $fn bad_$fn
fi
# clean up when done
vncserver -kill :11 2>/dev/null
#rm -f /tmp/.X11-unix/X11
---
#Generate video
mkdir /mnt/asm/2
cd /mnt/asm/2
i=1; for f in ../20*png; do ln -s $f pic$i.png; ((i=i+1)); done
ffmpeg -r 30 -i pic%d.png -vf crop=w=1344:h=992:x=235:y=134 -vcodec libx264 -preset slow -an -x264opts crf=18 -y ../test.mp4
cd /mnt/asm
rm -rf 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment