Spaces:
Sleeping
Sleeping
Update styled_video_gen.py
Browse files- styled_video_gen.py +5 -4
styled_video_gen.py
CHANGED
|
@@ -10,9 +10,10 @@ import subprocess
|
|
| 10 |
from PIL import Image, ImageFont, ImageDraw
|
| 11 |
|
| 12 |
# --- MoviePy Imports ---
|
| 13 |
-
from moviepy import *
|
|
|
|
| 14 |
# import moviepy.video.fx.all as vfx # Keep if you add more complex FX
|
| 15 |
-
|
| 16 |
|
| 17 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 18 |
logger = logging.getLogger(__name__)
|
|
@@ -22,12 +23,12 @@ DEFAULT_WIDTH = 1280
|
|
| 22 |
DEFAULT_HEIGHT = 720
|
| 23 |
DEFAULT_FPS = 24
|
| 24 |
DEFAULT_TRANSITION_DURATION = 0.75 # seconds
|
| 25 |
-
DEFAULT_FONT = "
|
| 26 |
DEFAULT_SUBTITLE_FONT_SIZE = 36
|
| 27 |
DEFAULT_SUBTITLE_COLOR = 'white'
|
| 28 |
DEFAULT_SUBTITLE_BG_COLOR = 'rgba(0,0,0,0.5)' # Semi-transparent black background
|
| 29 |
DEFAULT_SUBTITLE_POSITION = ('center', 'bottom')
|
| 30 |
-
DEFAULT_LOGO_PATH = "
|
| 31 |
|
| 32 |
# --- Helper Functions ---
|
| 33 |
|
|
|
|
| 10 |
from PIL import Image, ImageFont, ImageDraw
|
| 11 |
|
| 12 |
# --- MoviePy Imports ---
|
| 13 |
+
#from moviepy import *
|
| 14 |
+
from moviepy.editor import *
|
| 15 |
# import moviepy.video.fx.all as vfx # Keep if you add more complex FX
|
| 16 |
+
from moviepy.video.tools.transitions import crossfadein, slide_in # Import specific transitions
|
| 17 |
|
| 18 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 19 |
logger = logging.getLogger(__name__)
|
|
|
|
| 23 |
DEFAULT_HEIGHT = 720
|
| 24 |
DEFAULT_FPS = 24
|
| 25 |
DEFAULT_TRANSITION_DURATION = 0.75 # seconds
|
| 26 |
+
DEFAULT_FONT = "lazy_dog.ttf" # *** ADJUST THIS PATH *** Needs to be accessible on your server
|
| 27 |
DEFAULT_SUBTITLE_FONT_SIZE = 36
|
| 28 |
DEFAULT_SUBTITLE_COLOR = 'white'
|
| 29 |
DEFAULT_SUBTITLE_BG_COLOR = 'rgba(0,0,0,0.5)' # Semi-transparent black background
|
| 30 |
DEFAULT_SUBTITLE_POSITION = ('center', 'bottom')
|
| 31 |
+
DEFAULT_LOGO_PATH = "sozo_logo2.png" # *** ADJUST THIS PATH ***
|
| 32 |
|
| 33 |
# --- Helper Functions ---
|
| 34 |
|