Skip to content

Commit 55ea073

Browse files
committed
[scene_manager] Remove unused base_timecode argument
1 parent 2430ba6 commit 55ea073

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

scenedetect/scene_manager.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ def get_scenes_from_cuts(
169169
cut_list: CutList,
170170
start_pos: ty.Union[int, FrameTimecode],
171171
end_pos: ty.Union[int, FrameTimecode],
172-
base_timecode: ty.Optional[FrameTimecode] = None,
173172
) -> SceneList:
174173
"""Returns a list of tuples of start/end FrameTimecodes for each scene based on a
175174
list of detected scene cuts/breaks.
@@ -181,20 +180,15 @@ def get_scenes_from_cuts(
181180
182181
Arguments:
183182
cut_list: List of FrameTimecode objects where scene cuts/breaks occur.
184-
base_timecode: The base_timecode of which all FrameTimecodes in the cut_list are based on.
185183
num_frames: The number of frames, or FrameTimecode representing duration, of the video that
186184
was processed (used to generate last scene's end time).
187185
start_frame: The start frame or FrameTimecode of the cut list. Used to generate the first
188186
scene's start time.
189-
base_timecode: [DEPRECATED] DO NOT USE. For backwards compatibility only.
190187
Returns:
191188
List of tuples in the form (start_time, end_time), where both start_time and
192189
end_time are FrameTimecode objects representing the exact time/frame where each
193190
scene occupies based on the input cut_list.
194191
"""
195-
# TODO(v0.7): Use the warnings module to turn this into a warning.
196-
if base_timecode is not None:
197-
logger.error("`base_timecode` argument is deprecated has no effect.")
198192

199193
# Scene list, where scenes are tuples of (Start FrameTimecode, End FrameTimecode).
200194
scene_list = []
@@ -1099,13 +1093,10 @@ def clear_detectors(self) -> None:
10991093
"""Remove all scene detectors added to the SceneManager via add_detector()."""
11001094
self._detector_list.clear()
11011095

1102-
def get_scene_list(
1103-
self, base_timecode: ty.Optional[FrameTimecode] = None, start_in_scene: bool = False
1104-
) -> SceneList:
1096+
def get_scene_list(self, start_in_scene: bool = False) -> SceneList:
11051097
"""Return a list of tuples of start/end FrameTimecodes for each detected scene.
11061098
11071099
Arguments:
1108-
base_timecode: [DEPRECATED] DO NOT USE. For backwards compatibility.
11091100
start_in_scene: Assume the video begins in a scene. This means that when detecting
11101101
fast cuts with `ContentDetector`, if no cuts are found, the resulting scene list
11111102
will contain a single scene spanning the entire video (instead of no scenes).
@@ -1117,9 +1108,6 @@ def get_scene_list(
11171108
end_time are FrameTimecode objects representing the exact time/frame where each
11181109
detected scene in the video begins and ends.
11191110
"""
1120-
# TODO(v0.7): Replace with DeprecationWarning that `base_timecode` will be removed in v0.8.
1121-
if base_timecode is not None:
1122-
logger.error("`base_timecode` argument is deprecated and has no effect.")
11231111
if self._base_timecode is None:
11241112
return []
11251113
cut_list = self._get_cutting_list()
@@ -1424,7 +1412,6 @@ def _decode_thread(
14241412

14251413
def get_cut_list(
14261414
self,
1427-
base_timecode: ty.Optional[FrameTimecode] = None,
14281415
show_warning: bool = True,
14291416
) -> CutList:
14301417
"""[DEPRECATED] Return a list of FrameTimecodes of the detected scene changes/cuts.
@@ -1436,7 +1423,6 @@ def get_cut_list(
14361423
and ending at the last frame detected.
14371424
14381425
Arguments:
1439-
base_timecode: [DEPRECATED] DO NOT USE. For backwards compatibility only.
14401426
show_warning: If set to False, suppresses the error from being warned. In v0.7,
14411427
this will have no effect and the error will become a Python warning.
14421428

website/pages/changelog.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -659,22 +659,21 @@ Development
659659

660660
#### Breaking
661661

662-
* Many types and interfaces now use timecodes instead of frame numbers, which is a breaking change for:
662+
* Replace `frame_num` parameter (`int`) with `timecode` (`FrameTimecode`) in `SceneDetector` interface:
663663
* The detector interface: `SceneDetector.process_frame()` and `SceneDetector.post_process()`
664664
* Statistics: `StatsManager.get_metrics()`, `StatsManager.set_metrics()`, and `StatsManager.metrics_exist()`
665-
* The `SceneDetector` interface now uses timecodes instead of frame numbers
666-
* Remove deprecated `scenedetect.video_manager` module ([use `scenedetect.open_video()` function](https://www.scenedetect.com/docs/head/api.html#scenedetect.open_video) instead)
667-
* Deprecated `video_manager` parameter has been removed from many functions and constructors, use `video` parameter instead when required
668-
* Refactoring to make code less verbose:
665+
* Reorganized submodules:
669666
* `scenedetect.scene_detector` is now `scenedetect.detector`
670667
* `scenedetect.frame_timecode` is now `scenedetect.common`
668+
* Remove deprecated module `scenedetect.video_manager`, use [the `scenedetect.open_video()` function](https://www.scenedetect.com/docs/head/api.html#scenedetect.open_video) instead
669+
* Remove deprecated parameter `base_timecode` from various functions, there is no need to provide it
670+
* Remove deprecated parameter `video_manager` from various functions, use `video` parameter instead
671671
* `FrameTimecode` fields `frame_num` and `framerate` are now read-only properties, construct a new `FrameTimecode` to change them
672672
* Remove `FrameTimecode.previous_frame()` method
673673
* Remove `SceneDetector.is_processing_required()` method, already had no effect in v0.6 as part of deprecation
674674
* `SceneDetector` instances can now assume they always have frame data to process when `process_frame` is called
675675
* Remove deprecated `SparseSceneDetector` interface
676676
* Remove deprecated `SceneManager.get_event_list()` method
677-
* Remove deprecated `base_timecode` argument in `SceneManager.save_to_csv()`
678677
* Remove deprecated `AdaptiveDetector.get_content_val()` method (the same information can be obtained using a `StatsManager`)
679678

680679
#### Deprecation

0 commit comments

Comments
 (0)