From 14eb83f7551604f73c6bc17ff4ed2ef80d644465 Mon Sep 17 00:00:00 2001 From: gcurtis79 <45603366+gcurtis79@users.noreply.github.com> Date: Fri, 28 Dec 2018 14:16:48 -0600 Subject: [PATCH 1/3] Update ffmpeg.py Check if using mjpeg as input_format and disable "-video_size" as mjpeg does not use it, and it causes ffmpeg to stop if used. --- video/ffmpeg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/video/ffmpeg.py b/video/ffmpeg.py index f95e648..4aefd3b 100644 --- a/video/ffmpeg.py +++ b/video/ffmpeg.py @@ -262,7 +262,7 @@ def startVideoCapture(): os.system("v4l2-ctl -c saturation={saturation}".format(saturation=saturation)) - videoCommandLine = ('{ffmpeg} -f {input_format} -framerate 25 -video_size {xres}x{yres}' + videoCommandLine = ('{ffmpeg} -f {input_format} -framerate 25 {video_size}' ' -r 25 {in_options} -i {video_device} {video_filter}' ' -f mpegts -codec:v {video_codec} -b:v {video_bitrate}k -bf 0' ' -muxdelay 0.001 {out_options}' @@ -270,6 +270,7 @@ def startVideoCapture(): videoCommandLine = videoCommandLine.format(ffmpeg=ffmpeg_location, input_format=video_input_format, + video_size=('-video_size {xres}x{yres}'.format(xres=xres,yres=yres) if input_format != "mjpeg" else "") in_options=video_input_options, video_device=video_device, video_filter=video_filter, From 472074dcc2e0989fdb20faee79aa2d2176923d28 Mon Sep 17 00:00:00 2001 From: gcurtis79 <45603366+gcurtis79@users.noreply.github.com> Date: Mon, 31 Dec 2018 21:59:00 -0600 Subject: [PATCH 2/3] Update ffmpeg.py --- video/ffmpeg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/ffmpeg.py b/video/ffmpeg.py index 4aefd3b..a18c6bf 100644 --- a/video/ffmpeg.py +++ b/video/ffmpeg.py @@ -270,7 +270,7 @@ def startVideoCapture(): videoCommandLine = videoCommandLine.format(ffmpeg=ffmpeg_location, input_format=video_input_format, - video_size=('-video_size {xres}x{yres}'.format(xres=xres,yres=yres) if input_format != "mjpeg" else "") + video_size=('-video_size {xres}x{yres}'.format(xres=xres,yres=yres) if input_format != "mjpeg" else ""), in_options=video_input_options, video_device=video_device, video_filter=video_filter, From 2b542ae9333c8801d2b220100ebd59aca465a263 Mon Sep 17 00:00:00 2001 From: gcurtis79 <45603366+gcurtis79@users.noreply.github.com> Date: Mon, 31 Dec 2018 22:01:05 -0600 Subject: [PATCH 3/3] Update ffmpeg.py --- video/ffmpeg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/ffmpeg.py b/video/ffmpeg.py index a18c6bf..ae93854 100644 --- a/video/ffmpeg.py +++ b/video/ffmpeg.py @@ -270,7 +270,7 @@ def startVideoCapture(): videoCommandLine = videoCommandLine.format(ffmpeg=ffmpeg_location, input_format=video_input_format, - video_size=('-video_size {xres}x{yres}'.format(xres=xres,yres=yres) if input_format != "mjpeg" else ""), + video_size=('-video_size {xres}x{yres}'.format(xres=xres,yres=yres) if video_input_format != "mjpeg" else ""), in_options=video_input_options, video_device=video_device, video_filter=video_filter,