#756: import DPX and Cineon stills and sequences
Problem: the Media Browser listed .dpx files and After Effects imports DPX and Cineon scans (stills and numbered sequences), but import refused them: nothing could decode either format, and .cin was not even an image to the browser, so its runs never grouped into sequences. Fix: a small pure-Rust reader written from the public SMPTE 268M and Kodak Cineon specifications (crates/media/src/dpx.rs): luma, RGB, RGBA and ABGR at 8/10/12/16 bits, 10-bit filled method A/B, 12-bit in 16-bit words, both byte orders, lines padded to 32-bit words, unrotated orientations and the pixel aspect ratio; the codec names the transfer (log, linear, ...) and code values are shown as stored. RLE, signed, float, Y'CbCr, packed 10/12-bit and transposed files are refused with a clear error; every header field is bounds-checked and the data length verified before allocating. Probe and frame decode use it first; is_importable, the Media Browser kinds and the import dialog list .dpx/.cin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9a7d3e7699
commit
557c0bdbba
@@ -195,3 +195,15 @@ fn replace_footage_and_reload_keep_sequences() {
|
||||
assert_eq!((f.sequence.len(), f.frame_rate, f.start_timecode), (5, FrameRate::from_f64(12.0), Some(2)));
|
||||
assert_eq!(f.duration, FrameRate::from_f64(12.0).tick_of(5));
|
||||
}
|
||||
|
||||
/// #756: numbered DPX and Cineon scans import as sequences, as in After Effects (`.cin` was not
|
||||
/// an image to the Media Browser, so its runs came in one file at a time).
|
||||
#[test]
|
||||
fn dpx_and_cineon_runs_import_as_sequences() {
|
||||
let dir = folder(&["plate.0001.dpx", "plate.0002.dpx", "plate.0003.dpx", "scan_01.cin", "scan_02.cin"]);
|
||||
let mut s = session();
|
||||
let r = s.execute("file.import", json!({"paths": [at(&dir, "plate.0002.dpx"), at(&dir, "scan_01.cin")], "sequence": true})).unwrap();
|
||||
let mut got: Vec<(String, usize)> = r["items"].as_array().unwrap().iter().map(|i| footage(&s, i)).map(|(n, f)| (n, f.sequence.len())).collect();
|
||||
got.sort();
|
||||
assert_eq!(got, [("plate.[0001-0003].dpx".to_string(), 3), ("scan_[01-02].cin".to_string(), 2)], "{r}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user