shaheerawan3 commited on
Commit
303853e
·
verified ·
1 Parent(s): 5ce8630

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -13
app.py CHANGED
@@ -1119,10 +1119,7 @@ class EnhancedVideoGenerator:
1119
  # Streamlit UI Class
1120
  class VideoGeneratorUI:
1121
  def __init__(self):
1122
- self.generator = EnhancedVideoGenerator()
1123
- # Create a base directory for video outputs
1124
- self.output_base_dir = "generated_videos"
1125
- os.makedirs(self.output_base_dir, exist_ok=True)
1126
  self.setup_ui()
1127
 
1128
  def setup_ui(self):
@@ -1283,21 +1280,25 @@ class VideoGeneratorUI:
1283
  timestamp = int(time.time())
1284
  output_filename = f"vaultgenix_video_{timestamp}.mp4"
1285
 
1286
- # Create the full output path
1287
- output_path = os.path.join(self.output_base_dir, output_filename)
 
 
 
1288
 
1289
- # Ensure the output directory exists
1290
- os.makedirs(os.path.dirname(output_path), exist_ok=True)
 
1291
 
1292
- video_path = self.generator.create_video(
1293
  prompt,
1294
- style,
1295
  duration,
1296
- output_path,
1297
- selected_images
1298
  )
1299
 
1300
- if video_path and os.path.exists(video_path):
 
1301
  st.success("✨ Video generated successfully!")
1302
 
1303
  # Display video
@@ -1557,6 +1558,7 @@ class VideoGenerator:
1557
  print(f"Cleanup error: {e}")
1558
 
1559
  def create_ui():
 
1560
  st.title("VaultGenix Video Generator")
1561
  st.markdown("Create professional videos for your digital legacy management platform")
1562
 
 
1119
  # Streamlit UI Class
1120
  class VideoGeneratorUI:
1121
  def __init__(self):
1122
+ self.generator = VideoGenerator()
 
 
 
1123
  self.setup_ui()
1124
 
1125
  def setup_ui(self):
 
1280
  timestamp = int(time.time())
1281
  output_filename = f"vaultgenix_video_{timestamp}.mp4"
1282
 
1283
+ # Create absolute output path
1284
+ output_path = os.path.abspath(os.path.join(
1285
+ self.generator.base_dir,
1286
+ output_filename
1287
+ ))
1288
 
1289
+ # Show progress message
1290
+ progress_message = st.empty()
1291
+ progress_message.text("🎥 Generating your video... This may take a few minutes.")
1292
 
1293
+ video_path = self.generator.generate_video(
1294
  prompt,
1295
+ selected_images,
1296
  duration,
1297
+ output_path
 
1298
  )
1299
 
1300
+ if os.path.exists(video_path):
1301
+ progress_message.empty()
1302
  st.success("✨ Video generated successfully!")
1303
 
1304
  # Display video
 
1558
  print(f"Cleanup error: {e}")
1559
 
1560
  def create_ui():
1561
+ ui = VideoGeneratorUI()
1562
  st.title("VaultGenix Video Generator")
1563
  st.markdown("Create professional videos for your digital legacy management platform")
1564