Home » Guides » Getting Started » Using Zencoder on the Google Cloud Platform

permalink Using Zencoder on the Google Cloud Platform

Using Zencoder on the Google Cloud Platform

Google Cloud Storage Setup

Generate Interoperable GCS Credentials

Google Cloud Storage is interoperable with the Amazon S3 API, but requires some initial setup work. To get started with GCS on Zencoder, you'll need to enable Interoperable Access from the Google Cloud Console and generate a key. Check out the To generate a developer key section in this document for instructions on turning on interoperable access and generating access keys.

Securely Store with Zencoder Credentials

Once you have a set of Interoperable GCS credentials for your account, you can then securely store them with Zencoder, at the Zencoder Credentials page.

GCS Credentials

Under Add Credentials, select Google Cloud Storage. Then, populate the Google Cloud Storage Access Key ID and Secret Access Key parameters with your newly generated credentials. Be sure to click "Default credentials for transfers with gcs" -- this will ensure that any input or output URLs that specify the gcs:// protocol will use these credentials.

Transcoding with Google Compute Engine

Armed with a set of GCS credentials and some stored content to transcode, the next step is to start running jobs in GCE. By setting the region parameter, you can control which cloud region transcoding jobs will be run in on a job-by-job basis. The new region names for GCE are "us-central-gce" and "eu-west-gce".

The example below shows a working job which pulls an input video from GCS, creates renditions for HTTP Live Streaming, and sends the output streams to GCS. You can test this out by changing my-bucket to an existing GCS bucket that you own and pasting this into the Request Builder. Note: all existing Zencoder parameters and storage providers work with the new GCE regions, including Rackspace Cloud Files and Amazon S3.

Example HLS Job Using GCE and GCS

{
  "test": true,
  "input": "gcs://zencoder-testing/test.mov",
  "region": "us-central-gce",
  "output": [
    {
      "audio_bitrate": 64,
      "audio_sample_rate": 22050,
      "base_url": "gcs://my-bucket/",
      "filename": "file-64k.m3u8",
      "segment_seconds": 2,
      "format": "aac",
      "headers":{
        "x-goog-acl": "public-read"
      },
      "type": "segmented"
    },
    {
      "audio_bitrate": 56,
      "audio_sample_rate": 22050,
      "base_url": "gcs://my-bucket/",
      "decoder_bitrate_cap": 360,
      "decoder_buffer_size": 840,
      "filename": "file-240k.m3u8",
      "segment_seconds": 2,
      "max_frame_rate": 15,
      "type": "segmented",
      "video_bitrate": 184,
      "headers":{
        "x-goog-acl": "public-read"
      },
      "width": 400,
      "format": "ts"
    },
    {
      "audio_bitrate": 56,
      "audio_sample_rate": 22050,
      "base_url": "gcs://my-bucket/",
      "decoder_bitrate_cap": 578,
      "decoder_buffer_size": 1344,
      "filename": "file-440k.m3u8",
      "segment_seconds": 2,
      "type": "segmented",
      "video_bitrate": 384,
            "headers":{
        "x-goog-acl": "public-read"
      },
      "width": 400,
      "format": "ts"
    },
    {
      "audio_bitrate": 56,
      "audio_sample_rate": 22050,
      "base_url": "gcs://my-bucket/",
      "decoder_bitrate_cap": 960,
      "decoder_buffer_size": 2240,
      "filename": "file-640k.m3u8",
      "segment_seconds": 2,
      "type": "segmented",
      "video_bitrate": 584,
            "headers":{
        "x-goog-acl": "public-read"
      },
      "width": 480,
      "format": "ts"
    },
    {
      "audio_bitrate": 56,
      "audio_sample_rate": 22050,
      "base_url": "gcs://my-bucket/",
      "decoder_bitrate_cap": 1500,
      "decoder_buffer_size": 4000,
      "filename": "file-1040k.m3u8",
      "segment_seconds": 2,
      "type": "segmented",
      "video_bitrate": 1000,
            "headers":{
        "x-goog-acl": "public-read"
      },
      "width": 640,
      "format": "ts"
    },
    {
      "audio_bitrate": 56,
      "audio_sample_rate": 22050,
      "base_url": "gcs://my-bucket/",
      "decoder_bitrate_cap": 2310,
      "decoder_buffer_size": 5390,
      "filename": "file-1540k.m3u8",
      "segment_seconds": 2,
      "type": "segmented",
      "video_bitrate": 1484,
            "headers":{
        "x-goog-acl": "public-read"
      },
      "width": 960,
      "format": "ts"
    },
    {
      "audio_bitrate": 56,
      "audio_sample_rate": 22050,
      "base_url": "gcs://my-bucket/",
      "decoder_bitrate_cap": 3060,
      "decoder_buffer_size": 7140,
      "filename": "file-2040k.m3u8",
      "segment_seconds": 2,
      "type": "segmented",
      "video_bitrate": 1984,
            "headers":{
        "x-goog-acl": "public-read"
      },
      "width": 1024,
      "format": "ts"
    },
    {
      "base_url": "gcs://my-bucket/",
      "filename": "playlist.m3u8",
      "streams": [
        {
          "bandwidth": 2040,
          "path": "file-2040k.m3u8"
        },
        {
          "bandwidth": 1540,
          "path": "file-1540k.m3u8"
        },
        {
          "bandwidth": 1040,
          "path": "file-1040k.m3u8"
        },
        {
          "bandwidth": 640,
          "path": "file-640k.m3u8"
        },
        {
          "bandwidth": 440,
          "path": "file-440k.m3u8"
        },
        {
          "bandwidth": 240,
          "path": "file-240k.m3u8"
        },
        {
          "bandwidth": 64,
          "path": "file-64k.m3u8"
        }
      ],
      "headers":{
        "x-goog-acl": "public-read"
      },
      "type": "playlist"
    }
  ]
}

  true
  gcs://zencoder-testing/test.mov
  us-central-gce
  
    
      64
      22050
      gcs://my-bucket/
      file-64k.m3u8
      2
      aac
      
        public-read
      
      segmented
    
    
      56
      22050
      gcs://my-bucket/
      360
      840
      file-240k.m3u8
      2
      15
      segmented
      184
      
        public-read
      
      400
      ts
    
    
      56
      22050
      gcs://my-bucket/
      578
      1344
      file-440k.m3u8
      2
      segmented
      384
      
        public-read
      
      400
      ts
    
    
      56
      22050
      gcs://my-bucket/
      960
      2240
      file-640k.m3u8
      2
      segmented
      584
      
        public-read
      
      480
      ts
    
    
      56
      22050
      gcs://my-bucket/
      1500
      4000
      file-1040k.m3u8
      2
      segmented
      1000
      
        public-read
      
      640
      ts
    
    
      56
      22050
      gcs://my-bucket/
      2310
      5390
      file-1540k.m3u8
      2
      segmented
      1484
      
        public-read
      
      960
      ts
    
    
      56
      22050
      gcs://my-bucket/
      3060
      7140
      file-2040k.m3u8
      2
      segmented
      1984
      
        public-read
      
      1024
      ts
    
    
      gcs://my-bucket
      playlist.m3u8
      
        
          2040
          file-2040k.m3u8
        
        
          1540
          file-1540k.m3u8
        
        
          1040
          file-1040k.m3u8
        
        
          640
          file-640k.m3u8
        
        
          440
          file-440k.m3u8
        
        
          240
          file-240k.m3u8
        
        
          64
          file-64k.m3u8
        
      
      
        public-read
      
      playlist