Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Commit b8326b9

Browse files
committed
Map only video and audio streams
1 parent 93fe7d3 commit b8326b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

playphrase.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def create_fragments(search_phrase, clips, export_mode, output_dir):
196196
subprocess_call(cmd)
197197

198198
if export_mode["video"]:
199-
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"]
199+
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"]
200200
subprocess_call(cmd)
201201

202202
if export_mode["video-sub"]:
@@ -212,7 +212,7 @@ def create_fragments(search_phrase, clips, export_mode, output_dir):
212212
vf = "subtitles=" + srt_filename + ":force_style='" + srt_style + "',setpts=PTS-STARTPTS"
213213
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)
214214

215-
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"]
215+
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"]
216216
subprocess_call(cmd)
217217

218218
if export_mode["subtitles"]:

0 commit comments

Comments
 (0)