Skip to content

Commit 5db3ae2

Browse files
authored
Merge pull request #811 from superannotateai/ffmpeg_remove
Remove ffmpeg from requirements
2 parents 0eed125 + 58a2922 commit 5db3ae2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ opencv-python-headless~=4.7
55
packaging~=24.0
66
plotly~=5.14
77
pandas~=2.0
8-
ffmpeg-python~=0.2
98
pillow>=9.5,~=10.0
109
tqdm~=4.66
1110
requests==2.*
1211
aiofiles==23.*
1312
fire==0.4.0
1413
mixpanel==4.8.3
15-
superannotate-schemas==1.0.49
14+
superannotate-schemas==1.0.49

src/superannotate/lib/core/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from typing import Union
88

99
import cv2
10-
import ffmpeg
1110
from lib.core.exceptions import ImageProcessingException
1211
from PIL import Image
1312
from PIL import ImageDraw
@@ -197,6 +196,7 @@ def get_video_rotate_code(video_path, log):
197196
270: cv2.ROTATE_90_COUNTERCLOCKWISE,
198197
}
199198
try:
199+
import ffmpeg
200200
meta_dict = ffmpeg.probe(str(video_path))
201201
rot = int(meta_dict["streams"][0]["tags"]["rotate"])
202202
if rot:
@@ -206,6 +206,8 @@ def get_video_rotate_code(video_path, log):
206206
rot,
207207
)
208208
return cv2_rotations[rot]
209+
except ImportError:
210+
raise Exception("Install ffmpeg-python~=0.2 to use this function.")
209211
except Exception as e:
210212
warning_str = ""
211213
if "ffprobe" in str(e):

0 commit comments

Comments
 (0)