aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/ffmpeg-utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-10-26 16:44:23 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commitb5b687550d8ef8beafdf706e45d6556fb5f4c876 (patch)
tree232412d463c78af1f7ab5797db5aecf1096d08da /server/helpers/ffmpeg-utils.ts
parentef680f68351ec10ab73a1131570a6d14ce14c195 (diff)
downloadPeerTube-b5b687550d8ef8beafdf706e45d6556fb5f4c876.tar.gz
PeerTube-b5b687550d8ef8beafdf706e45d6556fb5f4c876.tar.zst
PeerTube-b5b687550d8ef8beafdf706e45d6556fb5f4c876.zip
Add ability to save live replay
Diffstat (limited to 'server/helpers/ffmpeg-utils.ts')
-rw-r--r--server/helpers/ffmpeg-utils.ts15
1 files changed, 15 insertions, 0 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
427function 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
429export { 443export {
@@ -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}