percent based resolution
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m9s

This commit is contained in:
2026-02-09 18:33:21 -05:00
parent cbd5de8cb3
commit e8eb1fe472
2 changed files with 116 additions and 39 deletions

13
app.py
View File

@@ -124,13 +124,12 @@ def process_video():
if width and height:
filters.append(f"crop={width}:{height}:{x}:{y}")
# Add scale filter if resolution specified
resolution = data.get('resolution')
if resolution:
width = resolution.get('width')
height = resolution.get('height')
if width and height:
filters.append(f"scale={width}:{height}")
# Add scale filter if scale percentage specified (not 100%)
scale_percentage = data.get('scale_percentage', 100)
if scale_percentage != 100:
# Scale based on percentage - ffmpeg will apply this after crop
scale_filter = f"scale=iw*{scale_percentage/100}:ih*{scale_percentage/100}"
filters.append(scale_filter)
# Apply filters if any
if filters: