@@ -162,6 +162,10 @@ def edit_media(paths: list[str], args: Args, log: Log) -> None:
162
162
bar = initBar (args .progress )
163
163
tl = None
164
164
165
+ if args .keep_tracks_separate :
166
+ log .deprecated ("--keep-tracks-separate is deprecated." )
167
+ args .keep_tracks_separate = False
168
+
165
169
if paths :
166
170
path_ext = splitext (paths [0 ])[1 ].lower ()
167
171
if path_ext == ".xml" :
@@ -273,9 +277,6 @@ def edit_media(paths: list[str], args: Args, log: Log) -> None:
273
277
args .video_codec = set_video_codec (args .video_codec , src , out_ext , ctr , log )
274
278
args .audio_codec = set_audio_codec (args .audio_codec , src , out_ext , ctr , log )
275
279
276
- if args .keep_tracks_separate and ctr .max_audios == 1 :
277
- log .warning (f"'{ out_ext } ' container doesn't support multiple audio tracks." )
278
-
279
280
def make_media (tl : v3 , output_path : str ) -> None :
280
281
assert src is not None
281
282
@@ -293,17 +294,6 @@ def make_media(tl: v3, output_path: str) -> None:
293
294
294
295
output = av .open (output_path , "w" , container_options = options )
295
296
296
- if ctr .default_sub != "none" and not args .sn :
297
- sub_paths = make_new_subtitles (tl , log )
298
- else :
299
- sub_paths = []
300
-
301
- if ctr .default_aud != "none" :
302
- ensure = Ensure (bar , samplerate , log )
303
- audio_paths = make_new_audio (tl , ctr , ensure , args , bar , log )
304
- else :
305
- audio_paths = []
306
-
307
297
# Setup video
308
298
if ctr .default_vid != "none" and tl .v :
309
299
vframes = render_av (output , tl , args , log )
@@ -313,6 +303,16 @@ def make_media(tl: v3, output_path: str) -> None:
313
303
output_stream , vframes = None , iter ([])
314
304
315
305
# Setup audio
306
+ if ctr .default_aud != "none" :
307
+ ensure = Ensure (bar , samplerate , log )
308
+ audio_paths = make_new_audio (tl , ctr , ensure , args , bar , log )
309
+ else :
310
+ audio_paths = []
311
+
312
+ if len (audio_paths ) > 1 and ctr .max_audios == 1 :
313
+ log .warning ("Dropping extra audio streams (container only allows one)" )
314
+ audio_paths = audio_paths [0 :1 ]
315
+
316
316
if audio_paths :
317
317
try :
318
318
audio_encoder = av .Codec (args .audio_codec , "w" )
@@ -350,6 +350,11 @@ def make_media(tl: v3, output_path: str) -> None:
350
350
audio_gen_frames .append (audio_input .decode (audio = 0 ))
351
351
352
352
# Setup subtitles
353
+ if ctr .default_sub != "none" and not args .sn :
354
+ sub_paths = make_new_subtitles (tl , log )
355
+ else :
356
+ sub_paths = []
357
+
353
358
subtitle_streams = []
354
359
subtitle_inputs = []
355
360
sub_gen_frames = []
0 commit comments