@@ -551,23 +551,24 @@ def index_visuals(
551551 :return: The scene index id
552552 :rtype: str
553553 """
554- if batch_config is None :
555- batch_config = {"type" : "time" , "value" : 10 , "frame_count" : 1 }
556-
557- extraction_type = batch_config .get ("type" , "time" )
558- if extraction_type == "shot" :
559- extraction_type = SceneExtractionType .shot_based
560- extraction_config = {
561- "threshold" : batch_config .get ("value" , 20 ),
562- "frame_count" : batch_config .get ("frame_count" , 1 ),
563- }
554+ if batch_config is not None :
555+ extraction_type = batch_config .get ("type" )
556+ if extraction_type == "shot" :
557+ extraction_type = SceneExtractionType .shot_based
558+ extraction_config = {
559+ "threshold" : batch_config .get ("value" ),
560+ "frame_count" : batch_config .get ("frame_count" ),
561+ }
562+ else :
563+ extraction_type = SceneExtractionType .time_based
564+ extraction_config = {
565+ "time" : batch_config .get ("value" ),
566+ "frame_count" : batch_config .get ("frame_count" ),
567+ "select_frames" : batch_config .get ("select_frames" ),
568+ }
564569 else :
565- extraction_type = SceneExtractionType .time_based
566- extraction_config = {
567- "time" : batch_config .get ("value" , 10 ),
568- "frame_count" : batch_config .get ("frame_count" , 1 ),
569- "select_frames" : batch_config .get ("select_frames" , ["first" ]),
570- }
570+ extraction_type = None
571+ extraction_config = None
571572
572573 scenes_data = self ._connection .post (
573574 path = f"{ ApiPath .video } /{ self .id } /{ ApiPath .index } /{ ApiPath .scene } " ,
@@ -614,13 +615,13 @@ def index_audio(
614615 :return: The scene index id
615616 :rtype: str
616617 """
617- if batch_config is None :
618- batch_config = {"type" : Segmenter . word , "value" : 10 }
619-
620- extraction_config = {
621- "segmenter" : batch_config . get ( "type" , Segmenter . word ),
622- "segmentation_value" : batch_config . get ( "value" , 10 ),
623- }
618+ if batch_config is not None :
619+ extraction_config = {
620+ "segmenter" : batch_config . get ( "type" ),
621+ "segmentation_value" : batch_config . get ( "value" ),
622+ }
623+ else :
624+ extraction_config = None
624625
625626 scenes_data = self ._connection .post (
626627 path = f"{ ApiPath .video } /{ self .id } /{ ApiPath .index } /{ ApiPath .scene } " ,
0 commit comments