diff --git a/app.py b/app.py index 8b5f3d7..4f96d7b 100644 --- a/app.py +++ b/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: diff --git a/templates/index.html b/templates/index.html index 720d6ca..83a17c4 100644 --- a/templates/index.html +++ b/templates/index.html @@ -184,6 +184,63 @@ font-weight: 600; } + .scale-slider-container { + margin: 15px 0; + } + + .scale-slider { + width: 100%; + height: 8px; + border-radius: 4px; + background: #e9ecef; + outline: none; + -webkit-appearance: none; + } + + .scale-slider::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 20px; + height: 20px; + border-radius: 50%; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + cursor: pointer; + border: 2px solid white; + box-shadow: 0 2px 5px rgba(0,0,0,0.2); + } + + .scale-slider::-moz-range-thumb { + width: 20px; + height: 20px; + border-radius: 50%; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + cursor: pointer; + border: 2px solid white; + box-shadow: 0 2px 5px rgba(0,0,0,0.2); + } + + .scale-display { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; + } + + .scale-value { + font-size: 1.2em; + font-weight: 600; + color: #667eea; + } + + .resolution-preview { + background: white; + padding: 10px; + border-radius: 6px; + margin-top: 10px; + font-size: 0.9em; + color: #495057; + } + .timeline-container { margin: 15px 0; padding: 20px; @@ -513,24 +570,23 @@ - +