sheikhed commited on
Commit
a6e8ad7
·
verified ·
1 Parent(s): 5f22bbb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -140,7 +140,7 @@ def combine_audio_video(video_path, audio_path, output_path):
140
  def is_image_url(url):
141
  parsed = urlparse(url)
142
  path = parsed.path.lower()
143
- return path.endswith(('.png', '.jpg', '.jpeg', '.gif', '.bmp'))
144
 
145
  def create_video_from_image(image_url, output_path, duration=10):
146
  # Download the image
@@ -156,7 +156,7 @@ def create_video_from_image(image_url, output_path, duration=10):
156
  cmd = [
157
  'ffmpeg', '-loop', '1', '-i', temp_image_path,
158
  '-c:v', 'libx264', '-t', str(duration), '-pix_fmt', 'yuv420p',
159
- '-vf', 'scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2',
160
  '-y', output_path
161
  ]
162
  subprocess.run(cmd, check=True)
 
140
  def is_image_url(url):
141
  parsed = urlparse(url)
142
  path = parsed.path.lower()
143
+ return path.endswith(('.png', '.jpg', '.jpeg', '.gif', '.bmp', '.tiff', '.webp', '.heic', '.svg', '.ico'))
144
 
145
  def create_video_from_image(image_url, output_path, duration=10):
146
  # Download the image
 
156
  cmd = [
157
  'ffmpeg', '-loop', '1', '-i', temp_image_path,
158
  '-c:v', 'libx264', '-t', str(duration), '-pix_fmt', 'yuv420p',
159
+ '-vf', 'copy',
160
  '-y', output_path
161
  ]
162
  subprocess.run(cmd, check=True)