mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-03-05 18:27:36 +08:00
兼容安卓手机不能分享生成视频的问题
This commit is contained in:
@@ -64,6 +64,8 @@ class InpaintMode(Enum):
|
||||
|
||||
|
||||
# ×××××××××××××××××××× [可以改] start ××××××××××××××××××××
|
||||
# 是否使用h264编码,如果需要安卓手机分享生成的视频,请打开该选项
|
||||
USE_H264 = True
|
||||
|
||||
# ×××××××××× 通用设置 start ××××××××××
|
||||
# 【设置inpaint算法】
|
||||
@@ -86,7 +88,8 @@ PIXEL_TOLERANCE_X = 20 # 允许检测框横向偏差的像素点数
|
||||
# ×××××××××× InpaintMode.STTN算法设置 start ××××××××××
|
||||
# 以下参数仅适用STTN算法时,才生效
|
||||
# 是否使用跳过检测,跳过字幕检测会省去很大时间,但是可能误伤无字幕的视频帧
|
||||
STTN_SKIP_DETECTION = True
|
||||
# 注意:将STTN_SKIP_DETECTION设置为True可能会导致去除的字幕漏了
|
||||
STTN_SKIP_DETECTION = False
|
||||
# 相邻帧数, 调大会增加显存占用,效果变好
|
||||
STTN_NEIGHBOR_STRIDE = 10
|
||||
# 参考帧长度, 调大会增加显存占用,效果变好
|
||||
|
||||
@@ -845,7 +845,7 @@ class SubtitleRemover:
|
||||
audio_merge_command = [config.FFMPEG_PATH,
|
||||
"-y", "-i", self.video_temp_file.name,
|
||||
"-i", temp.name,
|
||||
"-vcodec", "copy",
|
||||
"-vcodec", "libx264" if config.USE_H264 else "copy",
|
||||
"-acodec", "copy",
|
||||
"-loglevel", "error", self.video_out_name]
|
||||
try:
|
||||
|
||||
@@ -22,8 +22,8 @@ def merge_video(video_input_path0, video_input_path1, video_output_path):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
v0_path = '../../test/test_2_low.mp4'
|
||||
v1_path = '../../test/test_2_low_no_sub.mp4'
|
||||
v0_path = '../../test/test4.mp4'
|
||||
v1_path = '../../test/test4_no_sub.mp4'
|
||||
video_out_path = '../../test/demo.mp4'
|
||||
merge_video(v0_path, v1_path, video_out_path)
|
||||
# ffmpeg 命令 mp4转gif
|
||||
|
||||
Reference in New Issue
Block a user