Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
La première étape de l'analyse de vos données vidéo avec une application consiste à créer un pipeline pour le flux continu de données.
Les flux permettent d'ingérer des données vidéo en temps réel, qui peuvent ensuite être utilisées comme entrée pour des modèles ou stockées dans un entrepôt.
Créer un flux
Pour pouvoir diffuser des données vidéo, vous devez d'abord créer un flux.
La première fois que vous créez un flux dans un nouveau projet, cela peut prendre un certain temps.
Ce délai est d'environ 30 minutes. Ce délai est dû au fait que le système doit initialiser un cluster de calcul pour les calculs suivants.
Console
Créez un flux dans la console Google Cloud .
Ouvrez l'onglet Flux du tableau de bord Vision Vertex AI.
Si la vidéo ne répond pas à ces spécifications, Vertex AI Vision risque de ne pas bien traiter l'entrée.
L'audio est abandonné lors de l'ingestion.
Si le flux fait partie d'une application connectée à un entrepôt, les paramètres vidéo (tels que les FPS ou la résolution) doivent être les mêmes pour l'ensemble du flux. Les variations des paramètres de données vidéo RTSP ou des paramètres de données vidéo locales ne sont pas acceptées.
En raison de la latence de démarrage du modèle, les premières secondes du contenu des vidéos ingérées peuvent être manquantes. Cette durée peut atteindre 15 secondes.
L'arrêt de l'ingestion peut se produire après une longue connexion (environ cinq heures en moyenne). L'outil vaictl ne permet pas de se reconnecter. Les utilisateurs doivent le faire manuellement.
Bien que vaictl soit un outil utile pour ingérer des données vidéo, il ne gère pas automatiquement la récupération en cas d'erreurs réseau. Ces erreurs peuvent provenir du côté de la source de données ou de l'ingestion dans le cloud. Il incombe à l'utilisateur de créer un script de redémarrage pour gérer les arrêts inattendus des opérations vaictl.
LOCAL_FILE.EXT: nom de fichier d'un fichier vidéo local. Exemple : my-video.mp4.
STREAM_ID: ID du flux que vous avez créé dans le cluster (par exemple, input-1).
RTSP_ADDRESS: adresse de votre flux RTSP (Real Time Streaming Protocol). Par exemple, rtsp://my-ip-camera.
Données vidéo locales :
# This command streams a video file to a stream. Streaming ends when the video ends.
vaictl -p PROJECT_ID \
-l LOCATION_ID \
-c application-cluster-0 \
--service-endpoint visionai.googleapis.com \
send video-file to streams STREAM_ID --file-path LOCAL_FILE.EXT
Données vidéo locales (en boucle):
# This command streams a video file to a stream. Video is looped into the stream until you stop the command.
vaictl -p PROJECT_ID \
-l LOCATION_ID \
-c application-cluster-0 \
--service-endpoint visionai.googleapis.com \
send video-file to streams STREAM_ID --file-path LOCAL_FILE.EXT--loop
Données de flux RTSP (Real Time Streaming Protocol) :
# This command will send an RTSP feed into the stream.# This command has to run in the network that has direct access to the RTSP feed.
vaictl-pPROJECT_ID\-lLOCATION_ID\-capplication-cluster-0\--service-endpointvisionai.googleapis.com\
sendrtsptostreamsSTREAM_ID--rtsp-uriRTSP_ADDRESS
Lire des vidéos ingérées
Une fois que vous avez créé un flux et envoyé du contenu vidéo à ce flux, vous pouvez lire ce contenu vidéo.
Si vous laissez l'onglet de la vue en streaming ouvert pendant plus d'une heure, vous devez actualiser la page pour continuer à charger les contenus vidéo.
Console
Lire la vidéo ingérée dans la console Google Cloud
Ouvrez l'onglet Flux du tableau de bord Vertex AI Vision.
Cliquez sur le nom du flux dans la liste des flux.
Sur la page d'informations du flux vidéo, la vue en direct de la vidéo ingérée se charge automatiquement.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Create streams and ingest data\n\nThe first step in analyzing your video data with an application is\ncreating a pipeline for the continuous flow of data.\nStreams offers the ability to ingest real-time video data, which then\ncan be used as input for models or stored in a Warehouse.\n\nCreate a Stream\n---------------\n\nTo be able to stream video data you must first create a stream.\n\n\nThe first time you create a stream in a new project it can take some time to create the stream.\nThis time is around 30 minutes. This time is due to the system needing to initialize a\ncomputation cluster for subsequent computations.\n\n\u003cbr /\u003e\n\n### Console\n\nCreate a stream in the Google Cloud console.\n\n1. Open the **Streams** tab of the Vertex AI Vision dashboard.\n\n [Go to the Streams tab](https://console.cloud.google.com/ai/vision-ai/video-streams)\n2. Click add**Register**.\n\n3. Enter the stream name and select a region. You can click **Add Row** to\n register multiple streams at the same time.\n\n4. Click the **Register** button to create one or more streams.\n\nIngest videos\n-------------\n\nAfter you have created a stream you can begin to ingest data using that stream.\n\n\nSome limitations and considerations apply to ingested video:\n\n- The input video source must have the following specifications:\n - [H.264 encoding](https://en.wikipedia.org/wiki/Advanced_Video_Coding)\n - \\\u003c= 1080p resolution\n - \\~25\n\n If the video doesn't meet these specifications Vertex AI Vision may not\n process the input well.\n- Audio is dropped during ingestion.\n- If the stream is part of an app connected to a warehouse, video parameters (such as FPS or resolution) must be the same for the whole stream ; variations in RTSP video data parameters or local video data parameters are not supported.\n- Due to model startup latency, ingested videos may have the first few seconds of content missing. This amount of time can reach up to fifteen seconds.\n- Ingestion termination can happen after long connection (\\~5 hours, on average). There's no reconnection capability from the `vaictl` tool ; users must manually reconnect.\n- While `vaictl` is a useful tool for ingesting video data, the tool does not automatically handle recovery from network errors. These errors may either come from the data-source side or the Cloud-ingestion side. It's the user's responsibility to create a restart script to handle unexpected `vaictl` operation terminations.\n\n\u003cbr /\u003e\n\n### Vertex AI Vision SDK\n\nTo send a request to ingest video data using an existing stream you must\n[install the Vertex AI Vision SDK](/vision-ai/docs/cloud-environment#install_the_streams_sdk).\n\n\n| **Note** : You may need to establish user access credentials by running the following command: `gcloud auth application-default login`. For more information about this command, see the [Vertex AI Vision SDK\n| reference documentation](/sdk/gcloud/reference/auth/application-default/login).\n\n\u003cbr /\u003e\n\nMake the following variable substitutions:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: Your location ID. For example, `us-central1`. [More information](/about/locations). [Supported regions](/vision-ai/docs/warehouse-supported-regions).\n- \u003cvar translate=\"no\"\u003eLOCAL_FILE.EXT\u003c/var\u003e: The filename of a local video file. For example, `my-video.mp4`.\n- \u003cvar translate=\"no\"\u003eSTREAM_ID\u003c/var\u003e: The stream ID that you created in the cluster For example, `input-1`.\n- \u003cvar translate=\"no\"\u003eRTSP_ADDRESS\u003c/var\u003e: The address of your Real Time Streaming Protocol ([RTSP](https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol)) feed. For example, `rtsp://my-ip-camera`.\n\n**Local video data:** \n\n # This command streams a video file to a stream. Streaming ends when the video ends.\n vaictl -p \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n -l \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e \\\n -c application-cluster-0 \\\n --service-endpoint visionai.googleapis.com \\\n send video-file to streams \u003cvar translate=\"no\"\u003eSTREAM_ID\u003c/var\u003e --file-path \u003cvar translate=\"no\"\u003eLOCAL_FILE.EXT\u003c/var\u003e\n\n**Local video data (looped):** \n\n # This command streams a video file to a stream. Video is looped into the stream until you stop the command.\n vaictl -p \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n -l \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e \\\n -c application-cluster-0 \\\n --service-endpoint visionai.googleapis.com \\\n send video-file to streams \u003cvar translate=\"no\"\u003eSTREAM_ID\u003c/var\u003e --file-path \u003cvar translate=\"no\"\u003eLOCAL_FILE.EXT\u003c/var\u003e --loop\n\n**Real Time Streaming Protocol (RTSP) feed data:** \n\n # This command will send an RTSP feed into the stream.\n # This command has to run in the network that has direct access to the RTSP feed.\n vaictl -p \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n -l \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e \\\n -c application-cluster-0 \\\n --service-endpoint visionai.googleapis.com \\\n send rtsp to streams \u003cvar translate=\"no\"\u003eSTREAM_ID\u003c/var\u003e --rtsp-uri \u003cvar translate=\"no\"\u003eRTSP_ADDRESS\u003c/var\u003e\n\nPlay ingested videos\n--------------------\n\nAfter you have created a stream and sent video content to the stream you can\nplay the video content.\n\nIf you leave the stream view tab open for more than one hour, you must\nrefresh the page to continue to load video contents. \n\n### Console\n\nPlay ingested video in the Google Cloud console.\n\n1. Open the **Streams** tab of the Vertex AI Vision dashboard.\n\n [Go to the Streams tab](https://console.cloud.google.com/ai/vision-ai/video-streams)\n2. Click on the stream name from the streams list.\n\n3. In the video stream detail page the ingested video live view\n automatically loads."]]