From b3b56607a2c7fc3e4265f3d17083d56b87a605a8 Mon Sep 17 00:00:00 2001 From: Breakthrough Date: Sun, 15 Sep 2024 22:01:28 -0400 Subject: [PATCH] [docs] Update outdated documentation. --- docs/api.rst | 33 ++------------------------------- docs/api/migration_guide.rst | 2 +- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 7bbd3dba..cc292893 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -79,38 +79,9 @@ Now that we know where each scene is, we can also :ref:`split the input video `_. - - -.. _scenedetect-detailed_example: - -======================================================================= -Example -======================================================================= - -In this example, we create a function ``find_scenes()`` which will load a video, detect the scenes, and return a list of tuples containing the (start, end) timecodes of each detected scene. Note that you can modify the `threshold` argument to modify the sensitivity of the :class:`ContentDetector `, or use other detection algorithms (e.g. :class:`ThresholdDetector `, :class:`AdaptiveDetector `). - -.. code:: python - - from scenedetect import SceneManager, open_video, ContentDetector - - def find_scenes(video_path, threshold=27.0): - video = open_video(video_path) - scene_manager = SceneManager() - scene_manager.add_detector( - ContentDetector(threshold=threshold)) - # Detect all scenes in video from current position to end. - scene_manager.detect_scenes(video) - # `get_scene_list` returns a list of start/end timecode pairs - # for each scene that was found. - return scene_manager.get_scene_list() - -Using a :class:`SceneManager ` directly allows tweaking the Parameters passed to :meth:`detect_scenes ` including setting a limit to the number of frames to process, which is useful for live streams/camera devices. You can also combine detection algorithms or create new ones from scratch. - -For a more advanced example of using the PySceneDetect API to with a stats file (to save per-frame metrics to disk and/or speed up multiple passes of the same video), take a look at the :ref:`example in the SceneManager reference`. - -In addition to module-level examples, demonstrations of some common use cases can be found in the `tests/test_api.py `_ file. + example of using the PySceneDetect API to with a stats file (to save per-frame metrics to disk and/or speed up multiple passes of the same video), take a look at the :ref:`example in the SceneManager +Recipes for common use cases can be :ref:`found on Github `_ including limiting detection time and storing per-frame metrics. For advanced workflows, start with the :ref:`examples in the SceneManager reference `. ======================================================================= Functions diff --git a/docs/api/migration_guide.rst b/docs/api/migration_guide.rst index f24baefa..7f7df42e 100644 --- a/docs/api/migration_guide.rst +++ b/docs/api/migration_guide.rst @@ -5,7 +5,7 @@ Migration Guide --------------------------------------------------------------- -This page details how to transition a program written using PySceneDetect 0.5 to the new 0.6 API. It is recommended to review the new :ref:`Quickstart ` and :ref:`Example ` sections first, as they should cover the majority of use cases. Also see `tests/test_api.py `_ for a set of demonstrations covering many high level use cases. +This page details how to transition a program written using PySceneDetect 0.5 to the new 0.6 API. It is recommended to review the new :ref:`Example ` section first, as it covers the majority of use cases. Also see `tests/test_api.py `_ for a set of demonstrations covering many high level use cases. PySceneDetect v0.6 is a major step towards a more stable and simplified API. The biggest change to existing workflows is how video input is handled, and that Python 3.6 or above is now required.