diff --git a/main.py b/main.py index 049d30b..8f7d3f3 100644 --- a/main.py +++ b/main.py @@ -14,13 +14,14 @@ check_ffmpeg() from src.editors.amplitude.editor import AmplitudeEditor from src.editors.sentiment.editor import SentimentEditor +from src.editors.passthrough.editor import PassthroughEditor from src.math.cost import quadratic_loss from src.mediautils.audio import extract_audio_from_video from src.mediautils.video import render_moments log = structlog.get_logger() -EDITORS = {"amplitude": AmplitudeEditor, "sentiment": SentimentEditor} +EDITORS = {"amplitude": AmplitudeEditor, "sentiment": SentimentEditor, "passthrough": PassthroughEditor} ERROR_FUNCS = {"quadratic": quadratic_loss} @@ -158,6 +159,11 @@ if __name__ == "__main__": choices=["base", "tiny", "small", "medium", "large"], ) + parser_passthrough = subparsers.add_parser( + "passthrough", + help="The passthrough editor simply cuts the video to the target length provided", + ) + parser.add_argument( "-p", "--parallelism", diff --git a/src/editors/passthrough/__init__.py b/src/editors/passthrough/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/editors/passthrough/editor.py b/src/editors/passthrough/editor.py new file mode 100644 index 0000000..368d6b3 --- /dev/null +++ b/src/editors/passthrough/editor.py @@ -0,0 +1,12 @@ +from ...models.moment import Moment + + +class PassthroughEditor: + def __init__(self, video_path, audio_path, params): + pass + + def edit(self, large_window, small_window, params): + pass + + def full_edit(self, costfunc, desired_time, params): + return [Moment(0, desired_time)]