Skip to content

Commit dd86b3c

Browse files
author
James Yeh
committed
adding ability to specify encoding version
1 parent d4d0153 commit dd86b3c

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export BITMOVIN_AWS_ACCESS_KEY_ID=your.access.key.id
6767
export BITMOVIN_AWS_SECRET_ACCESS_KEY=your.secret.access.key
6868
export BITMOVIN_AWS_STORAGE_REGION=your.s3.region.such.as.US_EAST_1.or.EU_WEST_1
6969
export BITMOVIN_ENCODING_REGION=your.provider.region.such.as.AWS_US_EAST_1.or.GOOGLE_EUROPE_WEST_1
70+
export BITMOVIN_ENCODING_VERSION=STABLE.or.BETA
7071
```
7172

7273

config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ type Bitmovin struct {
6868
SecretAccessKey string `envconfig:"BITMOVIN_AWS_SECRET_ACCESS_KEY"`
6969
AWSStorageRegion string `envconfig:"BITMOVIN_AWS_STORAGE_REGION" default:"US_EAST_1"`
7070
EncodingRegion string `envconfig:"BITMOVIN_ENCODING_REGION" default:"AWS_US_EAST_1"`
71+
EncodingVersion string `envconfig:"BITMOVIN_ENCODING_VERSION" default:"STABLE"`
7172
}
7273

7374
// LoadConfig loads the configuration of the API using environment variables.

config/config_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func TestLoadConfigFromEnv(t *testing.T) {
4242
"BITMOVIN_AWS_SECRET_ACCESS_KEY": "secret-key",
4343
"BITMOVIN_AWS_STORAGE_REGION": "US_WEST_1",
4444
"BITMOVIN_ENCODING_REGION": "GOOGLE_EUROPE_WEST_1",
45+
"BITMOVIN_ENCODING_VERSION": "notstable",
4546
"SWAGGER_MANIFEST_PATH": "/opt/video-transcoding-api-swagger.json",
4647
"HTTP_ACCESS_LOG": accessLog,
4748
"HTTP_PORT": "8080",
@@ -89,6 +90,7 @@ func TestLoadConfigFromEnv(t *testing.T) {
8990
SecretAccessKey: "secret-key",
9091
AWSStorageRegion: "US_WEST_1",
9192
EncodingRegion: "GOOGLE_EUROPE_WEST_1",
93+
EncodingVersion: "notstable",
9294
},
9395
Server: &server.Config{
9496
HTTPPort: 8080,
@@ -118,7 +120,7 @@ func TestLoadConfigFromEnv(t *testing.T) {
118120
}
119121
}
120122

121-
func TestLoadConfigFromEnvWithDefauts(t *testing.T) {
123+
func TestLoadConfigFromEnvWithDefaults(t *testing.T) {
122124
os.Clearenv()
123125
accessLog := "/var/log/transcoding-api-access.log"
124126
setEnvs(map[string]string{
@@ -193,6 +195,7 @@ func TestLoadConfigFromEnvWithDefauts(t *testing.T) {
193195
SecretAccessKey: "secret-key",
194196
AWSStorageRegion: "US_EAST_1",
195197
EncodingRegion: "AWS_US_EAST_1",
198+
EncodingVersion: "STABLE",
196199
},
197200
Server: &server.Config{
198201
HTTPPort: 8080,

provider/bitmovin/bitmovin.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,12 @@ func (p *bitmovinProvider) Transcode(job *db.Job) (*provider.JobStatus, error) {
423423
customData["manifest"] = manifestID
424424
}
425425
encodingRegion := bitmovintypes.CloudRegion(p.config.EncodingRegion)
426+
encodingVersion := bitmovintypes.EncoderVersion(p.config.EncodingVersion)
426427
encoding := &models.Encoding{
427-
Name: stringToPtr("encoding"),
428-
CustomData: customData,
429-
CloudRegion: encodingRegion,
428+
Name: stringToPtr("encoding"),
429+
CustomData: customData,
430+
CloudRegion: encodingRegion,
431+
EncoderVersion: encodingVersion,
430432
}
431433

432434
encodingResp, err := encodingS.Create(encoding)

0 commit comments

Comments
 (0)