/// <summary>Snippet for AnnotateVideo</summary>
        public void AnnotateVideo_RequestObject()
        {
            // Snippet: AnnotateVideo(AnnotateVideoRequest,CallSettings)
            // Create client
            VideoIntelligenceServiceClient videoIntelligenceServiceClient = VideoIntelligenceServiceClient.Create();
            // Initialize request argument(s)
            AnnotateVideoRequest request = new AnnotateVideoRequest();
            // Make the request
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> response =
                videoIntelligenceServiceClient.AnnotateVideo(request);

            // Poll until the returned long-running operation is complete
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> completedResponse =
                response.PollUntilCompleted();
            // Retrieve the operation result
            AnnotateVideoResponse result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> retrievedResponse =
                videoIntelligenceServiceClient.PollOnceAnnotateVideo(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AnnotateVideoResponse retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>Snippet for AnnotateVideo</summary>
        public void AnnotateVideo()
        {
            // Snippet: AnnotateVideo(string,IEnumerable<Feature>,CallSettings)
            // Create client
            VideoIntelligenceServiceClient videoIntelligenceServiceClient = VideoIntelligenceServiceClient.Create();
            // Initialize request argument(s)
            string inputUri = "gs://demomaker/cat.mp4";
            IEnumerable <Feature> features = new[]
            {
                Feature.LabelDetection,
            };
            // Make the request
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> response =
                videoIntelligenceServiceClient.AnnotateVideo(inputUri, features);

            // Poll until the returned long-running operation is complete
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> completedResponse =
                response.PollUntilCompleted();
            // Retrieve the operation result
            AnnotateVideoResponse result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> retrievedResponse =
                videoIntelligenceServiceClient.PollOnceAnnotateVideo(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AnnotateVideoResponse retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Esempio n. 3
0
        public void AnnotateVideo()
        {
            // Snippet: AnnotateVideo(string,IEnumerable<Feature>,VideoContext,string,string,CallSettings)
            // Create client
            VideoIntelligenceServiceClient videoIntelligenceServiceClient = VideoIntelligenceServiceClient.Create();
            // Initialize request argument(s)
            string inputUri = "";
            IEnumerable <Feature> features     = new List <Feature>();
            VideoContext          videoContext = new VideoContext();
            string outputUri  = "";
            string locationId = "";
            // Make the request
            Operation <AnnotateVideoResponse> response =
                videoIntelligenceServiceClient.AnnotateVideo(inputUri, features, videoContext, outputUri, locationId);

            // Poll until the returned long-running operation is complete
            Operation <AnnotateVideoResponse> completedResponse =
                response.PollUntilCompleted();
            // Retrieve the operation result
            AnnotateVideoResponse result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <AnnotateVideoResponse> retrievedResponse =
                videoIntelligenceServiceClient.PollOnceAnnotateVideo(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AnnotateVideoResponse retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }