Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Video/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN apt-get -qqy update \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

COPY *.conf /etc/supervisor/conf.d/
COPY --chown="${SEL_UID}:${SEL_GID}" *.sh video_ready.py /opt/bin/
COPY --chown="${SEL_UID}:${SEL_GID}" *.sh *.py /opt/bin/

USER ${SEL_UID}

Expand Down
2 changes: 1 addition & 1 deletion Video/video.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ process_name="video.recorder"
if [ "${SE_VIDEO_RECORD_STANDALONE}" = "true" ]; then
JQ_SESSION_ID_QUERY=".value.nodes[]?.slots[]?.session?.sessionId"
SE_NODE_PORT=${SE_NODE_PORT:-"4444"}
NODE_STATUS_ENDPOINT="$(/opt/bin/video_gridUrl.sh)/status"
NODE_STATUS_ENDPOINT="$(python3 /opt/bin/video_gridUrl.py)/status"
else
JQ_SESSION_ID_QUERY=".[]?.node?.slots | .[0]?.session?.sessionId"
SE_NODE_PORT=${SE_NODE_PORT:-"5555"}
Expand Down
2 changes: 1 addition & 1 deletion Video/video_graphQLQuery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SESSION_ID=$1
if [ -n "${SE_NODE_GRID_GRAPHQL_URL}" ]; then
GRAPHQL_ENDPOINT=${SE_NODE_GRID_GRAPHQL_URL}
else
GRAPHQL_ENDPOINT="$(/opt/bin/video_gridUrl.sh)"
GRAPHQL_ENDPOINT="$(python3 /opt/bin/video_gridUrl.py)"
fi
if [[ -n ${GRAPHQL_ENDPOINT} ]] && [[ ! ${GRAPHQL_ENDPOINT} == */graphql ]]; then
GRAPHQL_ENDPOINT="${GRAPHQL_ENDPOINT}/graphql"
Expand Down
34 changes: 34 additions & 0 deletions Video/video_gridUrl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python3
import os

def get_grid_url():
max_time = 3
se_sub_path = os.getenv('SE_SUB_PATH', '')

# If SE_SUB_PATH is "/", set it to empty string
if se_sub_path == "/":
se_sub_path = ""

# Start with default grid URL
grid_url = os.getenv('SE_NODE_GRID_URL', '')

# Check for hub/router configuration
se_hub_host = os.getenv('SE_HUB_HOST') or os.getenv('SE_ROUTER_HOST')
se_hub_port = os.getenv('SE_HUB_PORT') or os.getenv('SE_ROUTER_PORT')

if se_hub_host and se_hub_port:
grid_url = f"{os.getenv('SE_SERVER_PROTOCOL', 'http')}://{se_hub_host}:{se_hub_port}{se_sub_path}"
# Check for standalone mode
elif (os.getenv('DISPLAY_CONTAINER_NAME') and
os.getenv('SE_VIDEO_RECORD_STANDALONE') == 'true'):
display_container = os.getenv('DISPLAY_CONTAINER_NAME')
node_port = os.getenv('SE_NODE_PORT', '4444')
grid_url = f"{os.getenv('SE_SERVER_PROTOCOL', 'http')}://{display_container}:{node_port}{se_sub_path}"

# Remove trailing slash if present
grid_url = grid_url.rstrip('/')

return grid_url

if __name__ == "__main__":
print(get_grid_url())
20 changes: 0 additions & 20 deletions Video/video_gridUrl.sh

This file was deleted.

Loading