File tree Expand file tree Collapse file tree 2 files changed +90
-326
lines changed Expand file tree Collapse file tree 2 files changed +90
-326
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,8 @@ def set_video_codec(
68
68
) -> str :
69
69
if codec == "auto" :
70
70
codec = "h264" if (src is None or not src .videos ) else src .videos [0 ].codec
71
- if ctr .vcodecs is not None :
72
- if ctr .vstrict and codec not in ctr .vcodecs :
73
- return ctr .vcodecs [0 ]
74
-
75
- if codec in ctr .disallow_v :
76
- return ctr .vcodecs [0 ]
71
+ if ctr .vcodecs and codec not in ctr .vcodecs :
72
+ return ctr .vcodecs [0 ]
77
73
return codec
78
74
79
75
if codec == "copy" :
@@ -83,12 +79,7 @@ def set_video_codec(
83
79
log .error ("Input file does not have a video stream to copy codec from." )
84
80
codec = src .videos [0 ].codec
85
81
86
- if ctr .vstrict :
87
- assert ctr .vcodecs is not None
88
- if codec not in ctr .vcodecs :
89
- log .error (codec_error .format (codec , out_ext ))
90
-
91
- if codec in ctr .disallow_v :
82
+ if ctr .vcodecs is not None and codec not in ctr .vcodecs :
92
83
log .error (codec_error .format (codec , out_ext ))
93
84
94
85
return codec
@@ -99,7 +90,7 @@ def set_audio_codec(
99
90
) -> str :
100
91
if codec == "auto" :
101
92
codec = "aac" if (src is None or not src .audios ) else src .audios [0 ].codec
102
- if ctr .acodecs is not None and codec not in ctr .acodecs :
93
+ if ctr .acodecs and codec not in ctr .acodecs :
103
94
return ctr .acodecs [0 ]
104
95
return codec
105
96
You can’t perform that action at this time.
0 commit comments