diff --git a/requirements.txt b/requirements.txt index 03143bcb..f5c9c033 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,11 +5,10 @@ opencv-python-headless~=4.7 packaging~=24.0 plotly~=5.14 pandas~=2.0 -ffmpeg-python~=0.2 pillow>=9.5,~=10.0 tqdm~=4.66 requests==2.* aiofiles==23.* fire==0.4.0 mixpanel==4.8.3 -superannotate-schemas==1.0.49 +superannotate-schemas==1.0.49 \ No newline at end of file diff --git a/src/superannotate/lib/core/plugin.py b/src/superannotate/lib/core/plugin.py index 662e7841..365a3080 100644 --- a/src/superannotate/lib/core/plugin.py +++ b/src/superannotate/lib/core/plugin.py @@ -7,7 +7,6 @@ from typing import Union import cv2 -import ffmpeg from lib.core.exceptions import ImageProcessingException from PIL import Image from PIL import ImageDraw @@ -197,6 +196,7 @@ def get_video_rotate_code(video_path, log): 270: cv2.ROTATE_90_COUNTERCLOCKWISE, } try: + import ffmpeg meta_dict = ffmpeg.probe(str(video_path)) rot = int(meta_dict["streams"][0]["tags"]["rotate"]) if rot: @@ -206,6 +206,8 @@ def get_video_rotate_code(video_path, log): rot, ) return cv2_rotations[rot] + except ImportError: + raise Exception("Install ffmpeg-python~=0.2 to use this function.") except Exception as e: warning_str = "" if "ffprobe" in str(e):