bitmovin-ruby 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +3 -3
- data/examples/simple_dash.rb +36 -6
- data/lib/bitmovin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8ef07e664cfc690d2ece8094c032194931a759d
|
4
|
+
data.tar.gz: 73e0bd6e9de760cc431bbb26b1e0599b7b731a0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02ce2014b4a5b92c391c848d4998c8a10f6bc99faed2f13d35cb184ff3c169dc7839e032525c2bc25355a5da0b290b5398e567883fb0fdf63220b5c676d9b3ae
|
7
|
+
data.tar.gz: d0470fb0a1d2b9321da40ae883c18b473a0e87563f80a11c77592c5288bcb137243f3e8477c2b8fff7f71c7288e25bea9dc109ffa97efb5cdb92bf8570b74f1c
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bitmovin-ruby (0.1.
|
5
|
-
activesupport (~> 5.0.2)
|
4
|
+
bitmovin-ruby (0.1.1)
|
5
|
+
activesupport (~> 5.0.2, >= 5.0.2)
|
6
6
|
faraday (~> 0.11.0)
|
7
7
|
faraday_middleware (~> 0.11.0)
|
8
|
-
httpclient (~> 2.8.3)
|
8
|
+
httpclient (~> 2.8.3, >= 2.8.3)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
data/examples/simple_dash.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require 'bitmovin-ruby'
|
2
2
|
|
3
3
|
# CONFIGURATION
|
4
4
|
BITMOVIN_API_KEY = "YOUR API KEY HERE"
|
@@ -14,22 +14,33 @@ OUTPUT_AWS_SECRET_KEY = "YOUR AWS_SECRET_KEY"
|
|
14
14
|
|
15
15
|
Bitmovin.init(BITMOVIN_API_KEY)
|
16
16
|
|
17
|
+
|
18
|
+
# This will create a Input Bucket you can reuse in future encodings
|
19
|
+
# To get a list of all your S3Inputs do:
|
20
|
+
# Bitmovin::Encoding::Inputs::S3Input.list
|
21
|
+
|
17
22
|
s3_input = Bitmovin::Encoding::Inputs::S3Input.new({
|
18
23
|
accessKey: AWS_ACCESS_KEY,
|
19
24
|
secretKey: AWS_SECRET_KEY,
|
20
25
|
bucketName: BUCKET_NAME
|
21
26
|
}).save!
|
27
|
+
|
28
|
+
# This will create a Output Bucket you can reuse in future encodings
|
29
|
+
# To get a list of all your Output do:
|
30
|
+
# Bitmovin::Encoding::Outputs::S3Output.list
|
22
31
|
s3_output = Bitmovin::Encoding::Outputs::S3Output.new({
|
23
32
|
accessKey: OUTPUT_AWS_ACCESS_KEY,
|
24
33
|
secretKey: OUTPUT_AWS_SECRET_KEY,
|
25
34
|
bucketName: BUCKET_NAME
|
26
35
|
}).save!
|
27
36
|
|
28
|
-
enc = Bitmovin::Encoding::Encodings::EncodingTask.new({
|
29
|
-
name: "VOD Encoding Ruby"
|
30
|
-
})
|
31
|
-
enc.save!
|
32
37
|
|
38
|
+
# Please note inputs/outputs are not individual files but rather the
|
39
|
+
# Bucket you are reading/writing files to and they can be reused between encodings.
|
40
|
+
|
41
|
+
|
42
|
+
# Codec Configurations are similar to Inputs/Outputs in that they are configured once
|
43
|
+
# and can be reused for future encodings.
|
33
44
|
codec_config_720_700 = Bitmovin::Encoding::CodecConfigurations::H264Configuration.new({
|
34
45
|
name: "H264 1280x720 700kb/s",
|
35
46
|
profile: "MAIN",
|
@@ -62,6 +73,21 @@ audio_config = Bitmovin::Encoding::CodecConfigurations::AacConfiguration.new({
|
|
62
73
|
})
|
63
74
|
audio_config.save!
|
64
75
|
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
# The actual instance of the encoding task you are about to start
|
83
|
+
enc = Bitmovin::Encoding::Encodings::EncodingTask.new({
|
84
|
+
name: "VOD Encoding Ruby",
|
85
|
+
cloud_region: "AWS_AP_SOUTHEAST_1"
|
86
|
+
})
|
87
|
+
enc.save!
|
88
|
+
|
89
|
+
# Stream Configuration
|
90
|
+
|
65
91
|
stream_720_700 = enc.streams.build(name: 'H264 1280x720 700kb/s')
|
66
92
|
stream_720_700.codec_configuration = codec_config_720_700
|
67
93
|
stream_720_700.build_input_stream(input_path: INPUT_FILE_PATH, input_id: s3_input.id, selection_mode: 'AUTO')
|
@@ -82,6 +108,8 @@ stream_aac.codec_configuration = audio_config
|
|
82
108
|
stream_aac.build_input_stream(input_path: INPUT_FILE_PATH, input_id: s3_input.id, selection_mode: 'AUTO')
|
83
109
|
stream_aac.save!
|
84
110
|
|
111
|
+
# Muxing Configuration
|
112
|
+
|
85
113
|
fmp4_muxing_720_700 = enc.muxings.fmp4.build(name: 'H264 1280x720 700kb/s', segment_length: 4)
|
86
114
|
fmp4_muxing_720_700.build_output({
|
87
115
|
output_id: s3_output.id,
|
@@ -114,6 +142,8 @@ audio_muxing.build_output({
|
|
114
142
|
audio_muxing.streams << stream_aac.id
|
115
143
|
audio_muxing.save!
|
116
144
|
|
145
|
+
|
146
|
+
# Starting an encoding and monitoring it's status
|
117
147
|
enc.start!
|
118
148
|
|
119
149
|
while(enc.status != 'FINISHED')
|
@@ -128,7 +158,7 @@ puts "Encoding finished!"
|
|
128
158
|
|
129
159
|
|
130
160
|
|
131
|
-
#
|
161
|
+
# Generating a DASH Manifest
|
132
162
|
|
133
163
|
puts "Starting Manifest generation"
|
134
164
|
manifest = Bitmovin::Encoding::Manifests::DashManifest.new({
|
data/lib/bitmovin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitmovin-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Hoelbling-Inzko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|