From b8326b9c739a3c749d57f02d9e262b41e9fc9907 Mon Sep 17 00:00:00 2001 From: kelciour Date: Sat, 10 Oct 2020 13:09:20 +0300 Subject: [PATCH] Map only video and audio streams --- playphrase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playphrase.py b/playphrase.py index 743c3bd..28fcdd5 100644 --- a/playphrase.py +++ b/playphrase.py @@ -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"]: