diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-15 15:06:03 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-25 10:59:43 +0100 |
commit | d7a25329f9e607894d29ab342b9cb66638b56dc0 (patch) | |
tree | 6cd6bc4f2689f78944238b313c93427423a932ac /server/helpers/ffmpeg-utils.ts | |
parent | 14981d7331da3f63fe6cfaf020ccb7c910006eaf (diff) | |
download | PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.gz PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.zst PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.zip |
Add ability to disable webtorrent
In favour of HLS
Diffstat (limited to 'server/helpers/ffmpeg-utils.ts')
-rw-r--r-- | server/helpers/ffmpeg-utils.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts index c0e9702a8..7a4ac0970 100644 --- a/server/helpers/ffmpeg-utils.ts +++ b/server/helpers/ffmpeg-utils.ts | |||
@@ -130,6 +130,7 @@ interface BaseTranscodeOptions { | |||
130 | 130 | ||
131 | interface HLSTranscodeOptions extends BaseTranscodeOptions { | 131 | interface HLSTranscodeOptions extends BaseTranscodeOptions { |
132 | type: 'hls' | 132 | type: 'hls' |
133 | copyCodecs: boolean | ||
133 | hlsPlaylist: { | 134 | hlsPlaylist: { |
134 | videoFilename: string | 135 | videoFilename: string |
135 | } | 136 | } |
@@ -232,7 +233,7 @@ export { | |||
232 | 233 | ||
233 | // --------------------------------------------------------------------------- | 234 | // --------------------------------------------------------------------------- |
234 | 235 | ||
235 | async function buildx264Command (command: ffmpeg.FfmpegCommand, options: VideoTranscodeOptions) { | 236 | async function buildx264Command (command: ffmpeg.FfmpegCommand, options: TranscodeOptions) { |
236 | let fps = await getVideoFileFPS(options.inputPath) | 237 | let fps = await getVideoFileFPS(options.inputPath) |
237 | // On small/medium resolutions, limit FPS | 238 | // On small/medium resolutions, limit FPS |
238 | if ( | 239 | if ( |
@@ -287,7 +288,8 @@ async function buildQuickTranscodeCommand (command: ffmpeg.FfmpegCommand) { | |||
287 | async function buildHLSCommand (command: ffmpeg.FfmpegCommand, options: HLSTranscodeOptions) { | 288 | async function buildHLSCommand (command: ffmpeg.FfmpegCommand, options: HLSTranscodeOptions) { |
288 | const videoPath = getHLSVideoPath(options) | 289 | const videoPath = getHLSVideoPath(options) |
289 | 290 | ||
290 | command = await presetCopy(command) | 291 | if (options.copyCodecs) command = await presetCopy(command) |
292 | else command = await buildx264Command(command, options) | ||
291 | 293 | ||
292 | command = command.outputOption('-hls_time 4') | 294 | command = command.outputOption('-hls_time 4') |
293 | .outputOption('-hls_list_size 0') | 295 | .outputOption('-hls_list_size 0') |