Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Video Streaming from Google Cloud Storage

How would we go about getting a video from google cloud storage and streaming that video to a mobile device?

I dont see anything related to videos in the Java API like there is for getting images with ImagesServiceFactory

The videos are only going to be a maximum of 10-15 seconds long if that makes any difference.

Any advice on how to proceed here would be great

like image 491
tyczj Avatar asked Mar 11 '16 20:03

tyczj


1 Answers

There is no difference between streaming a video and downloading any other file from the Cloud Storage. Thus, no special video API.

If the files are not public, you need a servlet that will read the content of the video from Cloud Storage and stream it to the client. Note that you cannot run it on App Engine or managed VM as they do not support file streaming and the request size is limited to 32MB.

Your best option is to run this on a Compute Engine instance:

  1. Bandwidth between Compute Engine and Cloud Storage is free.
  2. Authentication is simple.

Alternatively, you may use a signed URL for your video files. This saves you from developing/deploying a separate Compute Engine instance just for the streaming purposes - signed URLs can be returned by your existing backend.

like image 73
Andrei Volgin Avatar answered Sep 23 '22 21:09

Andrei Volgin