FFMPEG命令替换

This commit is contained in:
Jerry Yan 2022-04-26 17:38:39 +08:00
parent 7e4b8cd601
commit 7999e76499

View File

@ -9,7 +9,7 @@ from config import FFMPEG_EXEC, VIDEO_BITRATE, FFMPEG_USE_NVIDIA_GPU, VIDEO_CLIP
def get_video_real_duration(filename):
ffmpeg_process = subprocess.Popen([
"ffmpeg", "-hide_banner", "-progress", "-", "-v", "0", "-i", filename, "-c", "copy", "-f", "null", "-"
FFMPEG_EXEC, "-hide_banner", "-progress", "-", "-v", "0", "-i", filename, "-c", "copy", "-f", "null", "-"
], stdout=subprocess.PIPE)
return handle_ffmpeg_output(ffmpeg_process.stdout)
@ -98,7 +98,7 @@ def quick_split_video(file):
print("CUR_DT", current_dt)
print("BIAS_T", current_sec)
split_process = subprocess.Popen([
"ffmpeg", "-y", "-hide_banner", "-progress", "-", "-v", "0",
FFMPEG_EXEC, "-y", "-hide_banner", "-progress", "-", "-v", "0",
"-ss", str(current_sec),
"-i", file_name, "-c", "copy", "-f", "mp4",
"-t", str(VIDEO_CLIP_EACH_SEC + VIDEO_CLIP_OVERFLOW_SEC),