Add 2023 image streamer

Signed-off-by: milind-u <milind.upadhyay@gmail.com>
Change-Id: I2841205439f8927d638247cb3054b0b4da158e00
diff --git a/y2023/BUILD b/y2023/BUILD
index c060688..f5a3d57 100644
--- a/y2023/BUILD
+++ b/y2023/BUILD
@@ -15,14 +15,17 @@
         "//aos/network:web_proxy_main",
         "//aos/events/logging:log_cat",
         "//y2023/rockpi:imu_main",
+        "//frc971/image_streamer:image_streamer",
     ],
     data = [
         ":aos_config",
         "//y2023/constants:constants.json",
+        "//y2023/vision:image_streamer_start",
         "//y2023/www:www_files",
     ],
     dirs = [
         "//y2023/www:www_files",
+        "//frc971/image_streamer/www:www_files",
     ],
     start_binaries = [
         "//aos/network:message_bridge_client",
diff --git a/y2023/vision/BUILD b/y2023/vision/BUILD
index 3186f44..bcae14a 100644
--- a/y2023/vision/BUILD
+++ b/y2023/vision/BUILD
@@ -119,6 +119,12 @@
     ],
 )
 
+filegroup(
+    name = "image_streamer_start",
+    srcs = ["image_streamer_start.sh"],
+    visibility = ["//visibility:public"],
+)
+
 cc_binary(
     name = "foxglove_image_converter",
     srcs = ["foxglove_image_converter.cc"],
diff --git a/y2023/vision/image_streamer_start.sh b/y2023/vision/image_streamer_start.sh
new file mode 100755
index 0000000..48d9da7
--- /dev/null
+++ b/y2023/vision/image_streamer_start.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Some configurations to avoid dropping frames
+# 640x480@30fps, 400x300@60fps.
+# Bitrate 500000-1500000
+WIDTH=640
+HEIGHT=480
+BITRATE=1500000
+LISTEN_ON="/camera/downsized"
+# Don't interfere with field webpage
+STREAMING_PORT=1181
+
+# Handle weirdness with openssl and gstreamer
+export OPENSSL_CONF=""
+
+# Enable for verbose logging
+#export GST_DEBUG=4
+
+export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/gstreamer-1.0
+
+exec ./image_streamer --width=$WIDTH --height=$HEIGHT --bitrate=$BITRATE --listen_on=$LISTEN_ON --config=aos_config.json --streaming_port=$STREAMING_PORT
+
diff --git a/y2023/y2023_logger.json b/y2023/y2023_logger.json
index 0f1e633..c73379d 100644
--- a/y2023/y2023_logger.json
+++ b/y2023/y2023_logger.json
@@ -492,7 +492,7 @@
     {
       "name": "image_streamer",
       "executable_name": "image_streamer_start.sh",
-      "autostart": false,
+      "autostart": true,
       "nodes": [
         "logger"
       ]