Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion src/superannotate/lib/core/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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):
Expand Down