GogetaBlueMUI commited on
Commit
a524b82
·
verified ·
1 Parent(s): 7af4e33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +89 -73
app.py CHANGED
@@ -12,7 +12,6 @@ import psutil
12
 
13
  st.set_page_config(layout="wide")
14
 
15
- # CSS with modifications for video centering and upload button hover effect
16
  st.markdown("""
17
  <style>
18
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
@@ -52,10 +51,14 @@ st.markdown("""
52
  }
53
  .navbar li a {
54
  text-decoration: none;
55
- font-size: 1.1rem;
56
- font-weight: 500;
57
- color: #1a1a1a;
58
- transition: color 0.3s ease;
 
 
 
 
59
  }
60
  .navbar li a:hover {
61
  color: #ff6f61;
@@ -66,10 +69,11 @@ st.markdown("""
66
  background: linear-gradient(to right, #2b5876, #4e4376);
67
  background-size: cover;
68
  color: #ffffff;
69
- padding: 4rem 2rem;
70
  border-radius: 1rem;
71
  text-align: center;
72
  margin: 2rem 0;
 
73
  }
74
  .hero h1 {
75
  font-size: 2.5rem;
@@ -103,10 +107,11 @@ st.markdown("""
103
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
104
  transition: all 0.3s ease;
105
  border: 1px solid rgba(0, 0, 0, 0.1);
106
- background-color: #fff;
107
  filter: brightness(1.05);
108
  z-index: 10;
109
  }
 
110
  .feature i {
111
  font-size: 1.5rem;
112
  color: #2196f3;
@@ -133,6 +138,11 @@ st.markdown("""
133
  text-align: center;
134
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
135
  transition: transform 0.3s ease, box-shadow 0.3s ease;
 
 
 
 
 
136
  }
137
  .plan:hover {
138
  transform: translateY(-5px);
@@ -142,6 +152,7 @@ st.markdown("""
142
  font-size: 1.5rem;
143
  margin-bottom: 0.5rem;
144
  }
 
145
  .plan.free { border-top: 4px solid #28a745; }
146
  .plan.premium { border-top: 4px solid #ff6f61; }
147
  .plan.business { border-top: 4px solid #2196f3; }
@@ -183,26 +194,6 @@ st.markdown("""
183
  font-family: 'Poppins', sans-serif;
184
  }
185
 
186
- /* Video player styling */
187
- video {
188
- display: block;
189
- width: 350px !important;
190
- height: 500px !important;
191
- object-fit: contain;
192
- margin: 0 auto;
193
- border: 3px solid #2196f3;
194
- border-radius: 8px;
195
- }
196
-
197
- /* File Uploader Styling */
198
- input[type="file"] {
199
- opacity: 0.2;
200
- transition: opacity 0.3s ease;
201
- }
202
- input[type="file"]:hover {
203
- opacity: 1;
204
- }
205
-
206
  /* Footer */
207
  footer {
208
  background: #1a1a1a;
@@ -449,11 +440,11 @@ def create_edited_video(video_path, transcript, keep_indices):
449
 
450
  def generate_srt(transcript, include_timeframe=True):
451
  srt_content = ""
452
- for i, (text, start, end) in enumerate(transcript, start=1):
453
  if include_timeframe:
454
  start_time = seconds_to_srt_time(start)
455
  end_time = seconds_to_srt_time(end)
456
- srt_content += f"{i}\n{start_time} --> {end_time}\n{text}\n\n"
457
  else:
458
  srt_content += f"{text}\n\n"
459
  return srt_content
@@ -475,12 +466,38 @@ def main():
475
 
476
  st.markdown("""
477
  <div id="home" class="hero">
478
- <h1>VidEp – Revolutionizing Video Subtitle Editing with AI</h1>
479
  <p>Upload, transcribe, edit subtitles, and summarize videos effortlessly.</p>
480
  </div>
481
  """, unsafe_allow_html=True)
482
 
483
- # Initialize session state variables
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
  if 'app_state' not in st.session_state:
485
  st.session_state['app_state'] = 'upload'
486
  if 'video_path' not in st.session_state:
@@ -512,7 +529,7 @@ def main():
512
 
513
  if st.session_state['app_state'] == 'upload':
514
  st.markdown("<div id='upload'></div>", unsafe_allow_html=True)
515
- st.markdown("<h3 style='text-align: center; color: #2196f3;'>Upload Your Video</h3>", unsafe_allow_html=True)
516
  with st.form(key="upload_form"):
517
  uploaded_file = st.file_uploader("Choose a video file", type=["mp4"], label_visibility="collapsed")
518
  if st.form_submit_button("Upload") and uploaded_file:
@@ -522,6 +539,8 @@ def main():
522
  st.session_state['app_state'] = 'processing'
523
  st.write(f"Uploaded file: {uploaded_file.name}")
524
  st.rerun()
 
 
525
 
526
  if st.session_state['app_state'] == 'processing':
527
  with st.form(key="processing_form"):
@@ -582,11 +601,7 @@ def main():
582
  os.remove(temp_file)
583
 
584
  if st.session_state['app_state'] == 'results':
585
- # Center the original video
586
- st.markdown('<div style="display: flex; justify-content: center;">', unsafe_allow_html=True)
587
  st.video(st.session_state['video_path'], start_time=st.session_state['current_time'])
588
- st.markdown('</div>', unsafe_allow_html=True)
589
-
590
  st.session_state['show_timeframe'] = st.checkbox("Show timeframe in transcript", value=st.session_state['show_timeframe'])
591
  st.markdown("### Search Subtitles")
592
  search_query = st.text_input("Search subtitles...", value=st.session_state['search_query'], key="search_input")
@@ -663,10 +678,7 @@ def main():
663
 
664
  if st.session_state['app_state'] == 'results' and st.session_state['edited_video_path']:
665
  st.markdown("### Edited Video")
666
- # Center the edited video
667
- st.markdown('<div style="display: flex; justify-content: center;">', unsafe_allow_html=True)
668
  st.video(st.session_state['edited_video_path'])
669
- st.markdown('</div>', unsafe_allow_html=True)
670
  with open(st.session_state['edited_video_path'], "rb") as file:
671
  st.download_button(label="Download Edited Video", data=file, file_name="edited_video.mp4", mime="video/mp4")
672
 
@@ -680,7 +692,7 @@ def main():
680
 
681
  st.markdown("""
682
  <div style='text-align: center;'>
683
- <h2 style='color: grey;'>Why VidEp Stands Out</h2>
684
  </div>
685
  <div class="feature-box">
686
  <div class="feature"><i class="fas fa-cloud-upload-alt"></i><br>Cloud Upload</div>
@@ -691,40 +703,40 @@ def main():
691
  """, unsafe_allow_html=True)
692
 
693
  st.markdown("""
694
- <div id="about" class="about-section" style="padding: 3rem 2rem; background: #f8f9fa; border-radius: 1rem; margin: 2rem 0;">
695
- <h2 style="text-align: center; color: #2196f3; margin-bottom: 2rem;">About VidEp</h2>
696
- <div style="display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;">
697
- <div style="flex: 1; min-width: 300px;">
698
- <img src="https://i.postimg.cc/g0z3WVgT/about.jpg" style="width: 100%; height: auto; border-radius: 1rem;" alt="About VidEp">
699
- </div>
700
- <div style="flex: 2; min-width: 300px;">
701
- <h3 style="color:grey;">Our Mission</h3>
702
- <p>VidEp aims to revolutionize how creators and professionals work with video content by providing state-of-the-art AI-powered tools for transcription, translation, and summarization.</p>
703
- <h3 style="color:grey;">What We Do</h3>
704
- <p>Our platform combines the latest advancements in speech recognition and natural language processing to automatically transcribe videos in multiple languages, generate accurate translations, and create concise summaries of content.</p>
705
- <h3 style="color:grey;">Why Choose Us</h3>
706
- <ul>
707
- <li>Advanced AI models for superior accuracy</li>
708
- <li>Multi-language support including English and Urdu</li>
709
- <li>Easy-to-use interface for editing and managing subtitles</li>
710
- <li>Smart search functionality to quickly find content</li>
711
- <li>Seamless video editing based on transcripts</li>
712
- </ul>
 
713
  </div>
714
  </div>
715
- </div>
716
- """, unsafe_allow_html=True)
717
 
718
  st.markdown("""
719
  <div id="contact" class="contact-section" style="padding: 3rem 2rem; background: #f1f4f8; border-radius: 1rem; margin: 2rem 0;">
720
- <h2 style="text-align: center; color: #2196f3; margin-bottom: 2rem;">Contact Us</h2>
721
  <div style="max-width: 600px; margin: 0 auto;">
722
  <div style="margin-bottom: 1rem;">
723
  <label for="email" style="display: block; margin-bottom: 0.5rem; font-weight: 500;">Email</label>
724
  <input type="email" id="email" placeholder="Your email address" style="width: 100%; padding: 0.75rem; background-color:white; color:white; border-radius: 0.5rem; border: 1px solid #e0e0e0;">
725
  </div>
726
  <div style="margin-bottom: 1rem;">
727
- <label for="message" style="display: block; margin-bottom: 0.5rem; font-weight: 500;">MessageTwenty-first</label>
728
  <textarea id="message" rows="5" placeholder="Your message" style="width: 100%; padding: 0.75rem; border-radius: 0.5rem; background-color:white; color:white; border: 1px solid #e0e0e0;"></textarea>
729
  </div>
730
  <button onclick="alert('Message sent successfully!')" style="background: linear-gradient(135deg, #ff6f61, #ff8a65); color: white; font-weight: 600; padding: 0.75rem 1.5rem; border-radius: 0.5rem; border: none; cursor: pointer; width: 100%;">Send Message</button>
@@ -734,9 +746,11 @@ def main():
734
 
735
  st.markdown("""
736
  <div class="plans">
737
- <h2 style="text-align: center; margin-bottom: 2rem;color: #2196f3;">Choose Your Plan</h2>
738
  <div class="plan-box">
739
- <div class="plan free" style="background-color:#24893c">
 
 
740
  <h3 style="color: white;">Free</h3>
741
  <p><strong>$0</strong> / month</p>
742
  <p>Basic video transcription</p>
@@ -744,7 +758,7 @@ def main():
744
  <p>Max 5 minutes video</p>
745
  <p>No summarization</p>
746
  </div>
747
- <div class="plan premium" style="background-color:#a32b2d">
748
  <h3 style="color: white;">Premium</h3>
749
  <p><strong>$19</strong> / month</p>
750
  <p>Advanced transcription</p>
@@ -752,13 +766,12 @@ def main():
752
  <p>Max 30 minutes video</p>
753
  <p>AI summarization</p>
754
  </div>
755
- <div class="plan business" style="background-color:#396ca3">
756
  <h3 style="color: white;">Business</h3>
757
  <p><strong>$49</strong> / month</p>
758
  <p>Enterprise-grade transcription</p>
759
  <p>All languages</p>
760
  <p>Unlimited video length</p>
761
- <p>Priority processing</p>
762
  </div>
763
  </div>
764
  </div>
@@ -768,8 +781,12 @@ def main():
768
  <footer>
769
  <div class="footer-container">
770
  <div class="footer-section">
771
- <h4>VidEp</h4>
772
- <p>Revolutionizing video transcription with AI</p>
 
 
 
 
773
  </div>
774
  <div class="footer-section">
775
  <h4 style="margin-left:20px">Links</h4>
@@ -789,8 +806,8 @@ def main():
789
  </ul>
790
  </div>
791
  </div>
792
- <div class="footer-bottom">
793
- <p>© 2025 VidEp. All rights reserved.</p>
794
  </div>
795
  </footer>
796
 
@@ -810,6 +827,5 @@ def main():
810
  });
811
  </script>
812
  """, unsafe_allow_html=True)
813
-
814
  if __name__ == "__main__":
815
  main()
 
12
 
13
  st.set_page_config(layout="wide")
14
 
 
15
  st.markdown("""
16
  <style>
17
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
 
51
  }
52
  .navbar li a {
53
  text-decoration: none;
54
+ font-size: 28px;
55
+ font-weight: bold;
56
+ color: #060404;
57
+ position: relative;
58
+ padding: 10px 15px;
59
+ transition: text-shadow 0.3s ease-in-out;
60
+ text-shadow: 5px 5px 12px rgba(0, 0, 0, 0.5);
61
+
62
  }
63
  .navbar li a:hover {
64
  color: #ff6f61;
 
69
  background: linear-gradient(to right, #2b5876, #4e4376);
70
  background-size: cover;
71
  color: #ffffff;
72
+ padding: 2rem 2rem;
73
  border-radius: 1rem;
74
  text-align: center;
75
  margin: 2rem 0;
76
+ max-height: 200px;
77
  }
78
  .hero h1 {
79
  font-size: 2.5rem;
 
107
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
108
  transition: all 0.3s ease;
109
  border: 1px solid rgba(0, 0, 0, 0.1);
110
+ background-color: #fff; /* or a slightly brighter color */
111
  filter: brightness(1.05);
112
  z-index: 10;
113
  }
114
+
115
  .feature i {
116
  font-size: 1.5rem;
117
  color: #2196f3;
 
138
  text-align: center;
139
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
140
  transition: transform 0.3s ease, box-shadow 0.3s ease;
141
+ border-top: 4px solid #28a745;
142
+ height: 290px;
143
+ padding-top: 10px;
144
+ }
145
+
146
  }
147
  .plan:hover {
148
  transform: translateY(-5px);
 
152
  font-size: 1.5rem;
153
  margin-bottom: 0.5rem;
154
  }
155
+
156
  .plan.free { border-top: 4px solid #28a745; }
157
  .plan.premium { border-top: 4px solid #ff6f61; }
158
  .plan.business { border-top: 4px solid #2196f3; }
 
194
  font-family: 'Poppins', sans-serif;
195
  }
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  /* Footer */
198
  footer {
199
  background: #1a1a1a;
 
440
 
441
  def generate_srt(transcript, include_timeframe=True):
442
  srt_content = ""
443
+ for text, start, end in transcript:
444
  if include_timeframe:
445
  start_time = seconds_to_srt_time(start)
446
  end_time = seconds_to_srt_time(end)
447
+ srt_content += f"{start_time} --> {end_time}\n{text}\n\n"
448
  else:
449
  srt_content += f"{text}\n\n"
450
  return srt_content
 
466
 
467
  st.markdown("""
468
  <div id="home" class="hero">
469
+ <h2>VidEp – Revolutionizing Video Subtitle Editing with AI</h2>
470
  <p>Upload, transcribe, edit subtitles, and summarize videos effortlessly.</p>
471
  </div>
472
  """, unsafe_allow_html=True)
473
 
474
+ st.markdown("""
475
+ <style>
476
+ /* Video player styling */
477
+ .stVideo > div {
478
+ max-width: 600px !important;
479
+ max-height: 450px !important;
480
+ margin: 0 auto;
481
+ border: 3px solid #2196f3;
482
+ border-radius: 8px;
483
+ overflow: hidden;
484
+ }
485
+
486
+ /* Footer column styling */
487
+ .footer-container {
488
+ display: flex;
489
+ justify-content: space-between;
490
+ }
491
+ .footer-section:first-child {
492
+ margin-left: 10px;
493
+ }
494
+ .footer-section:last-child {
495
+ margin-right: 10px;
496
+ }
497
+ </style>
498
+ """, unsafe_allow_html=True)
499
+
500
+
501
  if 'app_state' not in st.session_state:
502
  st.session_state['app_state'] = 'upload'
503
  if 'video_path' not in st.session_state:
 
529
 
530
  if st.session_state['app_state'] == 'upload':
531
  st.markdown("<div id='upload'></div>", unsafe_allow_html=True)
532
+ st.markdown("<h3 style='text-align: center; color: black;'>Upload Your Video</h3>", unsafe_allow_html=True)
533
  with st.form(key="upload_form"):
534
  uploaded_file = st.file_uploader("Choose a video file", type=["mp4"], label_visibility="collapsed")
535
  if st.form_submit_button("Upload") and uploaded_file:
 
539
  st.session_state['app_state'] = 'processing'
540
  st.write(f"Uploaded file: {uploaded_file.name}")
541
  st.rerun()
542
+
543
+
544
 
545
  if st.session_state['app_state'] == 'processing':
546
  with st.form(key="processing_form"):
 
601
  os.remove(temp_file)
602
 
603
  if st.session_state['app_state'] == 'results':
 
 
604
  st.video(st.session_state['video_path'], start_time=st.session_state['current_time'])
 
 
605
  st.session_state['show_timeframe'] = st.checkbox("Show timeframe in transcript", value=st.session_state['show_timeframe'])
606
  st.markdown("### Search Subtitles")
607
  search_query = st.text_input("Search subtitles...", value=st.session_state['search_query'], key="search_input")
 
678
 
679
  if st.session_state['app_state'] == 'results' and st.session_state['edited_video_path']:
680
  st.markdown("### Edited Video")
 
 
681
  st.video(st.session_state['edited_video_path'])
 
682
  with open(st.session_state['edited_video_path'], "rb") as file:
683
  st.download_button(label="Download Edited Video", data=file, file_name="edited_video.mp4", mime="video/mp4")
684
 
 
692
 
693
  st.markdown("""
694
  <div style='text-align: center;'>
695
+ <h2 style='color: black'>Why VidEp Stands Out</h2>
696
  </div>
697
  <div class="feature-box">
698
  <div class="feature"><i class="fas fa-cloud-upload-alt"></i><br>Cloud Upload</div>
 
703
  """, unsafe_allow_html=True)
704
 
705
  st.markdown("""
706
+ <div id="about" class="about-section" style="padding: 3rem 2rem; background: #f8f9fa; border-radius: 1rem; margin: 2rem 0;">
707
+ <h2 style="text-align: center; color: black; margin-bottom: 2rem;">About VidEp</h2>
708
+ <div style="display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;">
709
+ <div style="flex: 1; min-width: 300px;">
710
+ <img src="https://i.postimg.cc/g0z3WVgT/about.jpg" style="width: 100%; height: auto; border-radius: 1rem;" alt="About VidEp">
711
+ </div>
712
+ <div style="flex: 2; min-width: 300px;">
713
+ <h3 style="color:grey;">Our Mission</h3>
714
+ <p>VidEp aims to revolutionize how creators and professionals work with video content by providing state-of-the-art AI-powered tools for transcription, translation, and summarization.</p>
715
+ <h3 style="color:grey;">What We Do</h3>
716
+ <p>Our platform combines the latest advancements in speech recognition and natural language processing to automatically transcribe videos in multiple languages, generate accurate translations, and create concise summaries of content.</p>
717
+ <h3 style="color:grey;">Why Choose Us</h3>
718
+ <ul>
719
+ <li>Advanced AI models for superior accuracy</li>
720
+ <li>Multi-language support including English and Urdu</li>
721
+ <li>Easy-to-use interface for editing and managing subtitles</li>
722
+ <li>Smart search functionality to quickly find content</li>
723
+ <li>Seamless video editing based on transcripts</li>
724
+ </ul>
725
+ </div>
726
  </div>
727
  </div>
728
+ """, unsafe_allow_html=True)
 
729
 
730
  st.markdown("""
731
  <div id="contact" class="contact-section" style="padding: 3rem 2rem; background: #f1f4f8; border-radius: 1rem; margin: 2rem 0;">
732
+ <h2 style="text-align: center; color: black; margin-bottom: 2rem;">Contact Us</h2>
733
  <div style="max-width: 600px; margin: 0 auto;">
734
  <div style="margin-bottom: 1rem;">
735
  <label for="email" style="display: block; margin-bottom: 0.5rem; font-weight: 500;">Email</label>
736
  <input type="email" id="email" placeholder="Your email address" style="width: 100%; padding: 0.75rem; background-color:white; color:white; border-radius: 0.5rem; border: 1px solid #e0e0e0;">
737
  </div>
738
  <div style="margin-bottom: 1rem;">
739
+ <label for="message" style="display: block; margin-bottom: 0.5rem; font-weight: 500;">Message</label>
740
  <textarea id="message" rows="5" placeholder="Your message" style="width: 100%; padding: 0.75rem; border-radius: 0.5rem; background-color:white; color:white; border: 1px solid #e0e0e0;"></textarea>
741
  </div>
742
  <button onclick="alert('Message sent successfully!')" style="background: linear-gradient(135deg, #ff6f61, #ff8a65); color: white; font-weight: 600; padding: 0.75rem 1.5rem; border-radius: 0.5rem; border: none; cursor: pointer; width: 100%;">Send Message</button>
 
746
 
747
  st.markdown("""
748
  <div class="plans">
749
+ <h2 style="text-align: center; margin-bottom: 2rem;color: black;">Choose Your Plan</h2>
750
  <div class="plan-box">
751
+ <div class="plan free"
752
+ style="background: linear-gradient(135deg, #299f45, #185726);
753
+ padding-bottom: 0px">
754
  <h3 style="color: white;">Free</h3>
755
  <p><strong>$0</strong> / month</p>
756
  <p>Basic video transcription</p>
 
758
  <p>Max 5 minutes video</p>
759
  <p>No summarization</p>
760
  </div>
761
+ <div class="plan premium" style="background-color:#a32b2d">
762
  <h3 style="color: white;">Premium</h3>
763
  <p><strong>$19</strong> / month</p>
764
  <p>Advanced transcription</p>
 
766
  <p>Max 30 minutes video</p>
767
  <p>AI summarization</p>
768
  </div>
769
+ <div class="plan business" style="background-color:#396ca3">
770
  <h3 style="color: white;">Business</h3>
771
  <p><strong>$49</strong> / month</p>
772
  <p>Enterprise-grade transcription</p>
773
  <p>All languages</p>
774
  <p>Unlimited video length</p>
 
775
  </div>
776
  </div>
777
  </div>
 
781
  <footer>
782
  <div class="footer-container">
783
  <div class="footer-section">
784
+ <h4 style="margin-left:20px">Company Info</h4>
785
+ <ul>
786
+ <li><a href="#about-us">About Us</a></li>
787
+ <li><a href="#privacy">Privacy Policy</a></li>
788
+ <li><a href="#terms">Terms</a></li>
789
+ </ul>
790
  </div>
791
  <div class="footer-section">
792
  <h4 style="margin-left:20px">Links</h4>
 
806
  </ul>
807
  </div>
808
  </div>
809
+ <div class="footer-bottom" style="justify-content: center; text-align: center; border-top: 1px solid white; padding-top:20px; padding-bottom: 10px;">
810
+ <p style="font-size: 20px">© 2025 VidEp. All rights reserved.</p>
811
  </div>
812
  </footer>
813
 
 
827
  });
828
  </script>
829
  """, unsafe_allow_html=True)
 
830
  if __name__ == "__main__":
831
  main()