LoadConfig ,无GPU兼容
This commit is contained in:
parent
1ec065428d
commit
7eb32d4ce1
@ -1,8 +1,10 @@
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
from config import load_config
|
||||||
from worker.danmaku import do_workflow
|
from worker.danmaku import do_workflow
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
load_config()
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("video", help="视频标准")
|
parser.add_argument("video", help="视频标准")
|
||||||
parser.add_argument("base", help="弹幕标准")
|
parser.add_argument("base", help="弹幕标准")
|
||||||
|
@ -23,7 +23,8 @@ def get_video_real_duration(filename):
|
|||||||
def encode_video_with_subtitles(orig_filename: str, subtitles: list[str], new_filename: str):
|
def encode_video_with_subtitles(orig_filename: str, subtitles: list[str], new_filename: str):
|
||||||
encode_process = subprocess.Popen([
|
encode_process = subprocess.Popen([
|
||||||
FFMPEG_EXEC, "-hide_banner", "-progress", "-", "-v", "0", "-y",
|
FFMPEG_EXEC, "-hide_banner", "-progress", "-", "-v", "0", "-y",
|
||||||
"-i", orig_filename, "-vf", ",".join("subtitles=%s" % i for i in subtitles) + ",hwupload_cuda",
|
"-i", orig_filename, "-vf",
|
||||||
|
",".join("subtitles=%s" % i for i in subtitles) + (",hwupload_cuda" if FFMPEG_USE_GPU else ""),
|
||||||
"-c:a", "copy", "-c:v", "h264_nvenc" if FFMPEG_USE_GPU else "h264", "-f", "mp4",
|
"-c:a", "copy", "-c:v", "h264_nvenc" if FFMPEG_USE_GPU else "h264", "-f", "mp4",
|
||||||
"-preset:v", "fast", "-profile:v", "high", "-level", "4.1",
|
"-preset:v", "fast", "-profile:v", "high", "-level", "4.1",
|
||||||
"-b:v", VIDEO_BITRATE, "-rc:v", "vbr", "-tune", "hq",
|
"-b:v", VIDEO_BITRATE, "-rc:v", "vbr", "-tune", "hq",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user