Read and save stream data

After you have started to ingest streaming data into a deployed application you can view a stream's output.

Read stream outputs

After you have successfully created an application that saves results into a stream you can read a data source input stream or a model output stream.

Vertex AI Vision SDK

To send a request to read a model output stream you must install the Vertex AI Vision SDK.

Make the following variable substitutions:

  • PROJECT_ID: Your Google Cloud project ID.
  • LOCATION_ID: Your location ID. For example, us-central1. Supported regions. More information.
  • STREAM_ID: The stream ID that you created in the cluster For example, application-output-1234abcd.

Print stream content:

#Thiswillprintpacketsfromastreamtostdout.
#Thiswillworkfor*any*stream,independentofthedatatype.
vaictl-pPROJECT_ID\
-lLOCATION_ID\
-capplication-cluster-0\
--service-endpointvisionai.googleapis.com\
receivestreamspacketsSTREAM_ID

Save video from a stream

Use the following command to save video stream output. This command reads the data from an ongoing live stream, and saves the video segments in an MP4 file format to the user specified output directory:

Vertex AI Vision SDK

To send a request to save video output from a stream you must install the Vertex AI Vision SDK.

Make the following variable substitutions:

  • PROJECT_ID: Your Google Cloud project ID.
  • LOCATION_ID: Your location ID. For example, us-central1. Supported regions. More information.
  • STREAM_ID: The stream ID that you created in the cluster For example, application-output-1234abcd.
  • OUTPUT_PATH: The output video path. The default value is /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

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月29日 UTC.