diff options
author | Chocobozzz <me@florianbigard.com> | 2020-10-26 16:44:23 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | b5b687550d8ef8beafdf706e45d6556fb5f4c876 (patch) | |
tree | 232412d463c78af1f7ab5797db5aecf1096d08da /server/helpers | |
parent | ef680f68351ec10ab73a1131570a6d14ce14c195 (diff) | |
download | PeerTube-b5b687550d8ef8beafdf706e45d6556fb5f4c876.tar.gz PeerTube-b5b687550d8ef8beafdf706e45d6556fb5f4c876.tar.zst PeerTube-b5b687550d8ef8beafdf706e45d6556fb5f4c876.zip |
Add ability to save live replay
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/ffmpeg-utils.ts | 15 | ||||
-rw-r--r-- | server/helpers/image-utils.ts | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts index b25dcaa90..2f167a580 100644 --- a/server/helpers/ffmpeg-utils.ts +++ b/server/helpers/ffmpeg-utils.ts | |||
@@ -424,6 +424,20 @@ function runLiveMuxing (rtmpUrl: string, outPath: string, deleteSegments: boolea | |||
424 | return command | 424 | return command |
425 | } | 425 | } |
426 | 426 | ||
427 | function hlsPlaylistToFragmentedMP4 (playlistPath: string, outputPath: string) { | ||
428 | const command = getFFmpeg(playlistPath) | ||
429 | |||
430 | command.outputOption('-c copy') | ||
431 | command.output(outputPath) | ||
432 | |||
433 | command.run() | ||
434 | |||
435 | return new Promise<string>((res, rej) => { | ||
436 | command.on('error', err => rej(err)) | ||
437 | command.on('end', () => res()) | ||
438 | }) | ||
439 | } | ||
440 | |||
427 | // --------------------------------------------------------------------------- | 441 | // --------------------------------------------------------------------------- |
428 | 442 | ||
429 | export { | 443 | export { |
@@ -443,6 +457,7 @@ export { | |||
443 | getVideoFileFPS, | 457 | getVideoFileFPS, |
444 | computeResolutionsToTranscode, | 458 | computeResolutionsToTranscode, |
445 | audio, | 459 | audio, |
460 | hlsPlaylistToFragmentedMP4, | ||
446 | getVideoFileBitrate, | 461 | getVideoFileBitrate, |
447 | canDoQuickTranscode | 462 | canDoQuickTranscode |
448 | } | 463 | } |
diff --git a/server/helpers/image-utils.ts b/server/helpers/image-utils.ts index f2f6a004f..5f254a7aa 100644 --- a/server/helpers/image-utils.ts +++ b/server/helpers/image-utils.ts | |||
@@ -21,7 +21,7 @@ async function processImage ( | |||
21 | try { | 21 | try { |
22 | jimpInstance = await Jimp.read(path) | 22 | jimpInstance = await Jimp.read(path) |
23 | } catch (err) { | 23 | } catch (err) { |
24 | logger.debug('Cannot read %s with jimp. Try to convert the image using ffmpeg first.', { err }) | 24 | logger.debug('Cannot read %s with jimp. Try to convert the image using ffmpeg first.', path, { err }) |
25 | 25 | ||
26 | const newName = path + '.jpg' | 26 | const newName = path + '.jpg' |
27 | await convertWebPToJPG(path, newName) | 27 | await convertWebPToJPG(path, newName) |