diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-02 12:20:26 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-03 15:31:26 +0200 |
commit | 40298b02546e8225dd21bf6048fe7f224aefc32a (patch) | |
tree | 0a0b981dbeb2af47810adff6553a0df995a03734 /server/initializers | |
parent | f0adb2701c1cf404ff63095f71e542bfe6d025ae (diff) | |
download | PeerTube-40298b02546e8225dd21bf6048fe7f224aefc32a.tar.gz PeerTube-40298b02546e8225dd21bf6048fe7f224aefc32a.tar.zst PeerTube-40298b02546e8225dd21bf6048fe7f224aefc32a.zip |
Implement video transcoding on server side
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/constants.ts | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 54e91d35d..073fabd27 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -10,7 +10,8 @@ import { | |||
10 | RequestEndpoint, | 10 | RequestEndpoint, |
11 | RequestVideoEventType, | 11 | RequestVideoEventType, |
12 | RequestVideoQaduType, | 12 | RequestVideoQaduType, |
13 | JobState | 13 | JobState, |
14 | VideoResolution | ||
14 | } from '../../shared/models' | 15 | } from '../../shared/models' |
15 | 16 | ||
16 | // --------------------------------------------------------------------------- | 17 | // --------------------------------------------------------------------------- |
@@ -85,7 +86,14 @@ const CONFIG = { | |||
85 | }, | 86 | }, |
86 | TRANSCODING: { | 87 | TRANSCODING: { |
87 | ENABLED: config.get<boolean>('transcoding.enabled'), | 88 | ENABLED: config.get<boolean>('transcoding.enabled'), |
88 | THREADS: config.get<number>('transcoding.threads') | 89 | THREADS: config.get<number>('transcoding.threads'), |
90 | RESOLUTIONS: { | ||
91 | '240' : config.get<boolean>('transcoding.resolutions.240p'), | ||
92 | '360': config.get<boolean>('transcoding.resolutions.360p'), | ||
93 | '480': config.get<boolean>('transcoding.resolutions.480p'), | ||
94 | '720': config.get<boolean>('transcoding.resolutions.720p'), | ||
95 | '1080': config.get<boolean>('transcoding.resolutions.1080p') | ||
96 | } | ||
89 | }, | 97 | }, |
90 | CACHE: { | 98 | CACHE: { |
91 | PREVIEWS: { | 99 | PREVIEWS: { |
@@ -144,7 +152,7 @@ const VIDEO_CATEGORIES = { | |||
144 | 9: 'Comedy', | 152 | 9: 'Comedy', |
145 | 10: 'Entertainment', | 153 | 10: 'Entertainment', |
146 | 11: 'News', | 154 | 11: 'News', |
147 | 12: 'Howto', | 155 | 12: 'How To', |
148 | 13: 'Education', | 156 | 13: 'Education', |
149 | 14: 'Activism', | 157 | 14: 'Activism', |
150 | 15: 'Science & Technology', | 158 | 15: 'Science & Technology', |
@@ -179,15 +187,17 @@ const VIDEO_LANGUAGES = { | |||
179 | 11: 'German', | 187 | 11: 'German', |
180 | 12: 'Korean', | 188 | 12: 'Korean', |
181 | 13: 'French', | 189 | 13: 'French', |
182 | 14: 'Italien' | 190 | 14: 'Italian' |
183 | } | 191 | } |
184 | 192 | ||
185 | const VIDEO_FILE_RESOLUTIONS = { | 193 | // TODO: use VideoResolution when https://github.com/Microsoft/TypeScript/issues/13042 is fixed |
194 | const VIDEO_FILE_RESOLUTIONS: { [ id: number ]: string } = { | ||
186 | 0: 'original', | 195 | 0: 'original', |
187 | 1: '360p', | 196 | 240: '240p', |
188 | 2: '480p', | 197 | 360: '360p', |
189 | 3: '720p', | 198 | 480: '480p', |
190 | 4: '1080p' | 199 | 720: '720p', |
200 | 1080: '1080p' | ||
191 | } | 201 | } |
192 | 202 | ||
193 | // --------------------------------------------------------------------------- | 203 | // --------------------------------------------------------------------------- |
@@ -202,7 +212,7 @@ const FRIEND_SCORE = { | |||
202 | 212 | ||
203 | // Number of points we add/remove from a friend after a successful/bad request | 213 | // Number of points we add/remove from a friend after a successful/bad request |
204 | const PODS_SCORE = { | 214 | const PODS_SCORE = { |
205 | MALUS: -10, | 215 | PENALTY: -10, |
206 | BONUS: 10 | 216 | BONUS: 10 |
207 | } | 217 | } |
208 | 218 | ||