Medium/zencoder

Name: zencoder

Owner: Medium

Description: Go interface for Zencoder API

Forked from: go-zencoder/zencoder

Created: 2017-01-31 00:05:44.0

Updated: 2017-01-31 00:05:46.0

Pushed: 2017-01-31 03:04:53.0

Homepage:

Size: 38

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

zencoder

Build Status Coverage Status

Go integration for Zencoder API video transcoding service.

Requirements

Documentation

Godoc documentation is available at http://godoc.org/github.com/go-zencoder/zencoder.

Installation

 get github.com/go-zencoder/zencoder

Usage

Import Zencoder

Ensure you have imported the zencoder package at the top of your source file.

rt "github.com/go-zencoder/zencoder"
Create a connection to Zencoder

All Zencoder methods are on the Zencoder struct. Create a new one bound to your API key using `zencoder.NewZencoder`.

ake sure you replace [YOUR API KEY HERE] with your API key
= zencoder.NewZencoder("[YOUR API KEY HERE]")
Jobs
Create a Job
ings := &zencoder.EncodingSettings{
Input: "s3://zencodertesting/test.mov",
Test:  true,

 err := zc.CreateJob(settings)
List Jobs
, err := zc.ListJobs()
Get Job Details
ils, err := zc.GetJobDetails(12345)
Job Progress
ress, err := zc.GetJobProgress(12345)
Resubmit a Job
:= zc.ResubmitJob(12345)
Cancel a Job
:= zc.CancelJob(12345)
Finish a Live Job
:= zc.FinishLiveJob(12345)
Inputs
Get Input Details
ils, err := zc.GetInputDetails(12345)
Input Progress
ress, err := zc.GetInputProgress(12345)
Outputs
Get Output Details
ils, err := zc.GetOutputDetails(12345)
Output Progress
ress, err := zc.GetOutputProgress(12345)
Accounts
Get Account Details
unt, err := zc.GetAccount()
Set Integration Mode
:= zc.SetIntegrationMode()
Set Live Mode
:= zc.SetLiveMode()
Reports
ReportSettings

All reporting interfaces take either `nilor a ``ReportSettings``` object.

Using `nildenotes to use default settings. In this case, assume ``settings``` in the examples below is defined as:

settings *zencoder.ReportSettings = nil

A `ReportSettings` object can either be constructed manually as in:

start, end time.Date
ings := &zencoder.ReportSettings{
From:     &start,
To:       &end,
Grouping: "key",

Or, you can use a Fluent-style interface to build a `ReportSettings` object, as in:

start, end time.Date
ings := zencoder.ReportFrom(start).To(time).Grouping("key")
Get VOD Usage
e, err := zc.GetVodUsage(settings)
Get Live Usage
e, err := zc.GetLiveUsage(settings)
Get Total Usage
e, err := zc.GetUsage(settings)
Encoding Settings

See Zencoder API documentation for all encoding settings available in zencoder.EncodingSettings. All settings are currently supported, with the main difference being the casing of the options to fit with Go naming conventions.

Contributing

Please see CONTRIBUTING.md. If you have a bugfix or new feature that you would like to contribute, please find or open an issue about it first.

License

Licensed under the MIT License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.