From e8835080d2f563f850a346baba17f26da67fe822 Mon Sep 17 00:00:00 2001 From: evamaxfield Date: Sat, 1 Oct 2022 11:32:39 -0700 Subject: [PATCH] Move ffmpeg import within caption is valid func --- cdp_backend/utils/file_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cdp_backend/utils/file_utils.py b/cdp_backend/utils/file_utils.py index e9fa0ae5..0d5b4f4e 100644 --- a/cdp_backend/utils/file_utils.py +++ b/cdp_backend/utils/file_utils.py @@ -11,7 +11,6 @@ from typing import Optional, Tuple, Union from uuid import uuid4 -import ffmpeg import fireo import fsspec import requests @@ -658,6 +657,8 @@ def caption_is_valid(video_uri: str, caption_uri: str) -> bool: and the duration of the caption file are compared. The caption file is accepted if the durations differ by no more than 20%. """ + import ffmpeg + try: ffprobe = ffmpeg.probe(video_uri) except ffmpeg.Error as e: