開始將串流資料擷取至已部署的應用程式後,即可查看串流的輸出內容。
讀取串流輸出內容
成功建立將結果儲存至串流的應用程式後,即可讀取資料來源輸入串流或模型輸出串流。
Gemini Enterprise Agent Platform Vision SDK
如要傳送要求讀取模型輸出串流,請安裝 Gemini Enterprise Agent Platform Vision SDK。
替換下列變數:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION_ID:地區 ID。例如,
us-central1。支援的地區。更多資訊。 - STREAM_ID:您在叢集中建立的串流 ID,例如
application-output-1234abcd。
列印串流內容:
# This will print packets from a stream to stdout.
# This will work for *any* stream, independent of the data type.
vaictl -p PROJECT_ID \
-l LOCATION_ID \
-c application-cluster-0 \
--service-endpoint visionai.googleapis.com \
receive streams packets STREAM_ID
儲存串流影片
使用下列指令儲存影片串流輸出內容。這個指令會讀取進行中直播的資料,並將 MP4 格式的影片片段儲存至使用者指定的輸出目錄:
Gemini Enterprise Agent Platform Vision SDK
如要傳送要求,儲存串流的影片輸出內容,請安裝 Gemini Enterprise Agent Platform Vision SDK。
替換下列變數:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION_ID:地區 ID。例如,
us-central1。支援的地區。更多資訊。 - STREAM_ID:您在叢集中建立的串流 ID,例如
application-output-1234abcd。 - OUTPUT_PATH:輸出影片路徑。預設值為
/tmp/。
vaictl -p PROJECT_ID \
-l LOCATION_ID \
-c application-cluster-0 \
--service-endpoint visionai.googleapis.com \
receive streams video-file STREAM_ID --output OUTPUT_PATH