berkaydun commited on
Commit
9bff52e
·
verified ·
1 Parent(s): 482f9ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -5,7 +5,7 @@ import tempfile
5
  import os
6
 
7
  # Streamlit başlığı
8
- st.title("Videoya Logo Ekleme Uygulaması")
9
 
10
  # Video ve logo dosyasını yükleme
11
  video_file = st.file_uploader("Upload a video file", type=["mp4", "mov", "avi"])
@@ -26,17 +26,17 @@ if video_file and logo_file:
26
  video_clip = VideoFileClip(video_path)
27
  logo_clip = ImageClip(logo_path).set_duration(video_clip.duration)
28
 
29
- st.sidebar.header("Logo Ayarları")
30
 
31
  # Logonun boyutu
32
  logo_height = st.sidebar.slider("Logo size (pixel). (It proportions width and height of your logo", min_value=50, max_value=500, value=150)
33
 
34
  # Logonun konumu
35
  position_options = {
36
- "Sol Üst": ("left", "top"),
37
- "Sağ Üst": ("right", "top"),
38
- "Sol Alt": ("left", "bottom"),
39
- "Sağ Alt": ("right", "bottom")
40
  }
41
  logo_position = st.sidebar.selectbox("Position of Logo", options=list(position_options.keys()))
42
  position = position_options[logo_position]
@@ -50,7 +50,7 @@ if video_file and logo_file:
50
  # Logoyu videoya eklemek için CompositeVideoClip kullanma
51
  final_clip = CompositeVideoClip([video_clip, logo_clip])
52
 
53
- if st.button("Videoyu İşle ve İndir"):
54
  # Sonuç videosunu geçici olarak kaydetme
55
  output_path = os.path.join(tempfile.gettempdir(), "output.mp4")
56
  final_clip.write_videofile(output_path, codec="libx264", threads=4)
 
5
  import os
6
 
7
  # Streamlit başlığı
8
+ st.title("Add Watermark on your video for FREE")
9
 
10
  # Video ve logo dosyasını yükleme
11
  video_file = st.file_uploader("Upload a video file", type=["mp4", "mov", "avi"])
 
26
  video_clip = VideoFileClip(video_path)
27
  logo_clip = ImageClip(logo_path).set_duration(video_clip.duration)
28
 
29
+ st.sidebar.header("Logo Settings")
30
 
31
  # Logonun boyutu
32
  logo_height = st.sidebar.slider("Logo size (pixel). (It proportions width and height of your logo", min_value=50, max_value=500, value=150)
33
 
34
  # Logonun konumu
35
  position_options = {
36
+ "Left Top": ("left", "top"),
37
+ "Right Top": ("right", "top"),
38
+ "Left Bottom": ("left", "bottom"),
39
+ "Right Bottom": ("right", "bottom")
40
  }
41
  logo_position = st.sidebar.selectbox("Position of Logo", options=list(position_options.keys()))
42
  position = position_options[logo_position]
 
50
  # Logoyu videoya eklemek için CompositeVideoClip kullanma
51
  final_clip = CompositeVideoClip([video_clip, logo_clip])
52
 
53
+ if st.button("Process and Download"):
54
  # Sonuç videosunu geçici olarak kaydetme
55
  output_path = os.path.join(tempfile.gettempdir(), "output.mp4")
56
  final_clip.write_videofile(output_path, codec="libx264", threads=4)