victor HF Staff commited on
Commit
5ab6be9
Β·
1 Parent(s): b68b18f

feat: Update slideshow error guidance and standard resolution recommendations for better user clarity

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -152,9 +152,14 @@ Please analyze the error and generate a corrected command that addresses the spe
152
 
153
  COMMON SLIDESHOW ERROR FIXES:
154
  - If you see "do not match the corresponding output link" β†’ Images have different dimensions, use scale+pad approach
155
- - If you see "Padded dimensions cannot be smaller than input dimensions" β†’ Fix pad calculation or use 1920x1080 standard
156
  - If you see "Failed to configure input pad" β†’ Check scale and pad syntax, ensure proper filter chain
157
- - If you see "Invalid argument" in filters β†’ Simplify filter_complex syntax and check parentheses"""
 
 
 
 
 
158
 
159
  user_content += "\n\nYOUR RESPONSE:"
160
 
@@ -186,17 +191,17 @@ Key requirements:
186
  CRITICAL SLIDESHOW GUIDANCE:
187
  When creating slideshows from multiple images with different dimensions, ALWAYS follow this proven pattern:
188
 
189
- 1. CHOOSE A STANDARD RESOLUTION: Pick 1920x1080 (1080p) as the target resolution for all slideshows
190
- 2. USE SIMPLE SCALE+PAD APPROACH: For each image, scale to fit within 1920x1080 maintaining aspect ratio, then pad with black bars
191
  3. PROVEN SLIDESHOW PATTERN:
192
  ```
193
  ffmpeg -loop 1 -t 3 -i image1.jpg -loop 1 -t 3 -i image2.jpg -filter_complex "[0]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v0];[1]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v1];[v0][v1]concat=n=2:v=1:a=0" -c:v libx264 -pix_fmt yuv420p -movflags +faststart output.mp4
194
  ```
195
 
196
  4. SLIDESHOW RULES:
197
- - Always use 1920x1080 as target resolution for consistency
198
- - Always use scale=1920:1080:force_original_aspect_ratio=decrease
199
- - Always use pad=1920:1080:(ow-iw)/2:(oh-ih)/2 for centering
200
  - Always add setsar=1 after padding to fix aspect ratio issues
201
  - Use 3-second duration per image by default (-t 3)
202
  - For 3+ images, extend the pattern: [v0][v1][v2]concat=n=3:v=1:a=0
 
152
 
153
  COMMON SLIDESHOW ERROR FIXES:
154
  - If you see "do not match the corresponding output link" β†’ Images have different dimensions, use scale+pad approach
155
+ - If you see "Padded dimensions cannot be smaller than input dimensions" β†’ Fix pad calculation or use standard resolution (1920x1080 or 1080x1920)
156
  - If you see "Failed to configure input pad" β†’ Check scale and pad syntax, ensure proper filter chain
157
+ - If you see "Invalid argument" in filters β†’ Simplify filter_complex syntax and check parentheses
158
+
159
+ FORMAT DETECTION KEYWORDS:
160
+ - "vertical", "portrait", "9:16", "TikTok", "Instagram Stories", "phone" β†’ Use 1080x1920
161
+ - "horizontal", "landscape", "16:9", "YouTube", "TV" β†’ Use 1920x1080 (default)
162
+ - "square", "1:1", "Instagram post" β†’ Use 1080x1080"""
163
 
164
  user_content += "\n\nYOUR RESPONSE:"
165
 
 
191
  CRITICAL SLIDESHOW GUIDANCE:
192
  When creating slideshows from multiple images with different dimensions, ALWAYS follow this proven pattern:
193
 
194
+ 1. CHOOSE A STANDARD RESOLUTION: Pick 1920x1080 (1080p) as the default target resolution for slideshows, UNLESS the user explicitly requests a different format (e.g., "vertical video", "9:16 ratio", "portrait mode", "TikTok format" β†’ use 1080x1920)
195
+ 2. USE SIMPLE SCALE+PAD APPROACH: For each image, scale to fit within the chosen resolution maintaining aspect ratio, then pad with black bars
196
  3. PROVEN SLIDESHOW PATTERN:
197
  ```
198
  ffmpeg -loop 1 -t 3 -i image1.jpg -loop 1 -t 3 -i image2.jpg -filter_complex "[0]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v0];[1]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v1];[v0][v1]concat=n=2:v=1:a=0" -c:v libx264 -pix_fmt yuv420p -movflags +faststart output.mp4
199
  ```
200
 
201
  4. SLIDESHOW RULES:
202
+ - Use 1920x1080 as target resolution by default, adjust if user specifies format
203
+ - For horizontal: scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2
204
+ - For vertical: scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2
205
  - Always add setsar=1 after padding to fix aspect ratio issues
206
  - Use 3-second duration per image by default (-t 3)
207
  - For 3+ images, extend the pattern: [v0][v1][v2]concat=n=3:v=1:a=0