讀取及儲存串流資料

開始將串流資料擷取至已部署的應用程式後,您就可以查看串流的輸出內容。

讀取串流輸出內容

成功建立將結果儲存至串流的應用程式後,即可讀取資料來源輸入串流或模型輸出串流。

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