From d7a25329f9e607894d29ab342b9cb66638b56dc0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 15 Nov 2019 15:06:03 +0100 Subject: Add ability to disable webtorrent In favour of HLS --- server/helpers/ffmpeg-utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server/helpers/ffmpeg-utils.ts') 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 { interface HLSTranscodeOptions extends BaseTranscodeOptions { type: 'hls' + copyCodecs: boolean hlsPlaylist: { videoFilename: string } @@ -232,7 +233,7 @@ export { // --------------------------------------------------------------------------- -async function buildx264Command (command: ffmpeg.FfmpegCommand, options: VideoTranscodeOptions) { +async function buildx264Command (command: ffmpeg.FfmpegCommand, options: TranscodeOptions) { let fps = await getVideoFileFPS(options.inputPath) // On small/medium resolutions, limit FPS if ( @@ -287,7 +288,8 @@ async function buildQuickTranscodeCommand (command: ffmpeg.FfmpegCommand) { async function buildHLSCommand (command: ffmpeg.FfmpegCommand, options: HLSTranscodeOptions) { const videoPath = getHLSVideoPath(options) - command = await presetCopy(command) + if (options.copyCodecs) command = await presetCopy(command) + else command = await buildx264Command(command, options) command = command.outputOption('-hls_time 4') .outputOption('-hls_list_size 0') -- cgit v1.2.3