Compare commits

...

2 Commits

Author SHA1 Message Date
92bc5791ac 重新编码音频 2022-12-05 10:40:27 +08:00
a25d5fbe06 避免没有名字 2022-11-28 10:35:25 +08:00
2 changed files with 3 additions and 2 deletions

View File

@ -101,6 +101,7 @@ def safe_create_item():
global bili_record_workflow_item
if bili_record_workflow_item is None:
bili_record_workflow_item = Workflow()
bili_record_workflow_item.name = VIDEO_TITLE.format(datetime.utcnow().strftime("%Y%m%d"))
elif bili_record_workflow_item.id is not None:
bili_record_workflow_item.editing = False
if bili_record_workflow_item.name is None:

View File

@ -214,7 +214,7 @@ def quick_split_video(file):
split_process = subprocess.Popen([
FFMPEG_EXEC, *_common_ffmpeg_setting(),
"-ss", str(current_sec),
"-i", file, "-c", "copy", "-f", "mp4",
"-i", file, "-c:v", "copy", "-c:a", "aac", "-f", "mp4",
"-t", str(VIDEO_CLIP_EACH_SEC + VIDEO_CLIP_OVERFLOW_SEC),
"-fflags", "+genpts", "-shortest", "-movflags", "faststart",
os.path.join(VIDEO_OUTPUT_DIR, "{}.mp4".format(current_dt))
@ -237,7 +237,7 @@ def _common_ffmpeg_setting():
def _common_ffmpeg_params():
return (
"-f", "mp4", "-b:v", VIDEO_BITRATE, "-c:a", "copy",
"-f", "mp4", "-b:v", VIDEO_BITRATE, "-c:a", "aac",
"-preset:v", "fast", "-profile:v", "main", "-avoid_negative_ts", "1",
"-qmin", "18", "-qmax", "38", "-crf", str(VIDEO_CRF), "-g:v", str(VIDEO_GOP),
"-fflags", "+genpts", "-shortest"