Pass dng/grw mode down to mpegize.

This commit is contained in:
Pavel Machek
2024-05-06 22:18:45 +02:00
parent c9dceb170b
commit bc9085ffad
3 changed files with 19 additions and 3 deletions

View File

@@ -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

View File

@@ -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")

View File

@@ -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) {