Spaces:
Sleeping
Sleeping
File size: 1,253 Bytes
fd50325 2278049 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | """
S3-compatible storage configuration for DetectifAI (Backblaze B2)
"""
# S3 bucket names (matching actual Backblaze B2 buckets)
VIDEOS_BUCKET = "detectifai-videos"
KEYFRAMES_BUCKET = "detectifai-keyframes"
COMPRESSED_BUCKET = "detectifai-compressed"
NLP_IMAGES_BUCKET = "nlp-images"
REPORTS_BUCKET = "detectifai-reports"
# Object prefixes/paths
ORIGINAL_VIDEO_PREFIX = "original"
COMPRESSED_VIDEO_PREFIX = "compressed"
KEYFRAME_PREFIX = "keyframes"
# S3-compatible storage default configuration (Backblaze B2)
MINIO_CONFIG = {
"endpoint": "s3.eu-central-003.backblazeb2.com",
"access_key": "00367479ffb7e4e0000000001",
"secret_key": "K003opTvf92ijRj5dM7H1dgrlwcGTdA",
"secure": True,
"region": "eu-central-003"
}
# Function to generate MinIO paths
def get_minio_paths(video_id: str, filename: str = None):
"""Generate standardized MinIO paths for a video"""
if filename is None:
filename = f"{video_id}.mp4"
return {
"original": f"{ORIGINAL_VIDEO_PREFIX}/{video_id}/{filename}",
"compressed": f"{COMPRESSED_VIDEO_PREFIX}/{video_id}/{filename}",
"keyframes": f"{KEYFRAME_PREFIX}/{video_id}",
"reports": f"reports/{video_id}"
} |