Skip to content

Skip camera metadata XML instead of importing it as a timeline - #20

Merged
FedyaLight merged 1 commit into
mainfrom
fix/camera-xml-sidecars
Nov 12, 2026
Merged

FedyaLight merged 1 commit into
mainfrom
fix/camera-xml-sidecars

Conversation

@FedyaLight

Copy link
Copy Markdown
Owner

Every .xml path was imported as a timeline. Canon writes clip metadata as
XML beside each clip (CONTENTS/CLIPS001/*.XML), so selecting clips together
with their XML files stopped the whole run:

  • one XML: Timeline import: No FCP 7 XML sequence was found in A001C001_….XML..
  • two or more: Add one timeline at a time.

Folder imports already skipped these files; only paths added one by one, for
example by selecting every file of a clip in the Add Media dialog, reached
the timeline importer.

Changes:

  • An XML file is a timeline only when its root element is FCP 7 xmeml or
    fcpxml. Recognizing it reads at most 16 KiB of the file. A UTF-16 file is
    decoded to find its root: a UTF-16 project stays a timeline, so its import
    reports that it cannot be read instead of the run silently continuing
    without it. Other files that cannot be read or parsed still count as
    timelines for the same reason.
  • The pipeline's path expansion uses the same check as the CLI and the app,
    instead of its own extension test.
  • The app recognizes timeline inputs once, when they are added, and keeps
    them in its session state. Rendering the error window's "Locate media"
    button and the path fixer's "Save Fixed Copy" no longer read any file.
  • The timeline import error no longer ends with a doubled period.

Reproduced with the reporter's layout from #16 (Canon C70 MXF and Canon MP4
with their XML and MIF files, plus a recorder folder), each file selected
individually: 0.3.2 stops with Add one timeline at a time.; this branch
(together with the #16 and #17 branches) finds both pairs at the correct
offsets.

Tests:

  • camera_metadata_xml_beside_media_is_not_a_timeline fails on main.
  • xml_inputs_are_explicit_not_silent now adds the XML as a path and checks
    the message; it fails on main on the doubled period.
  • timeline_documents_are_recognized_by_root_element keeps Premiere, Resolve
    and FCPXML exports (declaration, DOCTYPE, comments, upper-case root) and
    UTF-16 projects with and without a byte order mark recognized, and Canon and
    Sony camera XML not.
  • timelines_in_other_encodings_are_reported_not_skipped: a UTF-16 project
    added beside media ends in "Cannot read timeline", not a run without it.

The encoding tests were checked by removing the UTF-16 handling: both
fail.

Validation:

  • cargo fmt --all -- --check
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo test --locked --workspace: 376 passed, 1 ignored
  • Windows was not run locally.

Every .xml path was imported as a timeline. Canon writes clip metadata as
XML beside each clip, so selecting a clip together with its XML, or two
clips' XML files, stopped the whole run with "No FCP 7 XML sequence was
found" or "Add one timeline at a time". Folder imports already skipped
these files.

An XML file is now a timeline only when its root element is FCP 7 xmeml
or fcpxml; recognizing that reads at most 16 KiB. A UTF-16 file is decoded
to find its root, so a UTF-16 project is still reported as unreadable
instead of skipped. Files that cannot be read or parsed still count as
timelines, so their import reports why. The app recognizes timeline
inputs once, when they are added, and rendering no longer reads files.

The timeline import error also lost its doubled final period.
@FedyaLight
FedyaLight merged commit e66bf0d into main Nov 12, 2026
7 checks passed
@FedyaLight
FedyaLight deleted the fix/camera-xml-sidecars branch November 12, 2026 07:29
@FedyaLight FedyaLight mentioned this pull request Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant