Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 129a948f02 | |||
| 34a99fdec0 | |||
| 15db01096f | |||
| 588fa17eb2 | |||
| b8326b9c73 |
+4
-3
@@ -196,7 +196,7 @@ def create_fragments(search_phrase, clips, export_mode, output_dir):
|
||||
subprocess_call(cmd)
|
||||
|
||||
if export_mode["video"]:
|
||||
cmd = ["ffmpeg", "-y", "-ss", str(ss), "-i", video_file, "-strict", "-2", "-t", str(t), "-map", "0", "-c:v", "libx264", "-preset", video_encoding_mode, "-c:a", "aac", "-ac", "2", "-af", af, fragment_filename + ".mp4"]
|
||||
cmd = ["ffmpeg", "-y", "-ss", str(ss), "-i", video_file, "-strict", "-2", "-t", str(t), "-map", "0:v", "-map", "0:a", "-c:v", "libx264", "-preset", video_encoding_mode, "-c:a", "aac", "-ac", "2", "-af", af, fragment_filename + ".mp4"]
|
||||
subprocess_call(cmd)
|
||||
|
||||
if export_mode["video-sub"]:
|
||||
@@ -212,7 +212,7 @@ def create_fragments(search_phrase, clips, export_mode, output_dir):
|
||||
vf = "subtitles=" + srt_filename + ":force_style='" + srt_style + "',setpts=PTS-STARTPTS"
|
||||
af = "afade=t=in:st=%s:d=%s,afade=t=out:st=%s:d=%s,asetpts=PTS-STARTPTS" % (ss, t_fade, to - t_fade, t_fade)
|
||||
|
||||
cmd = ["ffmpeg", "-y", "-ss", str(ss), "-i", video_file, "-strict", "-2", "-t", str(t), "-map", "0", "-c:v", "libx264", "-preset", video_encoding_mode, "-c:a", "aac", "-ac", "2", "-vf", vf, "-af", af, "-copyts", fragment_filename + ".sub.mp4"]
|
||||
cmd = ["ffmpeg", "-y", "-ss", str(ss), "-i", video_file, "-strict", "-2", "-t", str(t), "-map", "0:v", "-map", "0:a", "-c:v", "libx264", "-preset", video_encoding_mode, "-c:a", "aac", "-ac", "2", "-vf", vf, "-af", af, "-copyts", fragment_filename + ".sub.mp4"]
|
||||
subprocess_call(cmd)
|
||||
|
||||
if export_mode["subtitles"]:
|
||||
@@ -243,6 +243,7 @@ def play_clips(clips, ending_mode, mpv_options):
|
||||
with open(pipe_name, "wb", 0) as f_pipe:
|
||||
for clip_filename, clip_start, clip_end in clips:
|
||||
clip_filename = clip_filename.replace("\\","/")
|
||||
clip_filename = clip_filename.replace("\"", "\\\"")
|
||||
|
||||
cmd = ["loadfile", '"' + clip_filename + '"']
|
||||
if ending_mode:
|
||||
@@ -282,7 +283,7 @@ def main(media_dir, search_phrase, phrase_mode, phrases_gap, padding, limit, out
|
||||
|
||||
rg = shutil.which('rg')
|
||||
if rg:
|
||||
cmd = ["rg", "--no-heading", "--null-data", "-N", "-o", "-i", "-g", "*.txt", "-P", search_phrase_in_grep, media_dir]
|
||||
cmd = ["rg", "--sort-files", "--no-heading", "--null-data", "-N", "-o", "-i", "-g", "*.txt", "-P", search_phrase_in_grep, media_dir]
|
||||
else:
|
||||
cmd = ["grep", "-r", "-z", "-o", "-i", "--include", "*.txt", "-P", search_phrase_in_grep, media_dir]
|
||||
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, bufsize=-1)
|
||||
|
||||
Reference in New Issue
Block a user