@@ -101,7 +101,7 @@ def test_stream_repr():
101
101
102
102
def test_get_args_simple ():
103
103
out_file = ffmpeg .input ('dummy.mp4' ).output ('dummy2.mp4' )
104
- assert out_file .get_args () == ['-i' , 'dummy.mp4' , 'dummy2.mp4' ]
104
+ assert out_file .get_args () == ['-i' , 'dummy.mp4' , 'dummy2.mp4' , '-y' ]
105
105
106
106
107
107
def _get_complex_filter_example ():
@@ -122,7 +122,6 @@ def _get_complex_filter_example():
122
122
.overlay (overlay_file .hflip ())
123
123
.drawbox (50 , 50 , 120 , 120 , color = 'red' , thickness = 5 )
124
124
.output (TEST_OUTPUT_FILE1 )
125
- .overwrite_output ()
126
125
)
127
126
128
127
@@ -156,7 +155,7 @@ def _get_drawtext_font_repr(font):
156
155
.get_args ()
157
156
)
158
157
assert args [:3 ] == ['-i' , 'in' , '-filter_complex' ]
159
- assert args [4 :] == ['-map' , '[s0]' , 'out' ]
158
+ assert args [4 :] == ['-map' , '[s0]' , 'out' , '-y' ]
160
159
match = re .match (r'\[0\]drawtext=font=a((.|\n)*)b:text=test\[s0\]' , args [3 ], re .MULTILINE )
161
160
assert match is not None , 'Invalid -filter_complex arg: {!r}' .format (args [3 ])
162
161
return match .group (1 )
@@ -190,7 +189,7 @@ def _get_drawtext_text_repr(text):
190
189
.get_args ()
191
190
)
192
191
assert args [:3 ] == ['-i' , 'in' , '-filter_complex' ]
193
- assert args [4 :] == ['-map' , '[s0]' , 'out' ]
192
+ assert args [4 :] == ['-map' , '[s0]' , 'out' , '-y' ]
194
193
match = re .match (r'\[0\]drawtext=text=a((.|\n)*)b\[s0\]' , args [3 ], re .MULTILINE )
195
194
assert match is not None , 'Invalid -filter_complex arg: {!r}' .format (args [3 ])
196
195
return match .group (1 )
@@ -226,7 +225,7 @@ def test_run_multi_output():
226
225
in_ = ffmpeg .input (TEST_INPUT_FILE1 )
227
226
out1 = in_ .output (TEST_OUTPUT_FILE1 )
228
227
out2 = in_ .output (TEST_OUTPUT_FILE2 )
229
- ffmpeg .run ([out1 , out2 ], overwrite_output = True )
228
+ ffmpeg .run ([out1 , out2 ])
230
229
231
230
232
231
def test_run_dummy_cmd ():
@@ -253,7 +252,8 @@ def test_custom_filter():
253
252
'-i' , 'dummy.mp4' ,
254
253
'-filter_complex' , '[0]custom_filter=a:b:kwarg1=c[s0]' ,
255
254
'-map' , '[s0]' ,
256
- 'dummy2.mp4'
255
+ 'dummy2.mp4' ,
256
+ '-y' ,
257
257
]
258
258
259
259
@@ -267,7 +267,8 @@ def test_custom_filter_fluent():
267
267
'-i' , 'dummy.mp4' ,
268
268
'-filter_complex' , '[0]custom_filter=a:b:kwarg1=c[s0]' ,
269
269
'-map' , '[s0]' ,
270
- 'dummy2.mp4'
270
+ 'dummy2.mp4' ,
271
+ '-y' ,
271
272
]
272
273
273
274
@@ -276,10 +277,10 @@ def test_merge_outputs():
276
277
out1 = in_ .output ('out1.mp4' )
277
278
out2 = in_ .output ('out2.mp4' )
278
279
assert ffmpeg .merge_outputs (out1 , out2 ).get_args () == [
279
- '-i' , 'in.mp4' , 'out1.mp4' , 'out2.mp4'
280
+ '-i' , 'in.mp4' , 'out1.mp4' , 'out2.mp4' , '-y'
280
281
]
281
282
assert ffmpeg .get_args ([out1 , out2 ]) == [
282
- '-i' , 'in.mp4' , 'out2.mp4' , 'out1.mp4'
283
+ '-i' , 'in.mp4' , 'out2.mp4' , 'out1.mp4' , '-y'
283
284
]
284
285
285
286
@@ -292,14 +293,16 @@ def test_multi_passthrough():
292
293
'-i' , 'in2.mp4' ,
293
294
'out1.mp4' ,
294
295
'-map' , '[1]' , # FIXME: this should not be here (see #23)
295
- 'out2.mp4'
296
+ 'out2.mp4' ,
297
+ '-y' ,
296
298
]
297
299
assert ffmpeg .get_args ([out1 , out2 ]) == [
298
300
'-i' , 'in2.mp4' ,
299
301
'-i' , 'in1.mp4' ,
300
302
'out2.mp4' ,
301
303
'-map' , '[1]' , # FIXME: this should not be here (see #23)
302
- 'out1.mp4'
304
+ 'out1.mp4' ,
305
+ '-y' ,
303
306
]
304
307
305
308
@@ -327,7 +330,8 @@ def test_pipe():
327
330
'[0]trim=start_frame=2[s0]' ,
328
331
'-map' , '[s0]' ,
329
332
'-f' , 'rawvideo' ,
330
- 'pipe:1'
333
+ 'pipe:1' ,
334
+ '-y' ,
331
335
]
332
336
333
337
cmd = ['ffmpeg' ] + args
0 commit comments