ffmpeg
Browse files
app.py
CHANGED
@@ -2,6 +2,9 @@ import gradio as gr
|
|
2 |
import subprocess
|
3 |
import os
|
4 |
import tempfile
|
|
|
|
|
|
|
5 |
|
6 |
def create_video(video_file: gr.inputs.File, subtitles_file: gr.inputs.File, font_name:str = "ProbaPro-Bold", font_size:int = 22, border_style: int = 1):
|
7 |
if border_style == 4:
|
@@ -9,6 +12,11 @@ def create_video(video_file: gr.inputs.File, subtitles_file: gr.inputs.File, fon
|
|
9 |
else:
|
10 |
border_command = f"BorderStyle=1,Outline=1.10,Shadow=0.35"
|
11 |
|
|
|
|
|
|
|
|
|
|
|
12 |
output_file_handle, out_path = tempfile.mkstemp(suffix=".mp4")
|
13 |
command = [
|
14 |
'./ffmpeg',
|
|
|
2 |
import subprocess
|
3 |
import os
|
4 |
import tempfile
|
5 |
+
import os
|
6 |
+
import stat
|
7 |
+
|
8 |
|
9 |
def create_video(video_file: gr.inputs.File, subtitles_file: gr.inputs.File, font_name:str = "ProbaPro-Bold", font_size:int = 22, border_style: int = 1):
|
10 |
if border_style == 4:
|
|
|
12 |
else:
|
13 |
border_command = f"BorderStyle=1,Outline=1.10,Shadow=0.35"
|
14 |
|
15 |
+
# Get current permissions
|
16 |
+
file_stats = os.stat('./ffmpeg')
|
17 |
+
|
18 |
+
# Add execute permissions
|
19 |
+
os.chmod('./ffmpeg', file_stats.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
20 |
output_file_handle, out_path = tempfile.mkstemp(suffix=".mp4")
|
21 |
command = [
|
22 |
'./ffmpeg',
|