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/controllers | |
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/controllers')
-rw-r--r-- | server/controllers/api/videos/index.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 6fa84c801..14c969ec3 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -39,13 +39,12 @@ import { | |||
39 | getFormattedObjects, | 39 | getFormattedObjects, |
40 | renamePromise | 40 | renamePromise |
41 | } from '../../../helpers' | 41 | } from '../../../helpers' |
42 | import { TagInstance } from '../../../models' | 42 | import { TagInstance, VideoInstance } from '../../../models' |
43 | import { VideoCreate, VideoUpdate } from '../../../../shared' | 43 | import { VideoCreate, VideoUpdate, VideoResolution } from '../../../../shared' |
44 | 44 | ||
45 | import { abuseVideoRouter } from './abuse' | 45 | import { abuseVideoRouter } from './abuse' |
46 | import { blacklistRouter } from './blacklist' | 46 | import { blacklistRouter } from './blacklist' |
47 | import { rateVideoRouter } from './rate' | 47 | import { rateVideoRouter } from './rate' |
48 | import { VideoInstance } from '../../../models/video/video-interface' | ||
49 | 48 | ||
50 | const videosRouter = express.Router() | 49 | const videosRouter = express.Router() |
51 | 50 | ||
@@ -195,7 +194,7 @@ function addVideo (req: express.Request, res: express.Response, videoPhysicalFil | |||
195 | .then(({ author, tagInstances, video }) => { | 194 | .then(({ author, tagInstances, video }) => { |
196 | const videoFileData = { | 195 | const videoFileData = { |
197 | extname: extname(videoPhysicalFile.filename), | 196 | extname: extname(videoPhysicalFile.filename), |
198 | resolution: 0, // TODO: improve readability, | 197 | resolution: VideoResolution.ORIGINAL, |
199 | size: videoPhysicalFile.size | 198 | size: videoPhysicalFile.size |
200 | } | 199 | } |
201 | 200 | ||
@@ -230,7 +229,7 @@ function addVideo (req: express.Request, res: express.Response, videoPhysicalFil | |||
230 | } | 229 | } |
231 | 230 | ||
232 | tasks.push( | 231 | tasks.push( |
233 | JobScheduler.Instance.createJob(t, 'videoTranscoder', dataInput) | 232 | JobScheduler.Instance.createJob(t, 'videoFileOptimizer', dataInput) |
234 | ) | 233 | ) |
235 | } | 234 | } |
236 | 235 | ||