Merge "Add 2023 image streamer"
diff --git a/y2023/BUILD b/y2023/BUILD
index b9842aa..1c4ef71 100644
--- a/y2023/BUILD
+++ b/y2023/BUILD
@@ -47,15 +47,18 @@
"//aos/network:web_proxy_main",
"//aos/events/logging:log_cat",
"//y2023/rockpi:imu_main",
+ "//frc971/image_streamer:image_streamer",
],
data = [
":aos_config",
"//frc971/rockpi:rockpi_config.json",
"//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 839f11e..419217f 100644
--- a/y2023/vision/BUILD
+++ b/y2023/vision/BUILD
@@ -122,6 +122,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 0105b2b..5386a1d 100644
--- a/y2023/y2023_logger.json
+++ b/y2023/y2023_logger.json
@@ -484,7 +484,7 @@
{
"name": "image_streamer",
"executable_name": "image_streamer_start.sh",
- "autostart": false,
+ "autostart": true,
"nodes": [
"logger"
]