From a5f388ca31ef7ec1d156b497f21b6089cb5c6d4f Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 23 Oct 2025 08:05:27 +0200 Subject: [PATCH] add debug and streaming_only modes, add GST_DEBUG debug env --- bin/streaming/telecaster.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/streaming/telecaster.py b/bin/streaming/telecaster.py index f6a9024..0c56a89 100755 --- a/bin/streaming/telecaster.py +++ b/bin/streaming/telecaster.py @@ -137,25 +137,35 @@ class TeleCaster(Thread): self.tools = args["tools"] self.engine = args["engine"] self.no_video = args["no_video"] + self.streaming_only = args["streaming_only"] + self.debug = args["debug"] + + if self.debug: + os.environ["GST_DEBUG"] = "3" + self.conf = yaml.safe_load(conf_file)["telecaster"] self.stream_types = ["audio", "video"] + self.deefuzzer_video_conf_file = "/tmp/telecaster_deefuzzer_webm_monitor.yml" self.deefuzzer_audio_conf_file = "/tmp/telecaster_deefuzzer_mp3_monitor.yml" - # print(self.conf) + engine = self.conf["audio"]["engine"]["name"] if "autostart" in self.conf["audio"]["engine"]: if self.conf["audio"]["engine"]["autostart"]: self.engine = True - print("OK") + print("engine started") + self.params = PARAMS[engine] self.params["options"] = self.params["options"].format(**self.conf["audio"][engine]) self.params["gst_audio_options"] = self.params["gst_audio_options"].format(**self.conf["audio"][engine]) + if "boot_time_delay" in self.conf: self.time_delay = self.conf["boot_time_delay"] else: self.time_delay = 1 if self.verbose: + print(self.conf) print(self.params) def write_conf(self, conf_dict, path): @@ -252,7 +262,7 @@ class TeleCaster(Thread): deefuzzer_global_conf["deefuzzer"]["station"].append(deefuzzer_local_conf) time.sleep(self.time_delay) - if not self.dry_run: + if not self.dry_run or not self.streaming_only: self.deefuzzer_start(deefuzzer_global_conf, self.deefuzzer_video_conf_file) def audio_start(self): @@ -284,7 +294,7 @@ class TeleCaster(Thread): deefuzzer_global_conf["deefuzzer"]["station"].append(deefuzzer_local_conf) time.sleep(self.time_delay) - if not self.dry_run: + if not self.dry_run or not self.streaming_only: self.deefuzzer_start(deefuzzer_global_conf, self.deefuzzer_audio_conf_file) def connect(self): @@ -315,6 +325,8 @@ def main(): parser.add_argument("-t", "--tools", help="start tools", action="store_true") parser.add_argument("-e", "--engine", help="start engine", action="store_true") parser.add_argument("-nv", "--no-video", help="no video", action="store_true") + parser.add_argument("-so", "--streaming-only", help="streaming only, no monitor recording", action="store_true") + parser.add_argument("-db", "--debug", help="debug mode", action="store_true") args = vars(parser.parse_args()) if os.path.exists(DEFAULT_CONFIG_FILE) and not args["config"]: args['config'] = DEFAULT_CONFIG_FILE -- 2.39.5