@@ -327,7 +327,10 @@ def stream_generator():
327
327
requests = stream_generator ()
328
328
329
329
# streaming_annotate_video returns a generator.
330
- responses = client .streaming_annotate_video (requests )
330
+ # The default timeout is about 300 seconds.
331
+ # To process longer videos it should be set to
332
+ # larger than the length (in seconds) of the stream.
333
+ responses = client .streaming_annotate_video (requests , timeout = 600 )
331
334
332
335
# Each response corresponds to about 1 second of video.
333
336
for response in responses :
@@ -388,7 +391,10 @@ def stream_generator():
388
391
requests = stream_generator ()
389
392
390
393
# streaming_annotate_video returns a generator.
391
- responses = client .streaming_annotate_video (requests )
394
+ # The default timeout is about 300 seconds.
395
+ # To process longer videos it should be set to
396
+ # larger than the length (in seconds) of the stream.
397
+ responses = client .streaming_annotate_video (requests , timeout = 600 )
392
398
393
399
# Each response corresponds to about 1 second of video.
394
400
for response in responses :
@@ -445,7 +451,10 @@ def stream_generator():
445
451
requests = stream_generator ()
446
452
447
453
# streaming_annotate_video returns a generator.
448
- responses = client .streaming_annotate_video (requests )
454
+ # The default timeout is about 300 seconds.
455
+ # To process longer videos it should be set to
456
+ # larger than the length (in seconds) of the stream.
457
+ responses = client .streaming_annotate_video (requests , timeout = 600 )
449
458
450
459
# Each response corresponds to about 1 second of video.
451
460
for response in responses :
@@ -523,7 +532,10 @@ def stream_generator():
523
532
requests = stream_generator ()
524
533
525
534
# streaming_annotate_video returns a generator.
526
- responses = client .streaming_annotate_video (requests )
535
+ # The default timeout is about 300 seconds.
536
+ # To process longer videos it should be set to
537
+ # larger than the length (in seconds) of the stream.
538
+ responses = client .streaming_annotate_video (requests , timeout = 600 )
527
539
528
540
# Each response corresponds to about 1 second of video.
529
541
for response in responses :
@@ -589,7 +601,10 @@ def stream_generator():
589
601
requests = stream_generator ()
590
602
591
603
# streaming_annotate_video returns a generator.
592
- responses = client .streaming_annotate_video (requests )
604
+ # The default timeout is about 300 seconds.
605
+ # To process longer videos it should be set to
606
+ # larger than the length (in seconds) of the stream.
607
+ responses = client .streaming_annotate_video (requests , timeout = 600 )
593
608
594
609
for response in responses :
595
610
# Check for errors.
0 commit comments