Skip to content

Commit c838649

Browse files
committed
[api] Add EDL, FCP7/X, and OTIO formats to scenedetect.output
Rename save-xml -> save-fcp.
1 parent 7c6d02c commit c838649

11 files changed

Lines changed: 705 additions & 376 deletions

File tree

docs/api/migration_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,4 @@ CLI Changes
203203

204204
- The ``-d``/``--min-delta-hsv`` option on ``detect-adaptive`` has been removed. Use ``-c``/``--min-content-val`` instead.
205205
- VFR videos now work correctly with both the OpenCV and PyAV backends.
206-
- New ``save-xml`` command for exporting scenes in Final Cut Pro XML format.
206+
- New ``save-fcp`` command for exporting scenes in Final Cut Pro XML format.

docs/api/output.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ Ouptut
2020

2121
.. autofunction:: scenedetect.output.write_scene_list
2222

23+
.. autofunction:: scenedetect.output.write_scene_list_edl
24+
25+
.. autofunction:: scenedetect.output.write_scene_list_fcpx
26+
27+
.. autofunction:: scenedetect.output.write_scene_list_fcp7
28+
29+
.. autofunction:: scenedetect.output.write_scene_list_otio
30+
2331
.. autoclass:: scenedetect.output.SceneMetadata
2432

2533
.. autoclass:: scenedetect.output.VideoMetadata

scenedetect.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,14 @@
345345
#disable-shift = no
346346

347347

348-
[save-xml]
348+
[save-fcp]
349349

350350
# Filename format of XML file. Can use $VIDEO_NAME macro.
351351
#filename = $VIDEO_NAME.xml
352352

353353
# Format of the XML file. Must be one of:
354354
# - fcpx: Final Cut Pro X (FCPXML, default)
355-
# - fcp: Final Cut Pro 7 (xmeml)
355+
# - fcp7: Final Cut Pro 7 (xmeml)
356356
#format = fcpx
357357

358358
# Folder to output XML file to. Overrides [global] output option.

scenedetect/_cli/__init__.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,27 +1614,27 @@ def save_qp_command(
16141614
ctx.add_command(cli_commands.save_qp, save_qp_args)
16151615

16161616

1617-
SAVE_XML_HELP = """Save cuts in Final Cut Pro XML format (FCP7 xmeml or FCPX)."""
1617+
SAVE_FCP_HELP = """Save cuts in Final Cut Pro XML format (FCP7 xmeml or FCPX)."""
16181618

16191619

1620-
@click.command("save-xml", cls=Command, help=SAVE_XML_HELP)
1620+
@click.command("save-fcp", cls=Command, help=SAVE_FCP_HELP)
16211621
@click.option(
16221622
"--filename",
16231623
"-f",
16241624
metavar="NAME",
16251625
default=None,
16261626
type=click.STRING,
1627-
help="Filename format to use.%s" % (USER_CONFIG.get_help_string("save-xml", "filename")),
1627+
help="Filename format to use.%s" % (USER_CONFIG.get_help_string("save-fcp", "filename")),
16281628
)
16291629
@click.option(
16301630
"--format",
16311631
metavar="TYPE",
1632-
type=click.Choice(CHOICE_MAP["save-xml"]["format"], False),
1632+
type=click.Choice(CHOICE_MAP["save-fcp"]["format"], False),
16331633
default=None,
16341634
help="Format to export. TYPE must be one of: %s.%s"
16351635
% (
1636-
", ".join(CHOICE_MAP["save-xml"]["format"]),
1637-
USER_CONFIG.get_help_string("save-xml", "format"),
1636+
", ".join(CHOICE_MAP["save-fcp"]["format"]),
1637+
USER_CONFIG.get_help_string("save-fcp", "format"),
16381638
),
16391639
)
16401640
@click.option(
@@ -1643,10 +1643,10 @@ def save_qp_command(
16431643
metavar="DIR",
16441644
type=click.Path(exists=False, dir_okay=True, writable=True, resolve_path=False),
16451645
help="Output directory to save XML file to. Overrides global option -o/--output.%s"
1646-
% (USER_CONFIG.get_help_string("save-xml", "output", show_default=False)),
1646+
% (USER_CONFIG.get_help_string("save-fcp", "output", show_default=False)),
16471647
)
16481648
@click.pass_context
1649-
def save_xml_command(
1649+
def save_fcp_command(
16501650
ctx: click.Context,
16511651
filename: ty.Optional[ty.AnyStr],
16521652
format: ty.Optional[ty.AnyStr],
@@ -1655,12 +1655,12 @@ def save_xml_command(
16551655
ctx = ctx.obj
16561656
assert isinstance(ctx, CliContext)
16571657

1658-
save_xml_args = {
1659-
"filename": ctx.config.get_value("save-xml", "filename", filename),
1660-
"format": ctx.config.get_value("save-xml", "format", format),
1661-
"output": ctx.config.get_value("save-xml", "output", output),
1658+
save_fcp_args = {
1659+
"filename": ctx.config.get_value("save-fcp", "filename", filename),
1660+
"format": ctx.config.get_value("save-fcp", "format", format),
1661+
"output": ctx.config.get_value("save-fcp", "output", output),
16621662
}
1663-
ctx.add_command(cli_commands.save_xml, save_xml_args)
1663+
ctx.add_command(cli_commands.save_fcp, save_fcp_args)
16641664

16651665

16661666
SAVE_OTIO_HELP = """Save cuts as an OTIO timeline.
@@ -1757,7 +1757,7 @@ def save_otio_command(
17571757
scenedetect.add_command(save_html_command)
17581758
scenedetect.add_command(save_images_command)
17591759
scenedetect.add_command(save_qp_command)
1760-
scenedetect.add_command(save_xml_command)
1760+
scenedetect.add_command(save_fcp_command)
17611761
scenedetect.add_command(save_otio_command)
17621762
scenedetect.add_command(split_video_command)
17631763

0 commit comments

Comments
 (0)