Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -52,10 +52,10 @@ async def compress_video(
|
|
| 52 |
"video_codec": codec # Specify the video codec
|
| 53 |
}
|
| 54 |
|
| 55 |
-
# Add resolution if specified
|
| 56 |
if resolution:
|
| 57 |
transformation["width"] = resolution.split("p")[0]
|
| 58 |
-
transformation["crop"] = "scale"
|
| 59 |
|
| 60 |
# Generate the compressed and converted video URL
|
| 61 |
compressed_video_url, options = cloudinary_url(
|
|
|
|
| 52 |
"video_codec": codec # Specify the video codec
|
| 53 |
}
|
| 54 |
|
| 55 |
+
# Add resolution only if specified
|
| 56 |
if resolution:
|
| 57 |
transformation["width"] = resolution.split("p")[0]
|
| 58 |
+
transformation["crop"] = "scale" # Ensures scaling to specified resolution
|
| 59 |
|
| 60 |
# Generate the compressed and converted video URL
|
| 61 |
compressed_video_url, options = cloudinary_url(
|