#185 : animated watermark causes stream to lock when switching between videos.

This commit is contained in:
vexorian 2021-01-09 20:18:14 -04:00
parent 5fc2f7a00f
commit 1a26be30d6
2 changed files with 10 additions and 6 deletions

View File

@ -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]';
}

View File

@ -740,7 +740,7 @@
<label class="form-check-label" for="overlayAnimated">
Animated Image
</label>
<small class='text-muted form-text' >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&apos;s configuration. If the image is not animated, an error will be generated.</small>
<small class='text-muted form-text' >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&apos;s configuration. If the image is not animated, there will be playback errors.</small>
</div>
<br>