Update app.py
Browse files
app.py
CHANGED
@@ -276,7 +276,7 @@ def create_srt_and_burn(df, video_in):
|
|
276 |
print("Starting creation of video wit srt")
|
277 |
|
278 |
|
279 |
-
with open('
|
280 |
for i in range(len(df)):
|
281 |
file.write(str(i+1))
|
282 |
file.write('\n')
|
@@ -337,7 +337,7 @@ def create_srt_and_burn(df, video_in):
|
|
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, './
|
341 |
except Exception as e:
|
342 |
print(e)
|
343 |
return video_out
|
@@ -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 srt-file
|
362 |
file_count="single",
|
363 |
type="file",
|
364 |
interactive=False,
|
@@ -448,6 +448,8 @@ with demo:
|
|
448 |
|
449 |
with gr.Row():
|
450 |
with gr.Column():
|
|
|
|
|
451 |
text_file.render()
|
452 |
|
453 |
|
|
|
276 |
print("Starting creation of video wit srt")
|
277 |
|
278 |
|
279 |
+
with open('subtitles.srt','w', encoding="utf-8") as file:
|
280 |
for i in range(len(df)):
|
281 |
file.write(str(i+1))
|
282 |
file.write('\n')
|
|
|
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, './subtitles.srt'
|
341 |
except Exception as e:
|
342 |
print(e)
|
343 |
return video_out
|
|
|
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",
|
362 |
file_count="single",
|
363 |
type="file",
|
364 |
interactive=False,
|
|
|
448 |
|
449 |
with gr.Row():
|
450 |
with gr.Column():
|
451 |
+
gr.Markdown('''
|
452 |
+
##### From here you can download the srt-file ''')
|
453 |
text_file.render()
|
454 |
|
455 |
|