Get rid of fragile recursive rm, move cleanup to mpegize. This way
"mpegize stop" does not have to wait for "mpegize start".
This commit is contained in:
@@ -19,10 +19,10 @@ if [ "-$1" == "-start" ]; then
|
|||||||
echo $! > $GIGA_DIR/audio.pid
|
echo $! > $GIGA_DIR/audio.pid
|
||||||
@LIBEXECDIR@/mpegize.py start $GIGA_DIR/ $DEST_NAME $FPS $MODE
|
@LIBEXECDIR@/mpegize.py start $GIGA_DIR/ $DEST_NAME $FPS $MODE
|
||||||
elif [ "-$1" == "-stop" ]; then
|
elif [ "-$1" == "-stop" ]; then
|
||||||
kill `cat $2/audio.pid`
|
kill `cat $GIGA_DIR/audio.pid`
|
||||||
|
rm $GIGA_DIR/audio.pid
|
||||||
cd $GIGA_DIR
|
cd $GIGA_DIR
|
||||||
@LIBEXECDIR@/mpegize.py stop $GIGA_DIR/ $DEST_NAME $FPS $MODE
|
@LIBEXECDIR@/mpegize.py stop $GIGA_DIR/ $DEST_NAME $FPS $MODE
|
||||||
rm -r $GIGA_DIR
|
|
||||||
echo Message: Rec
|
echo Message: Rec
|
||||||
else
|
else
|
||||||
echo "Unrecognized command"
|
echo "Unrecognized command"
|
||||||
|
10
mpegize.py
10
mpegize.py
@@ -417,6 +417,12 @@ class Mpegize:
|
|||||||
def help(m):
|
def help(m):
|
||||||
print("mpegize command base-dir destination-movie fps dng|grw")
|
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):
|
def run(m, argv):
|
||||||
if len(argv) > 2:
|
if len(argv) > 2:
|
||||||
m.base = argv[2]
|
m.base = argv[2]
|
||||||
@@ -440,11 +446,10 @@ class Mpegize:
|
|||||||
print("Message: proc")
|
print("Message: proc")
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
gst_convert(m.base, argv[3], argv[4]=="dng")
|
gst_convert(m.base, argv[3], argv[4]=="dng")
|
||||||
|
m.cleanup()
|
||||||
return
|
return
|
||||||
if mode == "convert" or mode == "stop":
|
if mode == "convert" or mode == "stop":
|
||||||
if ext=="grw":
|
if ext=="grw":
|
||||||
# FIXME: need to wait for other mpegize!
|
|
||||||
time.sleep(200)
|
|
||||||
return
|
return
|
||||||
print("Phase 1: jpegize", file=sys.stderr)
|
print("Phase 1: jpegize", file=sys.stderr)
|
||||||
print("Message: 0%%")
|
print("Message: 0%%")
|
||||||
@@ -455,6 +460,7 @@ class Mpegize:
|
|||||||
print("Message: enc")
|
print("Message: enc")
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
gst_convert(m.base, argv[3], argv[4]=="dng")
|
gst_convert(m.base, argv[3], argv[4]=="dng")
|
||||||
|
m.cleanup()
|
||||||
return
|
return
|
||||||
if mode == "gaps":
|
if mode == "gaps":
|
||||||
print("Video gaps")
|
print("Video gaps")
|
||||||
|
Reference in New Issue
Block a user