File size: 1,673 Bytes
cead143
70d8d2a
79d2b6a
70d8d2a
 
6e8c858
 
 
70d8d2a
 
 
 
 
6e8c858
 
70d8d2a
a3b9bb0
70d8d2a
a3b9bb0
70d8d2a
 
 
6e8c858
70d8d2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import streamlit as st
import os

# ์‚ฌ์ด๋“œ๋ฐ” ํƒ€์ดํ‹€ ์„ค์ •
st.sidebar.title("ViDraft")

# ๋ฉ”๋‰ด ํ•ญ๋ชฉ๊ณผ ํ•˜์œ„ ํ•ญ๋ชฉ ์ •์˜
menus = {
    "Free Stock": ["Template Video", "Template Image",  "Search Video", "Search Image"],
    "Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
    "Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
    "Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Voice Clone", "Image SFX",  "Image Music"],
    "Scripts": ["Script"]
}

# ์„ ํƒ๋œ ๋ฉ”๋‰ด ํ•ญ๋ชฉ์„ ์ €์žฅํ•  ๋ณ€์ˆ˜
selected_menu = None
selected_sub_menu = None

# ๋ฉ”๋‰ด ์ƒ์„ฑ
selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
selected_sub_menu = st.sidebar.selectbox("Sub Menu", menus[selected_menu])

# ๋ฉ”๋‰ด ์„ ํƒ์— ๋”ฐ๋ฅธ ๋™์ž‘ ๊ตฌํ˜„
if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
    # ๋น„๋””์˜ค ํŒŒ์ผ์ด ์žˆ๋Š” ๋””๋ ‰ํ† ๋ฆฌ ๊ฒฝ๋กœ ์„ค์ •
    video_directory = "/path/to/your/videos"  # ๊ฒฝ๋กœ๋ฅผ ์‹ค์ œ ๋น„๋””์˜ค ํŒŒ์ผ์ด ์žˆ๋Š” ๊ฒฝ๋กœ๋กœ ๋ณ€๊ฒฝํ•˜์„ธ์š”.
    
    # ๋””๋ ‰ํ† ๋ฆฌ ๋‚ด์˜ ๋ชจ๋“  ํŒŒ์ผ ๋ชฉ๋ก์„ ๊ฐ€์ ธ์˜ด
    files = os.listdir(video_directory)
    
    # MP4 ํŒŒ์ผ๋งŒ ํ•„ํ„ฐ๋ง
    video_files = [file for file in files if file.endswith(".mp4")]
    
    # ๊ฐ ๋น„๋””์˜ค ํŒŒ์ผ์— ๋Œ€ํ•ด ์ŠคํŠธ๋ฆผ๋ฆฟ ๋น„๋””์˜ค ์œ„์ ฏ ์ƒ์„ฑ
    for video_file in video_files:
        # ํŒŒ์ผ์˜ ์ „์ฒด ๊ฒฝ๋กœ ์ƒ์„ฑ
        video_path = os.path.join(video_directory, video_file)
        
        # ๋น„๋””์˜ค ์ œ๋ชฉ์„ ์ถœ๋ ฅ
        st.subheader(video_file)
        
        # ๋น„๋””์˜ค ํŒŒ์ผ์„ ์ŠคํŠธ๋ฆผ๋ฆฟ์„ ํ†ตํ•ด ํ‘œ์‹œ
        st.video(video_path)