From d0c22161c4a108c840c573928d0d38d4b723b7fe Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Tue, 20 Apr 2021 09:25:14 +0200 Subject: [PATCH] Add script to convert an MJPEG device video stream to a YUYV422 device This allows us to use MJPEG-streams in OBS for higher framerates. --- video/mjpeg_to_yuyv.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 video/mjpeg_to_yuyv.sh diff --git a/video/mjpeg_to_yuyv.sh b/video/mjpeg_to_yuyv.sh new file mode 100755 index 0000000..260363c --- /dev/null +++ b/video/mjpeg_to_yuyv.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Create virtual v4l2 device +sudo modprobe v4l2loopback devices=1 exclusive_caps=1 + +# Configure video device +# v4l2-ctl --set-fmt-video=width=1280,height=720,pixelformat=MJPG +# v4l2-ctl --device=/dev/video0 -p 60 + +# Stream from mjpeg input to yuyv output +ffmpeg -f v4l2 -input_format mjpeg -framerate 30 -video_size 1280x720 -i /dev/video0 -pix_fmt yuyv422 -f v4l2 /dev/video2