diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-22 14:28:03 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-07-26 11:29:31 +0200 |
commit | 83903cb65d531a6b6b91715387493ba8312b264d (patch) | |
tree | fd172e26a483331e74f15a062743a9d40d4016d3 /server/lib/transcoding | |
parent | c4fa01f7c45b66b112ebd08abce744b7c4041feb (diff) | |
download | PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.tar.gz PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.tar.zst PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.zip |
Generate random uuid for video files
Diffstat (limited to 'server/lib/transcoding')
-rw-r--r-- | server/lib/transcoding/video-transcoding.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/lib/transcoding/video-transcoding.ts b/server/lib/transcoding/video-transcoding.ts index 1ad63baf3..d70f7f474 100644 --- a/server/lib/transcoding/video-transcoding.ts +++ b/server/lib/transcoding/video-transcoding.ts | |||
@@ -14,7 +14,7 @@ import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION, WEBSER | |||
14 | import { VideoFileModel } from '../../models/video/video-file' | 14 | import { VideoFileModel } from '../../models/video/video-file' |
15 | import { VideoStreamingPlaylistModel } from '../../models/video/video-streaming-playlist' | 15 | import { VideoStreamingPlaylistModel } from '../../models/video/video-streaming-playlist' |
16 | import { updateMasterHLSPlaylist, updateSha256VODSegments } from '../hls' | 16 | import { updateMasterHLSPlaylist, updateSha256VODSegments } from '../hls' |
17 | import { generateVideoFilename, generateVideoStreamingPlaylistName, getVideoFilePath } from '../video-paths' | 17 | import { generateHLSVideoFilename, generateWebTorrentVideoFilename, getVideoFilePath } from '../video-paths' |
18 | import { VideoTranscodingProfilesManager } from './video-transcoding-profiles' | 18 | import { VideoTranscodingProfilesManager } from './video-transcoding-profiles' |
19 | 19 | ||
20 | /** | 20 | /** |
@@ -60,7 +60,7 @@ async function optimizeOriginalVideofile (video: MVideoFullLight, inputVideoFile | |||
60 | 60 | ||
61 | // Important to do this before getVideoFilename() to take in account the new filename | 61 | // Important to do this before getVideoFilename() to take in account the new filename |
62 | inputVideoFile.extname = newExtname | 62 | inputVideoFile.extname = newExtname |
63 | inputVideoFile.filename = generateVideoFilename(video, false, resolution, newExtname) | 63 | inputVideoFile.filename = generateWebTorrentVideoFilename(resolution, newExtname) |
64 | 64 | ||
65 | const videoOutputPath = getVideoFilePath(video, inputVideoFile) | 65 | const videoOutputPath = getVideoFilePath(video, inputVideoFile) |
66 | 66 | ||
@@ -86,7 +86,7 @@ async function transcodeNewWebTorrentResolution (video: MVideoFullLight, resolut | |||
86 | const newVideoFile = new VideoFileModel({ | 86 | const newVideoFile = new VideoFileModel({ |
87 | resolution, | 87 | resolution, |
88 | extname, | 88 | extname, |
89 | filename: generateVideoFilename(video, false, resolution, extname), | 89 | filename: generateWebTorrentVideoFilename(resolution, extname), |
90 | size: 0, | 90 | size: 0, |
91 | videoId: video.id | 91 | videoId: video.id |
92 | }) | 92 | }) |
@@ -169,7 +169,7 @@ async function mergeAudioVideofile (video: MVideoFullLight, resolution: VideoRes | |||
169 | 169 | ||
170 | // Important to do this before getVideoFilename() to take in account the new file extension | 170 | // Important to do this before getVideoFilename() to take in account the new file extension |
171 | inputVideoFile.extname = newExtname | 171 | inputVideoFile.extname = newExtname |
172 | inputVideoFile.filename = generateVideoFilename(video, false, inputVideoFile.resolution, newExtname) | 172 | inputVideoFile.filename = generateWebTorrentVideoFilename(inputVideoFile.resolution, newExtname) |
173 | 173 | ||
174 | const videoOutputPath = getVideoFilePath(video, inputVideoFile) | 174 | const videoOutputPath = getVideoFilePath(video, inputVideoFile) |
175 | // ffmpeg generated a new video file, so update the video duration | 175 | // ffmpeg generated a new video file, so update the video duration |
@@ -271,7 +271,7 @@ async function generateHlsPlaylistCommon (options: { | |||
271 | const videoTranscodedBasePath = join(transcodeDirectory, type) | 271 | const videoTranscodedBasePath = join(transcodeDirectory, type) |
272 | await ensureDir(videoTranscodedBasePath) | 272 | await ensureDir(videoTranscodedBasePath) |
273 | 273 | ||
274 | const videoFilename = generateVideoStreamingPlaylistName(video.uuid, resolution) | 274 | const videoFilename = generateHLSVideoFilename(resolution) |
275 | const playlistFilename = VideoStreamingPlaylistModel.getHlsPlaylistFilename(resolution) | 275 | const playlistFilename = VideoStreamingPlaylistModel.getHlsPlaylistFilename(resolution) |
276 | const playlistFileTranscodePath = join(videoTranscodedBasePath, playlistFilename) | 276 | const playlistFileTranscodePath = join(videoTranscodedBasePath, playlistFilename) |
277 | 277 | ||
@@ -319,7 +319,7 @@ async function generateHlsPlaylistCommon (options: { | |||
319 | resolution, | 319 | resolution, |
320 | extname, | 320 | extname, |
321 | size: 0, | 321 | size: 0, |
322 | filename: generateVideoFilename(video, true, resolution, extname), | 322 | filename: videoFilename, |
323 | fps: -1, | 323 | fps: -1, |
324 | videoStreamingPlaylistId: videoStreamingPlaylist.id | 324 | videoStreamingPlaylistId: videoStreamingPlaylist.id |
325 | }) | 325 | }) |