aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-transcoding.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/video-transcoding.ts')
-rw-r--r--server/lib/video-transcoding.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts
index 0d5b3ae39..dcda82e0a 100644
--- a/server/lib/video-transcoding.ts
+++ b/server/lib/video-transcoding.ts
@@ -3,6 +3,7 @@ import { basename, extname as extnameUtil, join } from 'path'
3import { 3import {
4 canDoQuickTranscode, 4 canDoQuickTranscode,
5 getDurationFromVideoFile, 5 getDurationFromVideoFile,
6 getMetadataFromFile,
6 getVideoFileFPS, 7 getVideoFileFPS,
7 transcode, 8 transcode,
8 TranscodeOptions, 9 TranscodeOptions,
@@ -202,10 +203,11 @@ async function generateHlsPlaylist (video: MVideoWithFile, resolution: VideoReso
202 203
203 newVideoFile.size = stats.size 204 newVideoFile.size = stats.size
204 newVideoFile.fps = await getVideoFileFPS(videoFilePath) 205 newVideoFile.fps = await getVideoFileFPS(videoFilePath)
206 newVideoFile.metadata = await getMetadataFromFile(videoFilePath)
205 207
206 await createTorrentAndSetInfoHash(videoStreamingPlaylist, newVideoFile) 208 await createTorrentAndSetInfoHash(videoStreamingPlaylist, newVideoFile)
207 209
208 await newVideoFile.save() 210 await VideoFileModel.customUpsert(newVideoFile, 'streaming-playlist', undefined)
209 videoStreamingPlaylist.VideoFiles = await videoStreamingPlaylist.$get('VideoFiles') 211 videoStreamingPlaylist.VideoFiles = await videoStreamingPlaylist.$get('VideoFiles')
210 212
211 video.setHLSPlaylist(videoStreamingPlaylist) 213 video.setHLSPlaylist(videoStreamingPlaylist)
@@ -230,11 +232,13 @@ export {
230async function onVideoFileTranscoding (video: MVideoWithFile, videoFile: MVideoFile, transcodingPath: string, outputPath: string) { 232async function onVideoFileTranscoding (video: MVideoWithFile, videoFile: MVideoFile, transcodingPath: string, outputPath: string) {
231 const stats = await stat(transcodingPath) 233 const stats = await stat(transcodingPath)
232 const fps = await getVideoFileFPS(transcodingPath) 234 const fps = await getVideoFileFPS(transcodingPath)
235 const metadata = await getMetadataFromFile(transcodingPath)
233 236
234 await move(transcodingPath, outputPath) 237 await move(transcodingPath, outputPath)
235 238
236 videoFile.size = stats.size 239 videoFile.size = stats.size
237 videoFile.fps = fps 240 videoFile.fps = fps
241 videoFile.metadata = metadata
238 242
239 await createTorrentAndSetInfoHash(video, videoFile) 243 await createTorrentAndSetInfoHash(video, videoFile)
240 244