From: telecaster Date: Tue, 11 Mar 2025 11:14:51 +0000 (+0100) Subject: generic v4l2-ctl setup through yml config, fix boot time X-Git-Tag: 4.1.0~83 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=14f1ee0c0b15823e5c7b25ccaa5b331d7dd7f8ba;p=telecaster-server.git generic v4l2-ctl setup through yml config, fix boot time --- diff --git a/bin/streaming/telecaster.py b/bin/streaming/telecaster.py index b868ffa..e0b0e87 100755 --- a/bin/streaming/telecaster.py +++ b/bin/streaming/telecaster.py @@ -40,14 +40,6 @@ AUDIO_PIPELINE_BASE="""jackaudiosrc connect=2 ! audio/x-raw, format=F32LE, chann ! queue ! shout2send ip={ip} port={port} password={password} mount=telecaster_live.mp3 """ -V4L2_LOGITECH_PARAMS = { - "power_line_frequency": 1, - "zoom_absolute": 128, - "focus_auto": 0, - "focus_absolute": 1, - "sharpness": 128 -} - class TeleCasterGStream(Thread): @@ -97,12 +89,11 @@ class TeleCaster(Thread): yaml.dump(conf_dict, f) f.close() - def logitech_c92x_setup(self, video): - params = V4L2_LOGITECH_PARAMS - params["zoom_absolute"] = video["zoom"] - params["sharpness"] = video["sharpness"] - + def v4l2_ctl(self, video): + params = video["v4l2-ctl"] + print(params) for param in params: + print(param) command = "v4l2-ctl -d %s -c %s=%s" % (video["id"], param, params[param]) args = shlex.split(command) # print(args) @@ -120,11 +111,10 @@ class TeleCaster(Thread): deefuzzer_global_conf = {"deefuzzer": deepcopy(deefuzzer_default_conf)} deefuzzer_global_conf["deefuzzer"]["station"] = [] -# for video in self.conf["video"]["gstreamer"]: - if "logitech" in video: - self.logitech_c92x_setup(video) + if "v4l2-ctl" in video: + self.v4l2_ctl(video) pipeline = VIDEO_PIPELINE_BASE.format(**video, **self.conf["audio"]["gstreamer"], diff --git a/bin/streaming/telecaster.sh b/bin/streaming/telecaster.sh index 5f46154..263cc20 100755 --- a/bin/streaming/telecaster.sh +++ b/bin/streaming/telecaster.sh @@ -22,6 +22,8 @@ sleep 1 /srv/telecaster/telecaster-server/bin/streaming/telecaster.py /etc/telecaster/telecaster.yml & +sleep 3 + # JACK ports setup # 1: L # 2: R diff --git a/etc/telecaster/telecaster.yml b/etc/telecaster/telecaster.yml index 0409d12..f73a3d6 100644 --- a/etc/telecaster/telecaster.yml +++ b/etc/telecaster/telecaster.yml @@ -2,31 +2,40 @@ telecaster: server: ip: 127.0.0.1 port: 8000 - password: hackme + password: source2parisson type: icecast record_dir: /home/telecaster/monitor/ video: gstreamer: - id: 0 - width: 848 - height: 480 + name: JVC + width: 1280 + height: 720 framerate: 30 - flip: rotate-180 - zoom: 140 - sharpness: 144 + flip: none format: image/jpeg decoder: jpegdec - # logitech: true - - id: 4 - width: 864 - height: 480 + audio_delay: 0 + video_delay: 0 + vp8_bitrate: 3500000 + v4l2-ctl: + power_line_frequency: 1 + zoom_absolute: 800 + focus_absolute: 3395 + focus_automatic_continuous: 0 + sharpness: 6 + saturation: 100 + - id: 2 + name: USB-HDMI + width: 1280 + height: 720 framerate: 30 - flip: rotate-180 - zoom: 140 - sharpness: 144 + flip: none format: image/jpeg decoder: jpegdec - logitech: true + audio_delay: 0 + video_delay: 0 + vp8_bitrate: 3500000 deefuzzer: log: /var/log/telecaster/telecaster_webm_monitor.log m3u: /tmp/telecaster_webm_monitor.m3u @@ -68,7 +77,7 @@ telecaster: mountpoint: monitor_0.webm port: '8000' public: '0' - sourcepassword: hackme + sourcepassword: source2parisson type: icecast twitter: key: 76728330-OjKgbHtn4II86Ad7pNUGEzfNAkGTW5Wvw38qUmLE @@ -130,7 +139,7 @@ telecaster: mountpoint: monitor.mp3 port: 8000 public: 0 - sourcepassword: hackme + sourcepassword: source2parisson type: icecast twitter: key: 76728330-OjKgbHtn4II86Ad7pNUGEzfNAkGTW5Wvw38qUmLE