diff options
author | Chocobozzz <me@florianbigard.com> | 2023-06-02 15:18:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-06-29 10:16:57 +0200 |
commit | 9c5cc501335b9f7dba4aa492b8fda68d4881d28d (patch) | |
tree | f4ef0289b9c4d3bd5c8d49514946ce6eaab6d341 /server/lib | |
parent | d8f39b126d9fe4bec1c12fb213548cc6edc87867 (diff) | |
download | PeerTube-9c5cc501335b9f7dba4aa492b8fda68d4881d28d.tar.gz PeerTube-9c5cc501335b9f7dba4aa492b8fda68d4881d28d.tar.zst PeerTube-9c5cc501335b9f7dba4aa492b8fda68d4881d28d.zip |
Add script to generate storyboards
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/job-queue/handlers/generate-storyboard.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/lib/job-queue/handlers/generate-storyboard.ts b/server/lib/job-queue/handlers/generate-storyboard.ts index 652cac272..09b746a3e 100644 --- a/server/lib/job-queue/handlers/generate-storyboard.ts +++ b/server/lib/job-queue/handlers/generate-storyboard.ts | |||
@@ -43,6 +43,11 @@ async function processGenerateStoryboard (job: Job): Promise<void> { | |||
43 | const destination = join(CONFIG.STORAGE.STORYBOARDS_DIR, filename) | 43 | const destination = join(CONFIG.STORAGE.STORYBOARDS_DIR, filename) |
44 | 44 | ||
45 | const totalSprites = buildTotalSprites(video) | 45 | const totalSprites = buildTotalSprites(video) |
46 | if (totalSprites === 0) { | ||
47 | logger.info('Do not generate a storyboard of %s because the video is not long enough', payload.videoUUID, lTags) | ||
48 | return | ||
49 | } | ||
50 | |||
46 | const spriteDuration = Math.round(video.duration / totalSprites) | 51 | const spriteDuration = Math.round(video.duration / totalSprites) |
47 | 52 | ||
48 | const spritesCount = findGridSize({ | 53 | const spritesCount = findGridSize({ |