Add ability to disable webtorrent

In favour of HLS
This commit is contained in:
Chocobozzz 2019-11-15 15:06:03 +01:00
parent 14981d7331
commit d7a25329f9
No known key found for this signature in database
GPG key ID: 583A612D890159BE
80 changed files with 1189 additions and 540 deletions

View file

@ -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')