{"id":11128,"date":"2019-02-28T16:36:02","date_gmt":"2019-02-28T13:36:02","guid":{"rendered":"https:\/\/trueconf.com\/blog\/?p=11128"},"modified":"2024-06-28T12:27:03","modified_gmt":"2024-06-28T09:27:03","slug":"camera-preset-control-via-command-line-in-trueconf-weathervane","status":"publish","type":"post","link":"https:\/\/trueconf.com/blog\/knowledge-base\/camera-preset-control-via-command-line-in-trueconf-weathervane","title":{"rendered":"Camera Preset Control via Command Line in TrueConf Weathervane"},"content":{"rendered":"<p style=\"text-align: justify;\"><a href=\"https:\/\/trueconf.com\/products\/weathervane.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">TrueConf Weathervane<\/span><\/a><span style=\"font-weight: 400;\"> supports switching camera presets used during video conferences via command line parameters. Thanks to this fact the application can be used not only as a speaker tracking tool, but also as camera control tool.<\/span><\/p>\n<h2 id=\"command-description\"><span style=\"font-weight: 400;\">Command description<\/span><\/h2>\n<p><!--more--><br \/>\n<span style=\"font-weight: 400;\">Preset is assigned when the program is called via parameter <code>-p [num]<\/code> or <code>-preset [num]<\/code><\/span><\/p>\n<p>Here <code>[num]<\/code> is preset identifier.<\/p>\n<p><span style=\"font-weight: 400;\">For example, command that activates preset <b>#1<\/b> looks like<\/span><\/p>\n<pre class=\"lang:default decode:true \">WeatherVane.exe -preset 1<\/pre>\n<h2 id=\"manual-switch\"><span style=\"font-weight: 400;\">Manual switch (test)<\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In order to test how it works start TrueConf Weathervane. Open Windows console and proceed to the folder where the application is installed. Use the command from the previous section. Active preset in the application window will change.<\/span><\/p>\n<p><a href=\"https:\/\/trueconf.com\/blog\/wp-content\/uploads\/2019\/02\/tcvw_preset.gif\" data-rel=\"lightbox-gallery-X91n1WvB\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"aligncenter wp-image-11130 \" src=\"https:\/\/trueconf.com\/blog\/wp-content\/uploads\/2019\/02\/tcvw_preset.gif\" alt=\"\" width=\"600\" height=\"320\" loading=\"lazy\" title=\"\"><\/a><\/p>\n<h2 id=\"through-the-shortcut\" style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Switch TrueConf Weathervane through the shortcut<\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">You can also add preset switch parameter to TrueConf Weathervane shortcut (you can find example on how to add parameters to the shortcut in our<\/span><a href=\"https:\/\/trueconf.com\/blog\/knowledge-base\/launch-trueconf-client-applications-via-command-line-parameters.html#a4\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\"> article<\/span><\/a><span style=\"font-weight: 400;\">). After that even inexperienced users will be able to switch cameras and their positions by shortcut double click.<\/span><\/p>\n<p><a href=\"https:\/\/trueconf.com\/blog\/wp-content\/uploads\/2019\/02\/shortcut.jpg\" data-rel=\"lightbox-gallery-X91n1WvB\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"aligncenter wp-image-11133 size-full\" src=\"https:\/\/trueconf.com\/blog\/wp-content\/uploads\/2019\/02\/shortcut.jpg\" alt=\"\" width=\"282\" height=\"496\" loading=\"lazy\" title=\"\" srcset=\"https:\/\/trueconf.com/blog\/wp-content\/uploads\/2019\/02\/shortcut.jpg 282w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2019\/02\/shortcut-267x470.jpg 267w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2019\/02\/shortcut-103x182.jpg 103w\" sizes=\"auto, (max-width: 282px) 100vw, 282px\" \/><\/a><\/p>\n<h2 id=\"automatic-command-sending\" style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Automatic command sending<\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Application can be called not only directly, but also from your own program code. This will allow to embed any cameras switching scenario to your application and connect it to program operation in any way.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Here is a simple example: a Python 2.7 code that allows to switch presets circle-wise one after another every minute:<\/span><\/p>\n<pre class=\"lang:python decode:true\">from time import sleep\r\nfrom itertools import cycle\r\nfrom os import system\r\n\r\ndef set_preset_index(index):\r\n    WEATHERVANE_PATH = \"C:\\\\Program Files (x86)\\\\TrueConf\\\\WeatherVane\\\\WeatherVane.exe\"\r\n    \r\n    command = \"\\\"{}\\\" -p {}\".format(WEATHERVANE_PATH, index)\r\n    system(command)\r\n\r\ndef process_values_rhythmically(callback, values_iterator, \\\r\n\t\t\t\t\t\t\t\tsingle_time_interval):\r\n    while True:\r\n        value = next(values_iterator)\r\n        if value is None:\r\n            return\r\n        callback(value)\r\n        \r\n        sleep(single_time_interval)\r\n\r\ndef switch_cameras_by_cycle(**params):\r\n    process_values_rhythmically(set_preset_index, \\\r\n    \t\t\t\t\t\t\tcycle(range(params[\"n_presets\"])), \\\r\n           \t\t\t\t\t\tparams[\"time_interval\"])\r\n\r\nswitch_cameras_by_cycle(n_presets = 5, time_interval = 60.)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>TrueConf Weathervane supports switching camera presets used during video conferences via command line parameters. Thanks to this fact the application can be used not only as a speaker tracking tool, but also as camera control tool. Command description<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[260],"tags":[188],"class_list":["post-11128","post","type-post","status-publish","format-standard","hentry","category-knowledge-base","tag-trueconf-solutions","wpautop"],"_links":{"self":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/11128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/comments?post=11128"}],"version-history":[{"count":11,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/11128\/revisions"}],"predecessor-version":[{"id":14967,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/11128\/revisions\/14967"}],"wp:attachment":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/media?parent=11128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/categories?post=11128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/tags?post=11128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}