You've already forked my-video-workflow
恢复使用CRF,nvenc压制时,使用slowest预设
This commit is contained in:
@ -3,7 +3,7 @@ import subprocess
|
||||
from datetime import datetime, timedelta
|
||||
from typing import IO
|
||||
|
||||
from config import FFMPEG_EXEC, FFMPEG_USE_HEVC, VIDEO_BITRATE, FFMPEG_USE_NVIDIA_GPU, VIDEO_CLIP_EACH_SEC, \
|
||||
from config import FFMPEG_EXEC, FFMPEG_USE_HEVC, VIDEO_CRF, FFMPEG_USE_NVIDIA_GPU, VIDEO_CLIP_EACH_SEC, \
|
||||
VIDEO_CLIP_OVERFLOW_SEC, \
|
||||
FFMPEG_USE_INTEL_GPU, VIDEO_OUTPUT_DIR, VIDEO_GOP, FFMPEG_USE_VAAPI
|
||||
from . import LOGGER
|
||||
@ -56,7 +56,7 @@ def get_encode_process_use_nvenc(orig_filename: str, subtitles: list[str], new_f
|
||||
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
||||
"-i", orig_filename, "-vf",
|
||||
",".join("subtitles=%s" % i for i in subtitles) + ",hwupload_cuda",
|
||||
"-c:v", "h264_nvenc",
|
||||
"-c:v", "h264_nvenc", "-preset:v", "p7",
|
||||
*_common_ffmpeg_params(),
|
||||
# "-t", "10",
|
||||
new_filename
|
||||
@ -113,7 +113,7 @@ def get_encode_hevc_process_use_nvenc(orig_filename: str, subtitles: list[str],
|
||||
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
||||
"-i", orig_filename, "-vf",
|
||||
"".join("subtitles=%s," % i for i in subtitles) + "hwupload_cuda",
|
||||
"-c:v", "hevc_nvenc",
|
||||
"-c:v", "hevc_nvenc", "-preset:v", "p7",
|
||||
*_common_ffmpeg_params(),
|
||||
# "-t", "10",
|
||||
new_filename
|
||||
@ -238,7 +238,7 @@ def _common_ffmpeg_setting():
|
||||
def _common_ffmpeg_params():
|
||||
return (
|
||||
"-vsync", "1", "-async", "1", "-avoid_negative_ts", "1",
|
||||
"-f", "mp4", "-b:v", VIDEO_BITRATE, "-c:a", "aac",
|
||||
"-qmin", "18", "-qmax", "38", "-g:v", str(VIDEO_GOP),
|
||||
"-f", "mp4", "-c:a", "aac",
|
||||
"-crf", str(VIDEO_CRF), "-g:v", str(VIDEO_GOP),
|
||||
"-fflags", "+genpts", "-shortest"
|
||||
)
|
||||
|
Reference in New Issue
Block a user