@@ -187,7 +187,7 @@ def handle_options(
187
187
init_failure = not self .config .initialized
188
188
init_log = self .config .get_init_log ()
189
189
quiet = not init_failure and quiet
190
- self ._initialize_logging (quiet = quiet , verbosity = verbosity , logfile = logfile )
190
+ self ._initialize_logging (quiet , verbosity , logfile )
191
191
192
192
# Configuration file was specified via CLI argument -c/--config.
193
193
if config and not init_failure :
@@ -229,20 +229,16 @@ def handle_options(
229
229
param_hint = "frame skip + stats file" ,
230
230
)
231
231
232
- # Handle the case where -i/--input was not specified (e.g. for the `help` command).
232
+ # Handle case where -i/--input was not specified (e.g. for the `help` command).
233
233
if input_path is None :
234
234
return
235
235
236
- # Have to load the input video to obtain a time base before parsing timecodes.
237
- self ._open_video_stream (
238
- input_path = input_path ,
239
- framerate = framerate ,
240
- backend = self .config .get_value ("global" , "backend" , backend , ignore_default = True ),
241
- )
236
+ # Load the input video to obtain a time base for parsing timecodes.
237
+ self ._open_video_stream (input_path , framerate , backend )
242
238
243
- self .output_dir = output if output else self .config .get_value ("global" , "output" )
239
+ self .output_dir = self .config .get_value ("global" , "output" , output )
244
240
if self .output_dir :
245
- logger .info ("Output directory set:\n %s" , self .output_dir )
241
+ logger .debug ("Output directory set:\n %s" , self .output_dir )
246
242
247
243
self .min_scene_len = self .parse_timecode (
248
244
min_scene_len
@@ -507,7 +503,10 @@ def _initialize_logging(
507
503
init_logger (log_level = curr_verbosity , show_stdout = not self .quiet_mode , log_file = logfile )
508
504
509
505
def _open_video_stream (
510
- self , input_path : ty .AnyStr , framerate : ty .Optional [float ], backend : ty .Optional [str ]
506
+ self ,
507
+ input_path : ty .AnyStr ,
508
+ framerate : ty .Optional [float ],
509
+ backend : ty .Optional [str ],
511
510
):
512
511
if "%" in input_path and backend != "opencv" :
513
512
raise click .BadParameter (
@@ -517,14 +516,13 @@ def _open_video_stream(
517
516
if framerate is not None and framerate < MAX_FPS_DELTA :
518
517
raise click .BadParameter ("Invalid framerate specified!" , param_hint = "-f/--framerate" )
519
518
try :
520
- if backend is None :
521
- backend = self .config .get_value ("global" , "backend" )
522
- else :
523
- if backend not in AVAILABLE_BACKENDS :
524
- raise click .BadParameter (
525
- "Specified backend %s is not available on this system!" % backend ,
526
- param_hint = "-b/--backend" ,
527
- )
519
+ backend = self .config .get_value ("global" , "backend" , backend )
520
+ if backend not in AVAILABLE_BACKENDS :
521
+ raise click .BadParameter (
522
+ "Specified backend %s is not available on this system!" % backend ,
523
+ param_hint = "-b/--backend" ,
524
+ )
525
+
528
526
# Open the video with the specified backend, loading any required config settings.
529
527
if backend == "pyav" :
530
528
self .video_stream = open_video (
0 commit comments