Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to retrieve analyses of a video stream from a
discrete file or from archived data.
See live video streaming to
learn how to annotate a live video stream.
You can split a video file into chunks and stream each chunk by using gRPC to
send multiple messages to the Video Intelligence API streaming service. The first
message can only contain a
StreamingVideoConfig message.
All subsequent messages must only contain video data.
The Video Intelligence API streaming service returns a
response
that contains results
based on the feature
that you specified in your video config.
In a gRPC request, you write the binary data directly to the stream. You do
not need to convert the video content to base64.
We recommend that you keep the size of your video chunks to less than 10 MB.
For video formats that are not listed as supported, you can determine if
your video file supports streaming by using
a named pipe and the ffmpeg tool. The following sample
commands decode a video
into PNG images at a rate of 0.2 fps. If your file can be successfully decoded
using these commands, then you can stream it using the Video Intelligence
streaming service.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Streaming video annotation\n\n| **Beta**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page describes how to retrieve analyses of a video stream from a\ndiscrete file or from archived data.\nSee [live video streaming](/video-intelligence/docs/streaming/live-streaming-overview) to\nlearn how to annotate a live video stream.\n\nYou can use the streaming API\n([StreamingVideoIntelligenceService](/video-intelligence/docs/reference/rpc/google.cloud.videointelligence.v1p3beta1#google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService)) for real-time video detection with the following features:\n\n- [Analyze labels](/video-intelligence/docs/streaming/label-analysis).\n- [Detect shot changes](/video-intelligence/docs/streaming/shot-change).\n- [Detect explicit content](/video-intelligence/docs/streaming/explicit-content).\n- [Stream annotation to storage](/video-intelligence/docs/streaming/streaming-to-storage).\n- [Track objects](/video-intelligence/docs/streaming/object-tracking).\n\nYou can use [Vertex AI AutoML](/vertex-ai/docs/beginner/beginners-guide)\nfor the following features:\n\n- [Action recognition](/video-intelligence/docs/streaming/action-recognition).\n- [Video classification](/video-intelligence/docs/streaming/video-classification).\n- [Object tracking](/video-intelligence/docs/streaming/automl-object-tracking).\n\nUsing the Streaming API\n-----------------------\n\nYou can split a video file into chunks and stream each chunk by using gRPC to\nsend multiple messages to the Video Intelligence API streaming service. The first\nmessage can only contain a\n[StreamingVideoConfig](/video-intelligence/docs/reference/rpc/google.cloud.videointelligence.v1p3beta1#google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig) message.\nAll subsequent messages must only contain video data.\n\nThe Video Intelligence API streaming service returns a\n[response](/video-intelligence/docs/reference/rpc/google.cloud.videointelligence.v1p3beta1#google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse)\nthat contains [results](/video-intelligence/docs/reference/rpc/google.cloud.videointelligence.v1p3beta1#google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults)\nbased on the [feature](/video-intelligence/docs/reference/rpc/google.cloud.videointelligence.v1p3beta1#google.cloud.videointelligence.v1p3beta1.StreamingFeature)\nthat you specified in your video config.\n\nIn a gRPC request, you write the binary data directly to the stream. You do\nnot need to convert the video content to base64.\n\nWe recommend that you keep the size of your video chunks to less than 10 MB.\n\nThe Video Intelligence also allows you to specify a\n[Google Cloud Storage bucket](/video-intelligence/docs/reference/rpc/google.cloud.videointelligence.v1p3beta1#google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse)\nfor your results.\n\nSupported Video Codecs\n----------------------\n\nVideo Intelligence supports the following common video formats:\n\nFor video formats that are not listed as supported, you can determine if\nyour video file supports streaming by using\na named pipe and the [ffmpeg](http://ffmpeg.org) tool. The following sample\ncommands decode a video\ninto PNG images at a rate of 0.2 fps. If your file can be successfully decoded\nusing these commands, then you can stream it using the Video Intelligence\nstreaming service. \n\n```bash\n$ mkfifo /tmp/inpipe\n$ ffmpeg -i /tmp/inpipe -r 0.2 output_%04d.png\n$ cat [FILE NAME] \u003e /tmp/inpipe\n```"]]