mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
fix ffmpeg
This commit is contained in:
1 parent
ba81447d10
commit
44928c61b8
2 files changed
+5
-1
No files matched your search
@@ -16,6 +16,9 @@ API_KEY = os.environ.get("API_KEY", "default-key")
|
||||
TEMP_DIR = Path("/tmp/ffmpeg_processing")
|
||||
TEMP_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Font path for text overlay (installed via fonts-dejavu in Dockerfile)
|
||||
FONT_PATH = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
|
||||
|
||||
|
||||
class ReelRequest(BaseModel):
|
||||
video_base64: Optional[str] = None
|
||||
@@ -94,7 +97,7 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)):
|
||||
# Escape text for drawtext
|
||||
sanitized_text = request.text.replace("'", "").replace(":", "\\:")
|
||||
# Move text to bottom (with 150px padding to avoid UI elements)
|
||||
drawtext = f"drawtext=fontfile={font_path}:text='{sanitized_text}':fontcolor=white:fontsize={request.font_size}:box=1:boxcolor=black@0.5:boxborderw=5:x=(w-text_w)/2:y=h-text_h-150"
|
||||
drawtext = f"drawtext=fontfile={FONT_PATH}:text='{sanitized_text}':fontcolor=white:fontsize={request.font_size}:box=1:boxcolor=black@0.5:boxborderw=5:x=(w-text_w)/2:y=h-text_h-150"
|
||||
video_filters.append(drawtext)
|
||||
|
||||
# Audio Mixing/Volume (Audio Filter)
|
||||
|
||||
@@ -30,6 +30,7 @@ Ajout d'une fonctionnalité complète de création de Reels Facebook permettant
|
||||
- [x] [NEW] `ffmpeg-service/` - Dedicated Python microservice for video processing
|
||||
- [x] `main.py` (FastAPI, FFmpeg logic)
|
||||
- [x] `Dockerfile` & `requirements.txt`
|
||||
- [x] Fix `font_path` NameError in `main.py`
|
||||
- [x] [CFG] `docker-compose.yml` - Add `ffmpeg-api` service & Link to App
|
||||
- [x] `server/routes.ts` - Enregistrement du reelsRouter de la configuration
|
||||
|
||||
|
||||
Reference in new issue
Block a user