Skip to content

Commit 67de2f1

Browse files
committed
[docs] Update migration guide to include missing entires for 0.7
1 parent 95df793 commit 67de2f1

2 files changed

Lines changed: 42 additions & 2 deletions

File tree

docs/api/migration_guide.rst

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ Several submodules have been reorganized. If you import directly from `scenedete
5656

5757
Most commonly used types and functions are also available directly from the top-level ``scenedetect`` package (e.g. ``from scenedetect import FrameTimecode``), which has not changed.
5858

59+
.. note::
60+
61+
The ``frame_timecode``, ``scene_detector``, and ``video_splitter`` submodules emit a ``DeprecationWarning`` when imported directly. The ``save_images``, ``write_scene_list``, and ``write_scene_list_html`` re-exports from ``scenedetect.scene_manager`` continue to work silently in v0.7 but **will be removed in v0.8**. Import these symbols from ``scenedetect`` directly to avoid breakage.
62+
5963

6064
=======================================================================
6165
Custom Detector Changes
@@ -141,6 +145,11 @@ Access :attr:`~scenedetect.common.FrameTimecode.frame_num`, :attr:`~scenedetect.
141145
142146
The legacy ``framerate`` property (one word, returns ``float``) is retained as a deprecated alias and will emit a ``DeprecationWarning`` in a future release. Migrate to ``frame_rate``; cast with ``float(...)`` at the call site if you specifically need a ``float``.
143147

148+
Renamed Method: ``equal_framerate()``
149+
-----------------------------------------------------------------------
150+
151+
:meth:`~scenedetect.common.FrameTimecode.equal_framerate` has been renamed to :meth:`~scenedetect.common.FrameTimecode.equal_frame_rate` for consistency with the :attr:`~scenedetect.common.FrameTimecode.frame_rate` property. The legacy ``equal_framerate()`` method is retained as a deprecated alias and will emit a ``DeprecationWarning`` in a future release. The new form additionally accepts a ``Fraction`` or another ``FrameTimecode`` (in addition to ``float``).
152+
144153
Removed Methods
145154
-----------------------------------------------------------------------
146155

@@ -163,6 +172,19 @@ Rational Framerates
163172
assert isinstance(video.frame_rate, Fraction)
164173
# e.g. Fraction(24000, 1001) instead of 23.976023976...
165174
175+
``frame_rate`` Keyword Argument
176+
-----------------------------------------------------------------------
177+
178+
The ``framerate`` keyword argument has been renamed to ``frame_rate`` on :func:`~scenedetect.open_video` and on every backend constructor (:class:`~scenedetect.backends.opencv.VideoStreamCv2`, :class:`~scenedetect.backends.opencv.VideoCaptureAdapter`, :class:`~scenedetect.backends.pyav.VideoStreamAv`, :class:`~scenedetect.backends.moviepy.VideoStreamMoviePy`). The new form accepts ``float | Fraction | None``. The legacy ``framerate`` keyword is retained as a deprecated alias and will emit a ``DeprecationWarning`` in a future release; if both are supplied, ``frame_rate`` takes precedence.
179+
180+
.. code:: python
181+
182+
# v0.6 - will still work but will be removed in a future version
183+
video = open_video("video.mp4", framerate=30.0)
184+
185+
# v0.7
186+
video = open_video("video.mp4", frame_rate=30.0)
187+
166188
PTS-Backed Timestamps
167189
-----------------------------------------------------------------------
168190

@@ -246,6 +268,23 @@ The following deprecated APIs have been fully removed in v0.7:
246268
CLI Changes
247269
=======================================================================
248270

271+
Removed / Renamed
272+
-----------------------------------------------------------------------
273+
249274
- The ``-d``/``--min-delta-hsv`` option on ``detect-adaptive`` has been removed. Use ``-c``/``--min-content-val`` instead.
275+
- The global ``--framerate`` flag has been renamed to ``-f``/``--frame-rate`` for consistency with the API. The legacy ``--framerate`` form is retained as a hidden alias and will be removed in v0.8; if both are supplied, ``--frame-rate`` takes precedence and a warning is logged.
276+
- The ``export-html`` command has been renamed to :ref:`save-html <command-save-html>`. The legacy ``export-html`` command is retained as a deprecated alias and emits a deprecation warning when used.
277+
278+
New Commands and Options
279+
-----------------------------------------------------------------------
280+
281+
- New :ref:`save-fcp <command-save-fcp>` command exports scenes in Final Cut Pro XML format (FCP7/FCPX).
282+
- New :ref:`save-qp <command-save-qp>` command writes a QP file with scene boundary frame numbers, suitable for forcing keyframes at scene cuts in x264/x265.
283+
- New :ref:`save-html <command-save-html>` command (replaces ``export-html``).
284+
- New ``-s``/``--start-timecode`` option on :ref:`save-edl <command-save-edl>` provides a custom start timecode for generated EDLs (SMPTE ``HH:MM:SS:FF`` or 8-digit ``HHMMSSFF``).
285+
286+
Other Changes
287+
-----------------------------------------------------------------------
288+
250289
- VFR videos now work correctly with both the OpenCV and PyAV backends.
251-
- New ``save-fcp`` command for exporting scenes in Final Cut Pro XML format.
290+
- All CLI options that previously accepted only frame numbers now also accept seconds (e.g. ``0.6s``) and timecodes (e.g. ``00:00:00.600``).

scenedetect/_cli/context.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,11 @@ def _open_video_stream(
535535
)
536536
duration = self.video_stream.duration
537537
duration_str = f"{duration} ({duration.frame_num} frames)" if duration else "unknown"
538+
rate = self.video_stream.frame_rate
538539
logger.debug(f"""Video information:
539540
Backend: {type(self.video_stream).__name__}
540541
Resolution: {self.video_stream.frame_size}
541-
Frame rate: {self.video_stream.frame_rate}
542+
Frame rate: {float(rate):.3f} ({rate.numerator}/{rate.denominator})
542543
Duration: {duration_str}""")
543544

544545
except FrameRateUnavailable as ex:

0 commit comments

Comments
 (0)