change_aspect_ratio
Adjust video aspect ratio to a target like 16:9, 4:3, or 1:1 by adding padding (letterbox/pillarbox) or cropping the frame. Specify padding color for custom backgrounds.
Instructions
Changes the aspect ratio of a video, using padding or cropping.
Args: video_path: Path to the input video file. output_video_path: Path to save the video with the new aspect ratio. target_aspect_ratio: Target aspect ratio (e.g., '16:9', '4:3', '1:1'). resize_mode: 'pad' to add letterbox/pillarbox, or 'crop' to crop. Defaults to 'pad'. padding_color: Color for padding (e.g., 'black', 'white'). Defaults to 'black'. Returns: A status message indicating success or failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| video_path | Yes | ||
| resize_mode | No | pad | |
| padding_color | No | black | |
| output_video_path | Yes | ||
| target_aspect_ratio | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |