From 1a26be30d6161c7ae24de282392610a7ee800b7d Mon Sep 17 00:00:00 2001 From: vexorian Date: Sat, 9 Jan 2021 20:18:14 -0400 Subject: [PATCH] #185 : animated watermark causes stream to lock when switching between videos. --- src/ffmpeg.js | 14 +++++++++----- web/public/templates/channel-config.html | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ffmpeg.js b/src/ffmpeg.js index f892cf8..f7e5de6 100644 --- a/src/ffmpeg.js +++ b/src/ffmpeg.js @@ -322,10 +322,10 @@ class FFMPEG extends events.EventEmitter { var vert = Math.round( mpVert * iH / 100.0 ); let posAry = { - 'top-left': `${horz}:${vert}`, - 'top-right': `W-w-${horz}:${vert}`, - 'bottom-left': `${horz}:H-h-${vert}`, - 'bottom-right': `W-w-${horz}:H-h-${vert}`, + 'top-left': `x=${horz}:y=${vert}`, + 'top-right': `x=W-w-${horz}:y=${vert}`, + 'bottom-left': `x=${horz}:y=H-h-${vert}`, + 'bottom-right': `x=W-w-${horz}:y=H-h-${vert}`, } let icnDur = '' if (watermark.duration > 0) { @@ -340,7 +340,11 @@ class FFMPEG extends events.EventEmitter { if (typeof(p) === 'undefined') { throw Error("Invalid watermark position: " + watermark.position); } - videoComplex += `;${currentVideo}${waterVideo}overlay=${p}${icnDur}[comb]` + let overlayShortest = ""; + if (watermark.animated) { + overlayShortest = "shortest=1:"; + } + videoComplex += `;${currentVideo}${waterVideo}overlay=${overlayShortest}${p}${icnDur}[comb]` currentVideo = '[comb]'; } diff --git a/web/public/templates/channel-config.html b/web/public/templates/channel-config.html index c605114..f88c4b6 100644 --- a/web/public/templates/channel-config.html +++ b/web/public/templates/channel-config.html @@ -740,7 +740,7 @@ - Tick this if and only if the watermark is an animated GIF or PNG. It will make it loop or not loop according to the image's configuration. If the image is not animated, an error will be generated. + Tick this if and only if the watermark is an animated GIF or PNG. It will make it loop or not loop according to the image's configuration. If the image is not animated, there will be playback errors.