movie.sh.in 741 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # Copyright 2022, 2024 Pavel Machek, GPLv2+
  3. SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
  4. GIGA_DIR="$2"
  5. DEST_NAME="$3"
  6. FPS="$4"
  7. MODE="$5"
  8. echo script_dir $SCRIPT_DIR 1>&2
  9. echo GIGA_DIR $GIGA_DIR 1>&2
  10. echo DEST_NAME $DEST_NAME 1>&2
  11. echo FPS $FPS dfps 1>&2
  12. if [ "-$1" == "-start" ]; then
  13. mkdir $GIGA_DIR/sm || echo Message: NOSPC
  14. cd $GIGA_DIR/sm || exit 1
  15. @LIBEXECDIR@/movie_audio_rec $FPS &
  16. echo $! > $GIGA_DIR/audio.pid
  17. @LIBEXECDIR@/mpegize.py start $GIGA_DIR/ $DEST_NAME $FPS $MODE
  18. elif [ "-$1" == "-stop" ]; then
  19. kill `cat $GIGA_DIR/audio.pid`
  20. rm $GIGA_DIR/audio.pid
  21. cd $GIGA_DIR
  22. @LIBEXECDIR@/mpegize.py stop $GIGA_DIR/ $DEST_NAME $FPS $MODE
  23. echo Message: Rec
  24. else
  25. echo "Unrecognized command"
  26. fi