aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/ffmpeg-utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/ffmpeg-utils.ts')
-rw-r--r--server/helpers/ffmpeg-utils.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts
index 5ad8ed48e..133b1b03b 100644
--- a/server/helpers/ffmpeg-utils.ts
+++ b/server/helpers/ffmpeg-utils.ts
@@ -122,7 +122,9 @@ type TranscodeOptions = {
122 resolution: VideoResolution 122 resolution: VideoResolution
123 isPortraitMode?: boolean 123 isPortraitMode?: boolean
124 124
125 generateHlsPlaylist?: boolean 125 hlsPlaylist?: {
126 videoFilename: string
127 }
126} 128}
127 129
128function transcode (options: TranscodeOptions) { 130function transcode (options: TranscodeOptions) {
@@ -161,14 +163,16 @@ function transcode (options: TranscodeOptions) {
161 command = command.withFPS(fps) 163 command = command.withFPS(fps)
162 } 164 }
163 165
164 if (options.generateHlsPlaylist) { 166 if (options.hlsPlaylist) {
165 const segmentFilename = `${dirname(options.outputPath)}/${options.resolution}_%03d.ts` 167 const videoPath = `${dirname(options.outputPath)}/${options.hlsPlaylist.videoFilename}`
166 168
167 command = command.outputOption('-hls_time 4') 169 command = command.outputOption('-hls_time 4')
168 .outputOption('-hls_list_size 0') 170 .outputOption('-hls_list_size 0')
169 .outputOption('-hls_playlist_type vod') 171 .outputOption('-hls_playlist_type vod')
170 .outputOption('-hls_segment_filename ' + segmentFilename) 172 .outputOption('-hls_segment_filename ' + videoPath)
173 .outputOption('-hls_segment_type fmp4')
171 .outputOption('-f hls') 174 .outputOption('-f hls')
175 .outputOption('-hls_flags single_file')
172 } 176 }
173 177
174 command 178 command