Spaces:
Build error
Build error
Alex Volkov
commited on
Commit
•
96d2396
1
Parent(s):
074b5e7
New watermarks and fonts!
Browse files- download.py +1 -1
- fonts/Poppins-Black.ttf +0 -0
- fonts/icon-color.png +0 -0
- fonts/icon-color.svg +1 -0
- fonts/icon-white.png +0 -0
- fonts/icon-white.svg +7 -0
- fonts/icon.svg +7 -0
- fonts/round.png +0 -0
- fonts/watermark_new.png +0 -0
- utils/subs.py +3 -3
download.py
CHANGED
@@ -87,7 +87,7 @@ def download_generator(url, translate_action=True, source_language='Autodetect',
|
|
87 |
### Step 4 : Bake subtitles into video with ffmpeg
|
88 |
yield {"message": f"[PLEASE WAIT] baking subtitles into video"}
|
89 |
try:
|
90 |
-
|
91 |
subbed_video_path = tempdir / f"{meta['id']}_translated.mp4"
|
92 |
|
93 |
fontsdir = Path('fonts')
|
|
|
87 |
### Step 4 : Bake subtitles into video with ffmpeg
|
88 |
yield {"message": f"[PLEASE WAIT] baking subtitles into video"}
|
89 |
try:
|
90 |
+
print('Stating to bake subtitles')
|
91 |
subbed_video_path = tempdir / f"{meta['id']}_translated.mp4"
|
92 |
|
93 |
fontsdir = Path('fonts')
|
fonts/Poppins-Black.ttf
ADDED
Binary file (151 kB). View file
|
|
fonts/icon-color.png
ADDED
fonts/icon-color.svg
ADDED
fonts/icon-white.png
ADDED
fonts/icon-white.svg
ADDED
fonts/icon.svg
ADDED
fonts/round.png
ADDED
fonts/watermark_new.png
ADDED
utils/subs.py
CHANGED
@@ -10,8 +10,8 @@ from typing import Iterator, TextIO
|
|
10 |
def bake_subs(input_file, output_file, subs_file, fontsdir):
|
11 |
print(f"Baking {subs_file} into video... {input_file} -> {output_file}")
|
12 |
|
13 |
-
fontfile = fontsdir / '
|
14 |
-
watermarkfile = fontsdir / '
|
15 |
|
16 |
video = ffmpeg.input(input_file)
|
17 |
watermark = ffmpeg.input(watermarkfile)
|
@@ -22,7 +22,7 @@ def bake_subs(input_file, output_file, subs_file, fontsdir):
|
|
22 |
ih = int(video_stream['height'])
|
23 |
print(f"width {iw} and height {ih}")
|
24 |
sub_size = 18 if iw > ih else 8
|
25 |
-
fontstyle = f'Fontsize={sub_size},OutlineColour=&H40000000,BorderStyle=3,FontName=
|
26 |
(
|
27 |
ffmpeg.concat(
|
28 |
video.filter('subtitles', subs_file, fontsdir=fontfile, force_style=fontstyle),
|
|
|
10 |
def bake_subs(input_file, output_file, subs_file, fontsdir):
|
11 |
print(f"Baking {subs_file} into video... {input_file} -> {output_file}")
|
12 |
|
13 |
+
fontfile = fontsdir / 'Poppins-Black.ttf'
|
14 |
+
watermarkfile = fontsdir / 'watermark_new.png'
|
15 |
|
16 |
video = ffmpeg.input(input_file)
|
17 |
watermark = ffmpeg.input(watermarkfile)
|
|
|
22 |
ih = int(video_stream['height'])
|
23 |
print(f"width {iw} and height {ih}")
|
24 |
sub_size = 18 if iw > ih else 8
|
25 |
+
fontstyle = f'Fontsize={sub_size},OutlineColour=&H40000000,BorderStyle=3,FontName=Poppins,Bold=1'
|
26 |
(
|
27 |
ffmpeg.concat(
|
28 |
video.filter('subtitles', subs_file, fontsdir=fontfile, force_style=fontstyle),
|