From 28627e881685e49d2747788fd99e1ca0260f9eb3 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 19 May 2022 05:19:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=86=99=E9=94=99BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- danmaku_workflow.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/danmaku_workflow.py b/danmaku_workflow.py index c877ef1..be42415 100644 --- a/danmaku_workflow.py +++ b/danmaku_workflow.py @@ -341,10 +341,8 @@ class WorkerThread(QThread): "-i", orig_filename, "-vf", ",".join("subtitles=%s" % i for i in subtitles) + ",hwupload_cuda", "-c:a", "copy", "-c:v", "h264_nvenc", - "-f", "mp4", "-preset:v", "fast", "-profile:v", "high", "-level", "4.1", - "-b:v", VIDEO_BITRATE, "-rc:v", "vbr", "-tune:v", "hq", - "-qmin", "10", "-qmax", "32", "-crf", "16", - "-fflags", "+genpts", "-shortest", "-movflags", "faststart", + "-f", "mp4", "-b:v", VIDEO_BITRATE, "-rc:v", "vbr", "-tune:v", "hq", + *_common_ffmpeg_params(), # "-t", "10", new_filename ], **subprocess_args(True)) @@ -396,6 +394,7 @@ class WorkerThread(QThread): self.encode_video_with_subtitles(orig_filename, subtitles, new_fullpath) return [new_fullpath] duration = self.get_video_real_duration(orig_filename) + print("[ ]Video Duration:", duration) if duration > (VIDEO_CLIP_EACH_SEC * 5): # qsv 压制前2段,剩余交由nvenc压制 _slices = int(duration / VIDEO_CLIP_EACH_SEC) @@ -422,7 +421,7 @@ class WorkerThread(QThread): "-t", str((_slices - 1) * VIDEO_CLIP_EACH_SEC + (VIDEO_CLIP_OVERFLOW_SEC * 0.8)), "-i", orig_filename, "-vf", ",".join("subtitles=%s" % i for i in subtitles), - "-c:a", "copy", "-c:v", "h264_nvenc", "-ss", str(VIDEO_CLIP_EACH_SEC * 2), + "-c:a", "copy", "-c:v", "h264_nvenc", "-f", "mp4", "-b:v", VIDEO_BITRATE, "-rc:v", "vbr", "-tune:v", "hq", *_common_ffmpeg_params(), # "-t", "10", @@ -459,7 +458,7 @@ class WorkerThread(QThread): "-t", str(_slices * VIDEO_CLIP_EACH_SEC + (VIDEO_CLIP_OVERFLOW_SEC * 0.8)), "-i", orig_filename, "-vf", ",".join("subtitles=%s" % i for i in subtitles), - "-c:a", "copy", "-c:v", "h264_nvenc", "-ss", str(VIDEO_CLIP_EACH_SEC), + "-c:a", "copy", "-c:v", "h264_nvenc", "-f", "mp4", "-b:v", VIDEO_BITRATE, "-rc:v", "vbr", "-tune:v", "hq", *_common_ffmpeg_params(), # "-t", "10",