CLI: --format hevc / av1 write HEVC / AV1; an unknown comp is named (#154, #155)

#154: renderQueue.add (and render.addOutputModule) applied `format`, then
dropped it before applying the output path, so `--format hevc --out
x.mp4` saw the .mp4 extension and switched the module back to H.264
(and ProRes / VP9 for .mov / .webm). An explicit format now wins and a
mismatched extension follows it (x.webm → x.mp4 for AV1), as choosing a
format in the Output Module renames Output To; an extension that agrees
with the format keeps the name as given. The format error lists hevc and
av1 everywhere (one FORMATS string).

#155: a `comp` that names no composition (name or id) failed with "no
active composition". comp_id now reports it as `no composition "Nope"`
(EngineError::NoSuchComp), and comp_for_queue passes that on instead of
collapsing it.

Tests: an_explicit_format_wins_over_the_output_extension and
an_unknown_comp_is_named_in_the_error (engine). Checked with the CLI:
the files are hevc/hvc1 and av1/av01 and decode cleanly with ffmpeg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-07 12:28:12 +07:00
co-authored by Claude Opus 5.5
parent 21c0d33597
commit c4f8e50201
5 changed files with 77 additions and 28 deletions
+3 -3
View File
@@ -640,11 +640,11 @@ impl Session {
}
/// The comp to add: `comp` param, the active comp, or the first comp selected in the Project panel.
pub(crate) fn comp_for_queue(&self, p: &serde_json::Value) -> Option<ItemId> {
pub(crate) fn comp_for_queue(&self, p: &serde_json::Value) -> crate::Result<ItemId> {
if p.get("comp").is_some() {
return crate::commands::comp_id(self, p).ok();
return crate::commands::comp_id(self, p);
}
let sel = self.state.project_selection.iter().copied().find(|i| self.project.comp(*i).is_some());
self.active_comp_id().or(sel)
self.active_comp_id().or(sel).ok_or(crate::EngineError::NoComp)
}
}