chore(interchange): bump craft-aaf and craft-timeline to craft-libs main (#5054)

* chore(interchange): bump craft-aaf and craft-timeline to craft-libs main

* fix(captions): convert between filmcraft_time::Tick and craft_captions::Tick

* fix(captions): use filmcraft_captions::Tick in ttml_language test

* fix(engine): adapt caption Tick/FrameRate to craft_captions types

* style: rustfmt
This commit is contained in:
Dylan M. Taylor authored and GitHub committed 2026-11-18 21:59:34 -05:00
1 parent 3d37c0f1f1
commit f67d38b35c
7 files changed
+56 -76

No files matched your search

Generated
+31 -58
View File
@@ -1160,11 +1160,22 @@ dependencies = [
[[package]]
name = "craft-aaf"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d"
source = "git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e#3b8e426a260695af840a2cd79a064d40778f939e"
dependencies = [
"craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)",
"craft-cfb 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)",
"craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)",
"craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)",
"craft-cfb 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)",
"craft-timeline",
"thiserror 2.0.21",
]
[[package]]
name = "craft-audio"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e#3b8e426a260695af840a2cd79a064d40778f939e"
dependencies = [
"craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)",
"log",
"thiserror 2.0.21",
]
@@ -1182,36 +1193,25 @@ dependencies = [
]
[[package]]
name = "craft-audio"
name = "craft-captions"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d"
source = "git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e#3b8e426a260695af840a2cd79a064d40778f939e"
dependencies = [
"craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)",
"log",
"craft-timeline",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)",
"thiserror 2.0.21",
]
[[package]]
name = "craft-captions"
name = "craft-cfb"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0"
dependencies = [
"craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)",
"thiserror 2.0.21",
]
source = "git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e#3b8e426a260695af840a2cd79a064d40778f939e"
[[package]]
name = "craft-cfb"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93#7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93"
[[package]]
name = "craft-cfb"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d"
[[package]]
name = "craft-control-protocol"
version = "0.1.0"
@@ -1326,17 +1326,17 @@ dependencies = [
[[package]]
name = "craft-media"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab#82062077bba679ba5236e2d1a391f02d1533cbab"
source = "git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e#3b8e426a260695af840a2cd79a064d40778f939e"
dependencies = [
"chrono",
"thiserror 2.0.21",
]
[[package]]
name = "craft-media"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d"
source = "git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab#82062077bba679ba5236e2d1a391f02d1533cbab"
dependencies = [
"chrono",
"thiserror 2.0.21",
]
@@ -1394,16 +1394,7 @@ dependencies = [
[[package]]
name = "craft-time"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0"
dependencies = [
"serde",
"thiserror 2.0.21",
]
[[package]]
name = "craft-time"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d"
source = "git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e#3b8e426a260695af840a2cd79a064d40778f939e"
dependencies = [
"serde",
"thiserror 2.0.21",
@@ -1412,22 +1403,14 @@ dependencies = [
[[package]]
name = "craft-timeline"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0"
source = "git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e#3b8e426a260695af840a2cd79a064d40778f939e"
dependencies = [
"craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)",
"craft-time",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)",
"serde",
"serde_json",
]
[[package]]
name = "craft-timeline"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d"
dependencies = [
"craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)",
]
[[package]]
name = "craft-ui"
version = "0.1.0"
@@ -1510,7 +1493,7 @@ dependencies = [
[[package]]
name = "craft-xml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0"
source = "git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e#3b8e426a260695af840a2cd79a064d40778f939e"
dependencies = [
"quick-xml 0.41.0",
"serde",
@@ -1527,16 +1510,6 @@ dependencies = [
"thiserror 2.0.21",
]
[[package]]
name = "craft-xml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d"
dependencies = [
"quick-xml 0.41.0",
"serde",
"thiserror 2.0.21",
]
[[package]]
name = "craft-y4m"
version = "0.1.0"
@@ -2596,7 +2569,7 @@ version = "0.20.1"
dependencies = [
"craft-aaf",
"craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)",
"craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)",
"craft-timeline",
"filmcraft-cfb",
"filmcraft-color",
"filmcraft-geom",
@@ -2768,7 +2741,7 @@ dependencies = [
name = "filmcraft-time"
version = "0.20.1"
dependencies = [
"craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)",
"craft-timeline",
]
[[package]]
+3 -3
View File
@@ -75,7 +75,7 @@ craft-raw = { version = "0.1.0", git = "https://github.com/storytold/craft-libs"
craft-hdr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "472462df9f1cb7316a92d1be21cdbf90e0980300" }
craft-tga = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "82062077bba679ba5236e2d1a391f02d1533cbab" }
# Shared OMF Bento container; its object model stays in FilmCraft.
craft-aaf = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b3643af6477326e840f86be78c89357f5308ba1d" }
craft-aaf = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3b8e426a260695af840a2cd79a064d40778f939e" }
craft-cfb = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93" }
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "47107f660191de2f0b425569506f4daa4faadac9" }
# The audio codecs (AAC, AC-3, FLAC, MP1/MP2, Opus) and the containers come from craft-libs. Both
@@ -85,8 +85,8 @@ craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-lib
# The video codecs (including H.264 encode, APV encode, ProRes, DNxHD / DNxHR and decoders), on the same commit as craft-media.
craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "82062077bba679ba5236e2d1a391f02d1533cbab", features = ["h264-decode", "h264-encode", "hevc-decode", "vp9-decode", "av1-decode", "vp8-decode", "mpeg2", "apv", "prores", "dnx", "threads"] }
# Exact time, EDL / ALE and the interchange report; serde for the project file's time fields.
craft-timeline = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "57288edafdc45552e30481cc649021de446abfa0", features = ["serde"] }
craft-captions = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "57288edafdc45552e30481cc649021de446abfa0" }
craft-timeline = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3b8e426a260695af840a2cd79a064d40778f939e", features = ["serde"] }
craft-captions = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3b8e426a260695af840a2cd79a064d40778f939e" }
# ui
# Shared frontend components; keep this dependency above the engine boundary.
+5 -5
View File
@@ -49,8 +49,8 @@ pub fn track_from_document(doc: &Document, id: TrackId, name: &str, format: Capt
.filter(|c| c.end > c.start)
.map(|c| Caption {
id: ClipId(alloc()),
start: c.start,
duration: c.end - c.start,
start: filmcraft_time::Tick(c.start.0),
duration: filmcraft_time::Tick((c.end - c.start).0),
text: c.text.clone(),
speaker: c.speaker.clone(),
cue_id: c.id.clone(),
@@ -63,15 +63,15 @@ pub fn track_from_document(doc: &Document, id: TrackId, name: &str, format: Capt
/// The document for a caption track (for export). `offset` is subtracted from every time (export
/// of a range starting later than zero).
pub fn document_from_track(t: &CaptionTrack, offset: Tick) -> Document {
pub fn document_from_track(t: &CaptionTrack, offset: filmcraft_time::Tick) -> Document {
Document {
cues: t
.captions
.iter()
.filter(|c| c.end() > offset)
.map(|c| Cue {
start: (c.start - offset).max(Tick::ZERO),
end: c.end() - offset,
start: craft_captions::Tick((c.start - offset).max(filmcraft_time::Tick::ZERO).0),
end: craft_captions::Tick((c.end() - offset).0),
text: c.text.clone(),
speaker: c.speaker.clone(),
id: c.cue_id.clone(),
+3 -4
View File
@@ -1,6 +1,5 @@
use filmcraft_captions::{Cue, Document, Format, WriteOptions, document_from_track, parse, track_from_document, write};
use filmcraft_captions::{Cue, Document, Format, TICKS_PER_SECOND, Tick, WriteOptions, document_from_track, parse, track_from_document, write};
use filmcraft_project::{CaptionFormat, TrackId};
use filmcraft_time::{TICKS_PER_SECOND, Tick};
fn cue() -> Cue {
Cue { start: Tick(TICKS_PER_SECOND), end: Tick(2 * TICKS_PER_SECOND), text: "Olá".into(), ..Default::default() }
@@ -22,7 +21,7 @@ fn ttml_and_dfxp_write_the_track_language() {
assert_eq!(track.language, "en", "a file with no language keeps the default");
track.language = "pt-BR".into();
for format in [Format::Ttml, Format::Dfxp] {
let doc = document_from_track(&track, Tick::ZERO);
let doc = document_from_track(&track, filmcraft_time::Tick::ZERO);
let xml = String::from_utf8(write(&doc, format, WriteOptions::default())).unwrap();
assert!(xml.contains(r#"xml:lang="pt-BR""#), "{format:?}: {xml}");
// and the language comes back on import
@@ -32,6 +31,6 @@ fn ttml_and_dfxp_write_the_track_language() {
}
// a track with no language (projects saved before tracks had one) still writes a valid tag
track.language.clear();
let xml = String::from_utf8(write(&document_from_track(&track, Tick::ZERO), Format::Ttml, WriteOptions::default())).unwrap();
let xml = String::from_utf8(write(&document_from_track(&track, filmcraft_time::Tick::ZERO), Format::Ttml, WriteOptions::default())).unwrap();
assert!(xml.contains(r#"xml:lang="en""#), "{xml}");
}
+3 -2
View File
@@ -126,7 +126,7 @@ pub fn import(s: &mut Session, path: &str, bytes: &[u8], format: Format, name: O
}
};
let rate = s.project.sequence(seq_id).map(|q| q.settings.frame_rate).unwrap_or_default();
doc.snap_to_frames(rate);
doc.snap_to_frames(filmcraft_captions::FrameRate { num: rate.num, den: rate.den });
let n = doc.cues.len();
let warnings = doc.warnings.clone();
let (tid, language) = s.edit(&format!("Import Captions {stem}"), |p, st| {
@@ -269,7 +269,8 @@ fn export(s: &mut Session, p: &Value) -> Result<Value> {
let track = seq.caption_track(tid).ok_or_else(|| bad("captions.export", "no such caption track"))?;
let doc: Document = filmcraft_captions::document_from_track(track, Tick::ZERO);
let df = bool_p(p, "dropFrame").unwrap_or(true);
let opts = filmcraft_captions::write_options(df, Some(seq.settings.frame_rate));
let opts =
filmcraft_captions::write_options(df, Some(filmcraft_captions::FrameRate { num: seq.settings.frame_rate.num, den: seq.settings.frame_rate.den }));
let bytes = filmcraft_captions::write(&doc, format, opts);
let warnings = filmcraft_captions::charset_warnings(&doc, format, opts);
let n = doc.cues.len();
+2 -2
View File
@@ -980,7 +980,7 @@ fn ranges_resolve_and_sidecar_captions_are_written() {
let srt = std::fs::read_to_string(dir.path("cap.srt")).unwrap();
// Timed from In at 1 s (the caption starts on frame 35), clipped to the export duration.
let resolved = s.execute("export.resolve", json!({"preset": "Waveform Audio 48 kHz 16-bit"})).unwrap();
let duration = filmcraft_time::Tick(resolved["range"]["duration"].as_i64().unwrap());
let duration = filmcraft_captions::Tick(resolved["range"]["duration"].as_i64().unwrap());
let timing = format!("00:00:00,460 --> {}", filmcraft_captions::format_clock(duration, ','));
assert!(srt.contains("Hello sidecar") && srt.contains(&timing), "{srt}");
s.execute("file.exportMedia", json!({"preset": "Waveform Audio 48 kHz 16-bit", "path": out, "captionSidecar": "vtt", "wait": true})).unwrap();
@@ -1084,7 +1084,7 @@ fn caption_sidecars_keep_only_the_exported_interval() {
let (mut s, files) = session(fixture);
let original = serde_json::to_value(&s.project).unwrap();
let history = s.execute("history.list", json!({})).unwrap();
let ticks = |tenths: i64| Tick(tenths * (TICKS_PER_SECOND / 10));
let ticks = |tenths: i64| filmcraft_captions::Tick(tenths * (TICKS_PER_SECOND / 10));
let expected = [(ticks(0), ticks(4), "Crossing In"), (ticks(10), ticks(20), "Inside"), (ticks(26), ticks(30), "Crossing Out")];
for format in [Format::Srt, Format::WebVtt] {
for range in [json!({"range":"custom", "startTime":2 * TICKS_PER_SECOND, "endTime":5 * TICKS_PER_SECOND}), json!({"range":"inOut"}), json!({})] {
+9 -2
View File
@@ -491,10 +491,17 @@ fn write_sidecar(s: &Session, project: &Project, seq: ItemId, settings: &ExportS
let range = filmcraft_export::export_range(project, seq, settings).map_err(|e| EngineError::Other(e.to_string()))?;
let mut doc = filmcraft_captions::document_from_track(track, range.start);
doc.cues.retain_mut(|cue| {
cue.end = cue.end.min(range.duration);
cue.end = cue.end.min(filmcraft_captions::Tick(range.duration.0));
cue.start < cue.end
});
let bytes = filmcraft_captions::write(&doc, format, filmcraft_captions::write_options(q.settings.drop_frame, Some(q.settings.frame_rate)));
let bytes = filmcraft_captions::write(
&doc,
format,
filmcraft_captions::write_options(
q.settings.drop_frame,
Some(filmcraft_captions::FrameRate { num: q.settings.frame_rate.num, den: q.settings.frame_rate.den }),
),
);
let ext = if format == filmcraft_captions::Format::WebVtt { "vtt" } else { kind };
let path = format!("{}.{ext}", settings.path.rsplit_once('.').map_or(settings.path.as_str(), |x| x.0));
s.services.write_file(&path, &bytes).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;