Merge pull request #2163 from alicevision/dev/keyframeVideoOutput

KeyframeSelection: Flag `outputExtension` attribute when it is set to "none" for video inputs
This commit is contained in:
Loïc Vital 2023-08-28 14:13:06 +02:00 committed by GitHub
commit 2bea35d00d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -3,6 +3,9 @@ __version__ = "5.0"
import os
from meshroom.core import desc
# List of supported video extensions (provided by OpenImageIO)
videoExts = [".avi", ".mov", ".mp4", ".m4a", ".m4v", ".3gp", ".3g2", ".mj2", ".m4v", ".mpg"]
class KeyframeSelectionNodeSize(desc.DynamicNodeSize):
def computeSize(self, node):
inputPathsSize = super(KeyframeSelectionNodeSize, self).computeSize(node)
@ -299,6 +302,8 @@ You can extract frames at regular interval by configuring only the min/maxFrameS
value="none",
values=["none", "exr", "jpg", "png"],
exclusive=True,
validValue=lambda node: not (any(ext in input.value.lower() for ext in videoExts for input in node.inputPaths.value) and node.outputExtension.value == "none"),
errorMessage="A video input has been provided. The output extension should be different from 'none'.",
uid=[0],
),
desc.ChoiceParam(