mirror of
https://github.com/karl0ss/bazarr-ai-sub-generator.git
synced 2025-04-26 14:59:21 +01:00
parent
cfafce9ccf
commit
8a572fc3b3
@ -47,9 +47,6 @@ def main():
|
|||||||
if srt_only:
|
if srt_only:
|
||||||
return
|
return
|
||||||
|
|
||||||
# bash command to download a youtube video with `youtube-dl` and save it as `video.mp4`:
|
|
||||||
# youtube-dl -f 22 -o video.mp4 https://www.youtube.com/watch?v=QH2-TGUlwu4
|
|
||||||
|
|
||||||
for path, srt_path in subtitles.items():
|
for path, srt_path in subtitles.items():
|
||||||
out_path = os.path.join(output_dir, f"{filename(path)}.mp4")
|
out_path = os.path.join(output_dir, f"{filename(path)}.mp4")
|
||||||
|
|
||||||
@ -58,7 +55,7 @@ def main():
|
|||||||
video = ffmpeg.input(path)
|
video = ffmpeg.input(path)
|
||||||
audio = video.audio
|
audio = video.audio
|
||||||
|
|
||||||
stderr = ffmpeg.concat(
|
ffmpeg.concat(
|
||||||
video.filter('subtitles', srt_path, force_style="OutlineColour=&H40000000,BorderStyle=3"), audio, v=1, a=1
|
video.filter('subtitles', srt_path, force_style="OutlineColour=&H40000000,BorderStyle=3"), audio, v=1, a=1
|
||||||
).output(out_path).run(quiet=True, overwrite_output=True)
|
).output(out_path).run(quiet=True, overwrite_output=True)
|
||||||
|
|
||||||
|
@ -1,2 +1 @@
|
|||||||
youtube-dl
|
openai-whisper
|
||||||
git+https://github.com/openai/whisper.git
|
|
||||||
|
6
setup.py
6
setup.py
@ -1,6 +1,3 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
import pkg_resources
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
@ -10,8 +7,7 @@ setup(
|
|||||||
py_modules=["auto_subtitle"],
|
py_modules=["auto_subtitle"],
|
||||||
author="Miguel Piedrafita",
|
author="Miguel Piedrafita",
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'youtube-dl',
|
'openai-whisper',
|
||||||
'whisper @ git+https://github.com/openai/whisper.git@main#egg=whisper'
|
|
||||||
],
|
],
|
||||||
description="Automatically generate and embed subtitles into your videos",
|
description="Automatically generate and embed subtitles into your videos",
|
||||||
entry_points={
|
entry_points={
|
||||||
|
Loading…
x
Reference in New Issue
Block a user