Update app.py
Browse files
app.py
CHANGED
@@ -320,7 +320,7 @@ def create_srt_and_burn(df, video_in):
|
|
320 |
|
321 |
print("SRT DONE")
|
322 |
try:
|
323 |
-
file1 = open('./
|
324 |
Lines = file1.readlines()
|
325 |
|
326 |
count = 0
|
@@ -334,7 +334,7 @@ def create_srt_and_burn(df, video_in):
|
|
334 |
|
335 |
video_out = video_in.replace('.mp4', '_out.mp4')
|
336 |
print(video_out)
|
337 |
-
command = 'ffmpeg -i "{}" -y -vf subtitles=./
|
338 |
print(command)
|
339 |
os.system(command)
|
340 |
return video_out, './testi.srt'
|
@@ -358,7 +358,7 @@ transcription_df = gr.DataFrame(value=df_init,label="Transcription dataframe", r
|
|
358 |
transcription_and_translation_df = gr.DataFrame(value=df_init,label="Transcription and translation dataframe", max_rows = 10, wrap=True, overflow_row_behaviour='paginate')
|
359 |
|
360 |
text_file = gr.File(
|
361 |
-
label="Download
|
362 |
file_count="single",
|
363 |
type="file",
|
364 |
interactive=False,
|
|
|
320 |
|
321 |
print("SRT DONE")
|
322 |
try:
|
323 |
+
file1 = open('./subtitles.srt', 'r', encoding="utf-8")
|
324 |
Lines = file1.readlines()
|
325 |
|
326 |
count = 0
|
|
|
334 |
|
335 |
video_out = video_in.replace('.mp4', '_out.mp4')
|
336 |
print(video_out)
|
337 |
+
command = 'ffmpeg -i "{}" -y -vf subtitles=./subtitles.srt "{}"'.format(video_in, video_out)
|
338 |
print(command)
|
339 |
os.system(command)
|
340 |
return video_out, './testi.srt'
|
|
|
358 |
transcription_and_translation_df = gr.DataFrame(value=df_init,label="Transcription and translation dataframe", max_rows = 10, wrap=True, overflow_row_behaviour='paginate')
|
359 |
|
360 |
text_file = gr.File(
|
361 |
+
label="Download srt-file once you have burned the transcriptions to video",
|
362 |
file_count="single",
|
363 |
type="file",
|
364 |
interactive=False,
|