diff --git a/movie.sh.in b/movie.sh.in index fa9242f..648092b 100755 --- a/movie.sh.in +++ b/movie.sh.in @@ -13,6 +13,7 @@ SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) GIGA_DIR="$2" DEST_NAME="$3" FPS="$4" +MODE="$5" echo script_dir $SCRIPT_DIR 1>&2 echo GIGA_DIR $GIGA_DIR 1>&2 @@ -28,7 +29,7 @@ elif [ "-$1" == "-stop" ]; then mkdir $GIGA_DIR/sm kill `cat $2/audio.pid` cd $GIGA_DIR - @LIBEXECDIR@/mpegize.py convert $GIGA_DIR/ $DEST_NAME $FPS + @LIBEXECDIR@/mpegize.py convert $GIGA_DIR/ $DEST_NAME $FPS $MODE rm -r $GIGA_DIR echo Message: Rec else diff --git a/mpegize.py b/mpegize.py index c249fa4..41b7f3a 100755 --- a/mpegize.py +++ b/mpegize.py @@ -396,7 +396,7 @@ class Mpegize: return s[2], s[1], i def help(m): - print("mpegize command base-dir destination-movie fps") + print("mpegize command base-dir destination-movie fps dng|grw") def run(m, argv): if len(argv) > 2: @@ -411,7 +411,7 @@ class Mpegize: print("Phase 2: mpegize -- ", argv[3]) print("Message: enc") sys.stdout.flush() - gst_convert(m.base, argv[3], True) + gst_convert(m.base, argv[3], argv[4]=="dng") return if mode == "gaps": print("Video gaps") diff --git a/src/process_pipeline.c b/src/process_pipeline.c index 3f5a314..21fdfb0 100644 --- a/src/process_pipeline.c +++ b/src/process_pipeline.c @@ -687,6 +687,20 @@ static void spawn_movie(char *cmd) { g_autoptr(GError) error = NULL; + char *mode; + + switch (state_proc.mode->v4l_pixfmt) { + case V4L2_PIX_FMT_UYVY: + case V4L2_PIX_FMT_YUYV: + case V4L2_PIX_FMT_YVYU: + case V4L2_PIX_FMT_VYUY: + mode = "grw"; + break; + default: + mode = "dng"; + break; + } + GSubprocess *proc = g_subprocess_new(G_SUBPROCESS_FLAGS_STDOUT_PIPE, &error, movie_script, @@ -694,6 +708,7 @@ spawn_movie(char *cmd) burst_dir, movie_fname, "305", + mode, NULL); if (!proc) {