Skip to content

Commit

Permalink
[nodes] KeyframeSelection: Flag outputExtension for video inputs
Browse files Browse the repository at this point in the history
If at least one of the inputs is a video, then the `outputExtension`
attribute should never be set to "none": if it is, no frame will ever be
written on disk, and as a consequence, no SfMData file will be written,
meaning that the whole score computation and keyframe selection process
will have been done for nothing.
  • Loading branch information
cbentejac committed Aug 22, 2023
1 parent e6bf7e6 commit 76d2e86
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions meshroom/nodes/aliceVision/KeyframeSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
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)
Expand Down Expand Up @@ -273,6 +276,8 @@ class KeyframeSelection(desc.AVCommandLineNode):
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(
Expand Down

0 comments on commit 76d2e86

Please sign in to comment.