Real-Time Video Processing Pipeline

Real-Time Video Processing Pipeline on Clore.ai

What We're Building

A complete GPU-accelerated video processing pipeline that:

  • Object detection on video streams using YOLO

  • Real-time processing with OpenCV + CUDA

  • Batch mode for processing video files

  • Streaming output via WebSocket or RTSP

  • Runs on rented Clore.ai GPUs for maximum cost efficiency

Use cases:

  • Security camera analysis

  • Sports video analytics

  • Traffic monitoring

  • Content moderation

  • Manufacturing quality inspection

Prerequisites

  • Clore.ai account with 30+ CLORE balance

  • Python 3.10+

  • Basic understanding of computer vision

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Video Input │───▢│ GPU Pipeline │───▢│ Output Streams β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ RTSP β”‚ β”‚ β€’ Decode β”‚ β”‚ β€’ WebSocket β”‚ β”‚ β”‚ β”‚ β€’ Files β”‚ β”‚ β€’ YOLO β”‚ β”‚ β€’ RTSP β”‚ β”‚ β”‚ β”‚ β€’ HTTP β”‚ β”‚ β€’ Track β”‚ β”‚ β€’ Files β”‚ β”‚ β”‚ β”‚ β€’ Webcam β”‚ β”‚ β€’ Annotate β”‚ β”‚ β€’ Webhook β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β”‚ β–Ό β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ CUDA GPU β”‚ β”‚ β”‚ β”‚ RTX 4090 β”‚ β”‚ β”‚ β”‚ 24GB VRAM β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ Ports: 22 (SSH), 8000 (API), 8765 (WebSocket), 554 (RTSP) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

clore_client.py

import requests import time from typing import Dict, Any, List, Optional from dataclasses import dataclass

@dataclass class GPURental: """GPU rental information.""" order_id: int server_id: int ssh_host: str ssh_port: int http_endpoint: str cost_per_hour: float gpus: List[str]

Step 2: Video Processor Core

Step 3: FastAPI Video Service

Step 4: Deployment Script

Step 5: Client Examples

Full Deployment Script

Cost Comparison

Task
GPU
Clore.ai
AWS g4dn
Google Cloud
Savings

1080p @ 30fps

RTX 3090

~$0.25/hr

$0.71/hr

$0.73/hr

65%

4K @ 30fps

RTX 4090

~$0.40/hr

N/A

N/A

N/A

Multi-stream (4x)

2x RTX 4090

~$0.80/hr

$2.84/hr

$2.92/hr

72%

Batch processing

A100

~$1.50/hr

$4.10/hr

$3.67/hr

60%

Example: 24/7 security monitoring

  • Clore.ai (RTX 3090): ~$180/month

  • AWS (g4dn.xlarge): ~$512/month

  • Savings: $332/month (65%)

Performance Benchmarks

Model
GPU
Resolution
FPS
Latency

YOLOv8n

RTX 3090

1080p

120

8ms

YOLOv8s

RTX 3090

1080p

90

11ms

YOLOv8m

RTX 4090

1080p

85

12ms

YOLOv8l

RTX 4090

1080p

55

18ms

YOLOv8x

A100

1080p

70

14ms

Next Steps

Last updated

Was this helpful?