percent based resolution
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m9s
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m9s
This commit is contained in:
13
app.py
13
app.py
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user