diff --git a/movie.sh.in b/movie.sh.in index 3afaa1e..eef2866 100755 --- a/movie.sh.in +++ b/movie.sh.in @@ -19,10 +19,10 @@ if [ "-$1" == "-start" ]; then echo $! > $GIGA_DIR/audio.pid @LIBEXECDIR@/mpegize.py start $GIGA_DIR/ $DEST_NAME $FPS $MODE elif [ "-$1" == "-stop" ]; then - kill `cat $2/audio.pid` + kill `cat $GIGA_DIR/audio.pid` + rm $GIGA_DIR/audio.pid cd $GIGA_DIR @LIBEXECDIR@/mpegize.py stop $GIGA_DIR/ $DEST_NAME $FPS $MODE - rm -r $GIGA_DIR echo Message: Rec else echo "Unrecognized command" diff --git a/mpegize.py b/mpegize.py index 2b96b4f..7daa77a 100755 --- a/mpegize.py +++ b/mpegize.py @@ -417,6 +417,12 @@ class Mpegize: def help(m): print("mpegize command base-dir destination-movie fps dng|grw") + def cleanup(m): + os.system("rmdir %s/sm/" % m.base) + os.system("rmdir %s/" % m.base) + print("Message: Rec") + sys.stdout.flush() + def run(m, argv): if len(argv) > 2: m.base = argv[2] @@ -440,11 +446,10 @@ class Mpegize: print("Message: proc") sys.stdout.flush() gst_convert(m.base, argv[3], argv[4]=="dng") + m.cleanup() return if mode == "convert" or mode == "stop": if ext=="grw": - # FIXME: need to wait for other mpegize! - time.sleep(200) return print("Phase 1: jpegize", file=sys.stderr) print("Message: 0%%") @@ -455,6 +460,7 @@ class Mpegize: print("Message: enc") sys.stdout.flush() gst_convert(m.base, argv[3], argv[4]=="dng") + m.cleanup() return if mode == "gaps": print("Video gaps")