automovie 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -139
- package/lib/AUTOMOVIE_CAPTURE_OPTIONS.d.ts +5 -2
- package/lib/AUTOMOVIE_CAPTURE_OPTIONS.js +6 -2
- package/lib/AUTOMOVIE_CAPTURE_OPTIONS.js.map +1 -1
- package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.d.ts +3 -1
- package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.js +3 -1
- package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.js.map +1 -1
- package/lib/AUTOMOVIE_INSPECT_OPTIONS.d.ts +5 -2
- package/lib/AUTOMOVIE_INSPECT_OPTIONS.js +5 -2
- package/lib/AUTOMOVIE_INSPECT_OPTIONS.js.map +1 -1
- package/lib/AUTOMOVIE_RENDER_OPTIONS.d.ts +6 -2
- package/lib/AUTOMOVIE_RENDER_OPTIONS.js +8 -2
- package/lib/AUTOMOVIE_RENDER_OPTIONS.js.map +1 -1
- package/lib/AUTOMOVIE_REVIEW_OPTIONS.d.ts +3 -1
- package/lib/AUTOMOVIE_REVIEW_OPTIONS.js +12 -1
- package/lib/AUTOMOVIE_REVIEW_OPTIONS.js.map +1 -1
- package/lib/AutoMovieCaptureBackend.d.ts +4 -6
- package/lib/AutoMovieCaptureHost.d.ts +73 -53
- package/lib/AutoMovieCaptureHost.js +89 -56
- package/lib/AutoMovieCaptureHost.js.map +1 -1
- package/lib/AutoMovieCommand.d.ts +69 -20
- package/lib/AutoMovieFfmpegStaticPath.d.ts +6 -0
- package/lib/AutoMovieFfmpegStaticPath.js +3 -0
- package/lib/AutoMovieFfmpegStaticPath.js.map +1 -0
- package/lib/AutoMovieMp4Boxes.d.ts +78 -0
- package/lib/AutoMovieMp4Boxes.js +227 -0
- package/lib/AutoMovieMp4Boxes.js.map +1 -0
- package/lib/AutoMovieRenderOutputReservation.d.ts +18 -0
- package/lib/AutoMovieRenderOutputReservation.js +118 -0
- package/lib/AutoMovieRenderOutputReservation.js.map +1 -0
- package/lib/IAutoMovieChromium.d.ts +13 -57
- package/lib/IAutoMovieDeliveryAudioTrack.d.ts +17 -0
- package/lib/IAutoMovieDeliveryAudioTrack.js +3 -0
- package/lib/IAutoMovieDeliveryAudioTrack.js.map +1 -0
- package/lib/IAutoMovieDeliveryProfileFinding.d.ts +21 -0
- package/lib/IAutoMovieDeliveryProfileFinding.js +3 -0
- package/lib/IAutoMovieDeliveryProfileFinding.js.map +1 -0
- package/lib/IAutoMovieFfmpegSources.d.ts +11 -0
- package/lib/IAutoMovieFfmpegSources.js +3 -0
- package/lib/IAutoMovieFfmpegSources.js.map +1 -0
- package/lib/IAutoMovieReviewObservation.d.ts +66 -0
- package/lib/IAutoMovieReviewObservation.js +3 -0
- package/lib/IAutoMovieReviewObservation.js.map +1 -0
- package/lib/IAutoMovieVerification.d.ts +163 -0
- package/lib/IAutoMovieVerification.js +3 -0
- package/lib/IAutoMovieVerification.js.map +1 -0
- package/lib/auditAutoMovieAlphaSamples.d.ts +23 -0
- package/lib/auditAutoMovieAlphaSamples.js +183 -0
- package/lib/auditAutoMovieAlphaSamples.js.map +1 -0
- package/lib/auditAutoMovieDeliveryProfile.d.ts +33 -0
- package/lib/auditAutoMovieDeliveryProfile.js +93 -0
- package/lib/auditAutoMovieDeliveryProfile.js.map +1 -0
- package/lib/captureAutoMovie.d.ts +23 -11
- package/lib/captureAutoMovie.js +102 -18
- package/lib/captureAutoMovie.js.map +1 -1
- package/lib/createAutoMovieDeliveryAudioLog.d.ts +31 -0
- package/lib/createAutoMovieDeliveryAudioLog.js +110 -0
- package/lib/createAutoMovieDeliveryAudioLog.js.map +1 -0
- package/lib/createAutoMovieDeliveryAudioScan.d.ts +39 -0
- package/lib/createAutoMovieDeliveryAudioScan.js +125 -0
- package/lib/createAutoMovieDeliveryAudioScan.js.map +1 -0
- package/lib/createAutoMovieVerificationInputScope.d.ts +19 -0
- package/lib/createAutoMovieVerificationInputScope.js +147 -0
- package/lib/createAutoMovieVerificationInputScope.js.map +1 -0
- package/lib/createAutoMovieVerificationMediaHash.d.ts +5 -0
- package/lib/createAutoMovieVerificationMediaHash.js +61 -0
- package/lib/createAutoMovieVerificationMediaHash.js.map +1 -0
- package/lib/decodeAutoMovieDeliveryAudio.d.ts +24 -0
- package/lib/decodeAutoMovieDeliveryAudio.js +77 -0
- package/lib/decodeAutoMovieDeliveryAudio.js.map +1 -0
- package/lib/deriveAutoMovieProjectName.d.ts +14 -11
- package/lib/deriveAutoMovieProjectName.js +14 -11
- package/lib/deriveAutoMovieProjectName.js.map +1 -1
- package/lib/findAutoMovieFreePort.d.ts +5 -10
- package/lib/findAutoMovieFreePort.js +5 -10
- package/lib/findAutoMovieFreePort.js.map +1 -1
- package/lib/formatAutoMovieInspectUrl.d.ts +6 -10
- package/lib/formatAutoMovieInspectUrl.js +6 -10
- package/lib/formatAutoMovieInspectUrl.js.map +1 -1
- package/lib/hashAutoMovieFile.d.ts +5 -0
- package/lib/hashAutoMovieFile.js +16 -0
- package/lib/hashAutoMovieFile.js.map +1 -0
- package/lib/importAutoMovieVerificationEntry.d.mts +2 -0
- package/lib/importAutoMovieVerificationEntry.mjs +6 -0
- package/lib/importAutoMovieVerificationEntry.mjs.map +1 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -1
- package/lib/inspectAutoMovie.d.ts +15 -9
- package/lib/inspectAutoMovie.js +25 -9
- package/lib/inspectAutoMovie.js.map +1 -1
- package/lib/inspectAutoMovieVerificationCapture.d.ts +15 -0
- package/lib/inspectAutoMovieVerificationCapture.js +221 -0
- package/lib/inspectAutoMovieVerificationCapture.js.map +1 -0
- package/lib/inspectAutoMovieVerificationDelivery.d.ts +13 -0
- package/lib/inspectAutoMovieVerificationDelivery.js +247 -0
- package/lib/inspectAutoMovieVerificationDelivery.js.map +1 -0
- package/lib/inspectAutoMovieVerificationReview.d.ts +11 -0
- package/lib/inspectAutoMovieVerificationReview.js +141 -0
- package/lib/inspectAutoMovieVerificationReview.js.map +1 -0
- package/lib/launchAutoMovieChromium.d.ts +9 -11
- package/lib/launchAutoMovieChromium.js +10 -11
- package/lib/launchAutoMovieChromium.js.map +1 -1
- package/lib/listAutoMovieReleaseFindings.d.ts +9 -0
- package/lib/listAutoMovieReleaseFindings.js +58 -0
- package/lib/listAutoMovieReleaseFindings.js.map +1 -0
- package/lib/loadAutoMovieProductionModule.d.ts +11 -10
- package/lib/loadAutoMovieProductionModule.js +18 -10
- package/lib/loadAutoMovieProductionModule.js.map +1 -1
- package/lib/loadAutoMovieVerificationModule.d.ts +6 -0
- package/lib/loadAutoMovieVerificationModule.js +246 -0
- package/lib/loadAutoMovieVerificationModule.js.map +1 -0
- package/lib/planAutoMovieChromiumLaunch.d.ts +7 -13
- package/lib/planAutoMovieChromiumLaunch.js +7 -13
- package/lib/planAutoMovieChromiumLaunch.js.map +1 -1
- package/lib/planAutoMovieDeliveryAudioDecode.d.ts +10 -0
- package/lib/planAutoMovieDeliveryAudioDecode.js +29 -0
- package/lib/planAutoMovieDeliveryAudioDecode.js.map +1 -0
- package/lib/planAutoMovieDeliveryDecode.d.ts +19 -0
- package/lib/planAutoMovieDeliveryDecode.js +57 -0
- package/lib/planAutoMovieDeliveryDecode.js.map +1 -0
- package/lib/planAutoMovieDeliveryInput.d.ts +11 -0
- package/lib/planAutoMovieDeliveryInput.js +26 -0
- package/lib/planAutoMovieDeliveryInput.js.map +1 -0
- package/lib/planAutoMovieModulePageViteConfig.d.ts +13 -10
- package/lib/planAutoMovieModulePageViteConfig.js +13 -10
- package/lib/planAutoMovieModulePageViteConfig.js.map +1 -1
- package/lib/promptAutoMovieProjectName.d.ts +6 -10
- package/lib/promptAutoMovieProjectName.js +6 -10
- package/lib/promptAutoMovieProjectName.js.map +1 -1
- package/lib/publishAutoMovieRenderAttempt.d.ts +32 -0
- package/lib/publishAutoMovieRenderAttempt.js +91 -0
- package/lib/publishAutoMovieRenderAttempt.js.map +1 -0
- package/lib/readAutoMovieAddArguments.d.ts +10 -11
- package/lib/readAutoMovieAddArguments.js +10 -11
- package/lib/readAutoMovieAddArguments.js.map +1 -1
- package/lib/readAutoMovieCaptureHostOptions.d.ts +19 -17
- package/lib/readAutoMovieCaptureHostOptions.js +16 -17
- package/lib/readAutoMovieCaptureHostOptions.js.map +1 -1
- package/lib/readAutoMovieCommandArguments.d.ts +6 -9
- package/lib/readAutoMovieCommandArguments.js +9 -10
- package/lib/readAutoMovieCommandArguments.js.map +1 -1
- package/lib/readAutoMovieCreateArguments.d.ts +7 -11
- package/lib/readAutoMovieCreateArguments.js +7 -11
- package/lib/readAutoMovieCreateArguments.js.map +1 -1
- package/lib/readAutoMovieDeliveryAudioTrack.d.ts +21 -0
- package/lib/readAutoMovieDeliveryAudioTrack.js +104 -0
- package/lib/readAutoMovieDeliveryAudioTrack.js.map +1 -0
- package/lib/readAutoMovieDeliveryDecode.d.ts +19 -0
- package/lib/readAutoMovieDeliveryDecode.js +209 -0
- package/lib/readAutoMovieDeliveryDecode.js.map +1 -0
- package/lib/readAutoMovieDeliveryProbe.d.ts +35 -0
- package/lib/readAutoMovieDeliveryProbe.js +363 -0
- package/lib/readAutoMovieDeliveryProbe.js.map +1 -0
- package/lib/readAutoMovieErrorCode.d.ts +9 -0
- package/lib/readAutoMovieErrorCode.js +18 -0
- package/lib/readAutoMovieErrorCode.js.map +1 -0
- package/lib/readAutoMovieInspectHostOptions.d.ts +15 -16
- package/lib/readAutoMovieInspectHostOptions.js +11 -15
- package/lib/readAutoMovieInspectHostOptions.js.map +1 -1
- package/lib/readAutoMovieNameOption.d.ts +4 -10
- package/lib/readAutoMovieNameOption.js +4 -10
- package/lib/readAutoMovieNameOption.js.map +1 -1
- package/lib/readAutoMoviePageTimeout.d.ts +13 -0
- package/lib/readAutoMoviePageTimeout.js +21 -0
- package/lib/readAutoMoviePageTimeout.js.map +1 -0
- package/lib/readAutoMovieRenderOptions.d.ts +24 -16
- package/lib/readAutoMovieRenderOptions.js +23 -16
- package/lib/readAutoMovieRenderOptions.js.map +1 -1
- package/lib/readAutoMovieReviewObservation.d.ts +6 -0
- package/lib/readAutoMovieReviewObservation.js +108 -0
- package/lib/readAutoMovieReviewObservation.js.map +1 -0
- package/lib/readAutoMovieReviewOptions.d.ts +32 -24
- package/lib/readAutoMovieReviewOptions.js +82 -18
- package/lib/readAutoMovieReviewOptions.js.map +1 -1
- package/lib/readAutoMovieRevision.d.ts +3 -9
- package/lib/readAutoMovieRevision.js +3 -9
- package/lib/readAutoMovieRevision.js.map +1 -1
- package/lib/readAutoMovieVerifyOptions.d.ts +17 -0
- package/lib/readAutoMovieVerifyOptions.js +45 -0
- package/lib/readAutoMovieVerifyOptions.js.map +1 -0
- package/lib/readAutoMovieVideoProbe.d.ts +6 -10
- package/lib/readAutoMovieVideoProbe.js +20 -13
- package/lib/readAutoMovieVideoProbe.js.map +1 -1
- package/lib/recordAutoMoviePlayback.d.ts +18 -11
- package/lib/recordAutoMoviePlayback.js +26 -13
- package/lib/recordAutoMoviePlayback.js.map +1 -1
- package/lib/renderAutoMovie.d.ts +16 -10
- package/lib/renderAutoMovie.js +31 -14
- package/lib/renderAutoMovie.js.map +1 -1
- package/lib/renderAutoMovieScaffoldNextSteps.d.ts +10 -10
- package/lib/renderAutoMovieScaffoldNextSteps.js +10 -10
- package/lib/renderAutoMovieVideo.d.ts +53 -15
- package/lib/renderAutoMovieVideo.js +290 -45
- package/lib/renderAutoMovieVideo.js.map +1 -1
- package/lib/resolveAutoMovieFfmpeg.d.ts +12 -15
- package/lib/resolveAutoMovieFfmpeg.js +12 -17
- package/lib/resolveAutoMovieFfmpeg.js.map +1 -1
- package/lib/reviewAutoMovie.d.ts +10 -10
- package/lib/reviewAutoMovie.js +15 -10
- package/lib/reviewAutoMovie.js.map +1 -1
- package/lib/reviewAutoMovieFile.d.ts +21 -0
- package/lib/reviewAutoMovieFile.js +378 -0
- package/lib/reviewAutoMovieFile.js.map +1 -0
- package/lib/run.d.ts +32 -18
- package/lib/run.js +67 -23
- package/lib/run.js.map +1 -1
- package/lib/runAutoMovieDeliveryAudioDecode.d.ts +18 -0
- package/lib/runAutoMovieDeliveryAudioDecode.js +28 -0
- package/lib/runAutoMovieDeliveryAudioDecode.js.map +1 -0
- package/lib/runAutoMovieDeliveryDecode.d.ts +19 -0
- package/lib/runAutoMovieDeliveryDecode.js +42 -0
- package/lib/runAutoMovieDeliveryDecode.js.map +1 -0
- package/lib/runAutoMovieDeliveryReferenceDecode.d.ts +28 -0
- package/lib/runAutoMovieDeliveryReferenceDecode.js +77 -0
- package/lib/runAutoMovieDeliveryReferenceDecode.js.map +1 -0
- package/lib/runAutoMovieDeliverySourceAudioDecode.d.ts +20 -0
- package/lib/runAutoMovieDeliverySourceAudioDecode.js +56 -0
- package/lib/runAutoMovieDeliverySourceAudioDecode.js.map +1 -0
- package/lib/runAutoMovieFfmpeg.d.ts +15 -10
- package/lib/runAutoMovieFfmpeg.js +36 -13
- package/lib/runAutoMovieFfmpeg.js.map +1 -1
- package/lib/runAutoMovieVerification.d.ts +28 -0
- package/lib/runAutoMovieVerification.js +393 -0
- package/lib/runAutoMovieVerification.js.map +1 -0
- package/lib/sameAutoMovieReviewFile.d.ts +2 -0
- package/lib/sameAutoMovieReviewFile.js +57 -0
- package/lib/sameAutoMovieReviewFile.js.map +1 -0
- package/lib/selectAutoMovieProjectName.d.ts +8 -11
- package/lib/selectAutoMovieProjectName.js +8 -11
- package/lib/selectAutoMovieProjectName.js.map +1 -1
- package/lib/serveAutoMovieDrawPage.d.ts +14 -11
- package/lib/serveAutoMovieDrawPage.js +14 -11
- package/lib/serveAutoMovieDrawPage.js.map +1 -1
- package/lib/serveAutoMovieInspectorPage.d.ts +4 -8
- package/lib/serveAutoMovieInspectorPage.js +3 -9
- package/lib/serveAutoMovieInspectorPage.js.map +1 -1
- package/lib/verifyAutoMovie.d.ts +19 -0
- package/lib/verifyAutoMovie.js +44 -0
- package/lib/verifyAutoMovie.js.map +1 -0
- package/lib/writeAutoMovieModulePage.d.ts +17 -12
- package/lib/writeAutoMovieModulePage.js +13 -11
- package/lib/writeAutoMovieModulePage.js.map +1 -1
- package/lib/writeAutoMovieVerificationReceipt.d.ts +2 -0
- package/lib/writeAutoMovieVerificationReceipt.js +75 -0
- package/lib/writeAutoMovieVerificationReceipt.js.map +1 -0
- package/package.json +8 -8
- package/src/AUTOMOVIE_CAPTURE_OPTIONS.ts +6 -2
- package/src/AUTOMOVIE_DEFAULT_PROJECT_NAME.ts +3 -1
- package/src/AUTOMOVIE_INSPECT_OPTIONS.ts +5 -2
- package/src/AUTOMOVIE_RENDER_OPTIONS.ts +8 -2
- package/src/AUTOMOVIE_REVIEW_OPTIONS.ts +12 -1
- package/src/AutoMovieCaptureBackend.ts +4 -6
- package/src/AutoMovieCaptureHost.ts +122 -68
- package/src/AutoMovieCommand.ts +71 -20
- package/src/AutoMovieFfmpegStaticPath.ts +7 -0
- package/src/AutoMovieMp4Boxes.ts +263 -0
- package/src/AutoMovieRenderOutputReservation.ts +97 -0
- package/src/IAutoMovieChromium.ts +13 -57
- package/src/IAutoMovieDeliveryAudioTrack.ts +19 -0
- package/src/IAutoMovieDeliveryProfileFinding.ts +24 -0
- package/src/IAutoMovieFfmpegSources.ts +13 -0
- package/src/IAutoMovieReviewObservation.ts +59 -0
- package/src/IAutoMovieVerification.ts +207 -0
- package/src/auditAutoMovieAlphaSamples.ts +201 -0
- package/src/auditAutoMovieDeliveryProfile.ts +125 -0
- package/src/captureAutoMovie.ts +137 -28
- package/src/createAutoMovieDeliveryAudioLog.ts +141 -0
- package/src/createAutoMovieDeliveryAudioScan.ts +150 -0
- package/src/createAutoMovieVerificationInputScope.ts +156 -0
- package/src/createAutoMovieVerificationMediaHash.ts +32 -0
- package/src/decodeAutoMovieDeliveryAudio.ts +95 -0
- package/src/deriveAutoMovieProjectName.ts +14 -11
- package/src/findAutoMovieFreePort.ts +5 -10
- package/src/formatAutoMovieInspectUrl.ts +6 -10
- package/src/hashAutoMovieFile.ts +12 -0
- package/src/importAutoMovieVerificationEntry.mts +6 -0
- package/src/index.ts +9 -0
- package/src/inspectAutoMovie.ts +28 -11
- package/src/inspectAutoMovieVerificationCapture.ts +292 -0
- package/src/inspectAutoMovieVerificationDelivery.ts +301 -0
- package/src/inspectAutoMovieVerificationReview.ts +130 -0
- package/src/launchAutoMovieChromium.ts +14 -12
- package/src/listAutoMovieReleaseFindings.ts +87 -0
- package/src/loadAutoMovieProductionModule.ts +22 -15
- package/src/loadAutoMovieVerificationModule.ts +278 -0
- package/src/planAutoMovieChromiumLaunch.ts +7 -13
- package/src/planAutoMovieDeliveryAudioDecode.ts +26 -0
- package/src/planAutoMovieDeliveryDecode.ts +66 -0
- package/src/planAutoMovieDeliveryInput.ts +25 -0
- package/src/planAutoMovieModulePageViteConfig.ts +13 -10
- package/src/promptAutoMovieProjectName.ts +6 -10
- package/src/publishAutoMovieRenderAttempt.ts +89 -0
- package/src/readAutoMovieAddArguments.ts +10 -11
- package/src/readAutoMovieCaptureHostOptions.ts +22 -17
- package/src/readAutoMovieCommandArguments.ts +8 -10
- package/src/readAutoMovieCreateArguments.ts +7 -11
- package/src/readAutoMovieDeliveryAudioTrack.ts +137 -0
- package/src/readAutoMovieDeliveryDecode.ts +269 -0
- package/src/readAutoMovieDeliveryProbe.ts +499 -0
- package/src/readAutoMovieErrorCode.ts +13 -0
- package/src/readAutoMovieInspectHostOptions.ts +15 -16
- package/src/readAutoMovieNameOption.ts +4 -10
- package/src/readAutoMoviePageTimeout.ts +19 -0
- package/src/readAutoMovieRenderOptions.ts +34 -16
- package/src/readAutoMovieReviewObservation.ts +146 -0
- package/src/readAutoMovieReviewOptions.ts +133 -28
- package/src/readAutoMovieRevision.ts +3 -9
- package/src/readAutoMovieVerifyOptions.ts +50 -0
- package/src/readAutoMovieVideoProbe.ts +24 -13
- package/src/recordAutoMoviePlayback.ts +26 -13
- package/src/renderAutoMovie.ts +38 -17
- package/src/renderAutoMovieScaffoldNextSteps.ts +10 -10
- package/src/renderAutoMovieVideo.ts +474 -85
- package/src/resolveAutoMovieFfmpeg.ts +17 -24
- package/src/reviewAutoMovie.ts +21 -16
- package/src/reviewAutoMovieFile.ts +479 -0
- package/src/run.ts +75 -25
- package/src/runAutoMovieDeliveryAudioDecode.ts +45 -0
- package/src/runAutoMovieDeliveryDecode.ts +63 -0
- package/src/runAutoMovieDeliveryReferenceDecode.ts +107 -0
- package/src/runAutoMovieDeliverySourceAudioDecode.ts +71 -0
- package/src/runAutoMovieFfmpeg.ts +48 -14
- package/src/runAutoMovieVerification.ts +487 -0
- package/src/sameAutoMovieReviewFile.ts +23 -0
- package/src/selectAutoMovieProjectName.ts +8 -11
- package/src/serveAutoMovieDrawPage.ts +16 -12
- package/src/serveAutoMovieInspectorPage.ts +6 -9
- package/src/verifyAutoMovie.ts +67 -0
- package/src/writeAutoMovieModulePage.ts +17 -12
- package/src/writeAutoMovieVerificationReceipt.ts +51 -0
|
@@ -1,14 +1,126 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IAutoMovieControlRecord,
|
|
3
|
+
IAutoMovieDeliveryContentAudit,
|
|
4
|
+
IAutoMovieDialogueLipSync,
|
|
5
|
+
IAutoMovieDrawnVideoResult,
|
|
6
|
+
} from "@automovie/interface";
|
|
1
7
|
import type * as Render from "@automovie/render";
|
|
8
|
+
import { createHash } from "node:crypto";
|
|
9
|
+
import { createReadStream } from "node:fs";
|
|
2
10
|
import * as fs from "node:fs/promises";
|
|
3
11
|
import * as path from "node:path";
|
|
4
12
|
|
|
5
13
|
import type { AutoMovieCaptureHost } from "./AutoMovieCaptureHost";
|
|
14
|
+
import { AutoMovieRenderOutputReservation } from "./AutoMovieRenderOutputReservation";
|
|
15
|
+
import type { IAutoMovieDeliveryProfileFinding } from "./IAutoMovieDeliveryProfileFinding";
|
|
16
|
+
import { auditAutoMovieAlphaSamples } from "./auditAutoMovieAlphaSamples";
|
|
17
|
+
import { auditAutoMovieDeliveryProfile } from "./auditAutoMovieDeliveryProfile";
|
|
18
|
+
import { listAutoMovieReleaseFindings } from "./listAutoMovieReleaseFindings";
|
|
19
|
+
import { publishAutoMovieRenderAttempt } from "./publishAutoMovieRenderAttempt";
|
|
6
20
|
import { readAutoMovieRevision } from "./readAutoMovieRevision";
|
|
21
|
+
import { runAutoMovieDeliveryDecode } from "./runAutoMovieDeliveryDecode";
|
|
22
|
+
import { runAutoMovieDeliveryReferenceDecode } from "./runAutoMovieDeliveryReferenceDecode";
|
|
7
23
|
import { runAutoMovieFfmpeg } from "./runAutoMovieFfmpeg";
|
|
8
24
|
|
|
25
|
+
type DeliveryAudit = IAutoMovieDeliveryContentAudit.IResult;
|
|
26
|
+
|
|
27
|
+
/** The render operations this host needs from a production's draw session. */
|
|
28
|
+
interface IDeliveryHost {
|
|
29
|
+
render: Pick<
|
|
30
|
+
typeof Render,
|
|
31
|
+
| "renderAutoMovieDrawnVideo"
|
|
32
|
+
| "auditAutoMovieDeliveryContent"
|
|
33
|
+
| "createAutoMovieLoudnessMeter"
|
|
34
|
+
| "AUTOMOVIE_MP4_SRGB_COLOUR"
|
|
35
|
+
| "assertProductionAacProfile"
|
|
36
|
+
| "assertProductionVideoProfile"
|
|
37
|
+
| "resolveProductionVideoProfile"
|
|
38
|
+
>;
|
|
39
|
+
session(
|
|
40
|
+
props: Parameters<AutoMovieCaptureHost["session"]>[0],
|
|
41
|
+
): Promise<
|
|
42
|
+
Pick<
|
|
43
|
+
Render.AutoMovieDrawSession,
|
|
44
|
+
"backend" | "close" | "frame" | "speak" | "subject"
|
|
45
|
+
>
|
|
46
|
+
>;
|
|
47
|
+
}
|
|
48
|
+
|
|
9
49
|
/**
|
|
10
|
-
*
|
|
50
|
+
* Scene and encoded evidence from a single release attempt on the output
|
|
51
|
+
* directory.
|
|
11
52
|
*/
|
|
53
|
+
interface IDeliveryReport {
|
|
54
|
+
/** The rendered subject's name. */
|
|
55
|
+
subject: string;
|
|
56
|
+
|
|
57
|
+
/** The production's source revision, as `readAutoMovieRevision` reads it. */
|
|
58
|
+
revision: ReturnType<typeof readAutoMovieRevision>;
|
|
59
|
+
|
|
60
|
+
/** The draw session's backend. */
|
|
61
|
+
backend: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* `published` when the film beside the report is this attempt's, `blocked`
|
|
65
|
+
* when an audit refused it, `failed` when a phase threw.
|
|
66
|
+
*/
|
|
67
|
+
status: "published" | "blocked" | "failed";
|
|
68
|
+
|
|
69
|
+
/** The file this attempt published beside the report; null unless published. */
|
|
70
|
+
video: "film.mp4" | "film.mov" | null;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Present for a transparent render: its `film.mov` is a layer with straight
|
|
74
|
+
* alpha and writes no audio track, because the film it is composited into
|
|
75
|
+
* keeps the soundtrack.
|
|
76
|
+
*/
|
|
77
|
+
layer?: { background: "transparent"; audio: "none" };
|
|
78
|
+
|
|
79
|
+
/** The FFmpeg arguments of the encode; empty until drawing finished. */
|
|
80
|
+
args: readonly string[];
|
|
81
|
+
|
|
82
|
+
/** Each drawn frame's index, film second and pixel hash. */
|
|
83
|
+
frames: Pick<
|
|
84
|
+
IAutoMovieDrawnVideoResult["frames"][number],
|
|
85
|
+
"index" | "seconds" | "hash"
|
|
86
|
+
>[];
|
|
87
|
+
|
|
88
|
+
/** The scene inspection over every drawn frame; null until drawing finished. */
|
|
89
|
+
diagnostics: IAutoMovieDrawnVideoResult["diagnostics"] | null;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The soundtrack mixed from the subject's sound list: its digest, each line's
|
|
93
|
+
* PCM digest and the master's measurements.
|
|
94
|
+
*/
|
|
95
|
+
sound: IAutoMovieDrawnVideoResult["sound"] | null;
|
|
96
|
+
/**
|
|
97
|
+
* The film's cut, one row per sequence entry with the output frames it is
|
|
98
|
+
* live in; absent when the subject supplied no cut. It describes the
|
|
99
|
+
* `film.mp4` beside this report only when `status` is `published` and
|
|
100
|
+
* `source.sha256` is that file's digest.
|
|
101
|
+
*/
|
|
102
|
+
cut?: IAutoMovieDrawnVideoResult["cut"];
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The content audit of the decoded file against the drawn frames and the
|
|
106
|
+
* encoded soundtrack; null until the audit ran.
|
|
107
|
+
*/
|
|
108
|
+
delivery: DeliveryAudit | null;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* How the encoded file differs from its video and audio profiles; empty when
|
|
112
|
+
* it conforms, null when not checked.
|
|
113
|
+
*/
|
|
114
|
+
profile: IAutoMovieDeliveryProfileFinding[] | null;
|
|
115
|
+
|
|
116
|
+
/** The staged encoded file and its SHA-256; null until the audit ran. */
|
|
117
|
+
source: IAutoMovieDeliveryContentAudit.ISource | null;
|
|
118
|
+
|
|
119
|
+
/** The phase that blocked or failed and its message; absent when published. */
|
|
120
|
+
failure?: { phase: string; message: string };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Delivery encoding uses the drawn subject's own clock and raster. */
|
|
12
124
|
const SPEC: Parameters<typeof Render.renderAutoMovieDrawnVideo>[0]["spec"] = {
|
|
13
125
|
target: "production",
|
|
14
126
|
toneMapping: "none",
|
|
@@ -18,110 +130,387 @@ const SPEC: Parameters<typeof Render.renderAutoMovieDrawnVideo>[0]["spec"] = {
|
|
|
18
130
|
};
|
|
19
131
|
|
|
20
132
|
/**
|
|
21
|
-
*
|
|
133
|
+
* Defaults measure long enough intervals to distinguish them from a transient
|
|
134
|
+
* frame or sample.
|
|
135
|
+
*/
|
|
136
|
+
const THRESHOLDS: IAutoMovieDeliveryContentAudit.IThresholds = {
|
|
137
|
+
black: {
|
|
138
|
+
minimumDuration: { ticks: 1, timeBase: [1, 5] },
|
|
139
|
+
minimumPictureRatio: 0.98,
|
|
140
|
+
maximumPixelThreshold: 0.1,
|
|
141
|
+
},
|
|
142
|
+
frozen: {
|
|
143
|
+
minimumDuration: { ticks: 1, timeBase: [1, 2] },
|
|
144
|
+
maximumMeanDifference: 0.001,
|
|
145
|
+
},
|
|
146
|
+
silence: {
|
|
147
|
+
minimumDuration: { ticks: 1, timeBase: [1, 2] },
|
|
148
|
+
maximumAmplitude: 0.001,
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Renders one subject and publishes an approved film beside its shared report.
|
|
154
|
+
* Every measurable audit runs on the drawn frames or the exact staged encoded
|
|
155
|
+
* bytes. The decoded audio's integrated loudness and true peak, measured by the
|
|
156
|
+
* production render's BS.1770-5 meter, must meet the targets the sound-list mix
|
|
157
|
+
* applied or, for a supplied soundtrack, the declared loudness intent, and a
|
|
158
|
+
* phoneme-driven line whose lip-sync lag, measured against the mouth the
|
|
159
|
+
* subject read on each drawn frame, fails the report's verdict blocks. The
|
|
160
|
+
* encoded file must also carry its declared picture profile and, with a
|
|
161
|
+
* soundtrack, the AAC profile, or no audio track without one
|
|
162
|
+
* (`auditAutoMovieDeliveryProfile`); a mismatch blocks like a blocking audit
|
|
163
|
+
* finding and the report's `profile` records each field with its expected and
|
|
164
|
+
* observed values. A blocked attempt replaces the report and preserves the
|
|
165
|
+
* former film. A failed encode still reports the frames and scene inspection
|
|
166
|
+
* already drawn. If the approved film or its report cannot be installed, the
|
|
167
|
+
* former film is put back, so the film and report on disk always come from the
|
|
168
|
+
* same attempt.
|
|
22
169
|
*
|
|
23
|
-
*
|
|
170
|
+
* With `passes`, every frame is also drawn in those guide passes and written
|
|
171
|
+
* under `<out>/controls/` with `record.json`, whose `filmSha256` is the
|
|
172
|
+
* report's `source.sha256`; the folder is staged and installed in the same
|
|
173
|
+
* publish step as the film, so a blocked or failed attempt keeps the former
|
|
174
|
+
* `controls/` with the former film.
|
|
24
175
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
176
|
+
* With `background` `transparent`, the beauty pass is drawn over a transparent
|
|
177
|
+
* background and its straight-alpha PNG files are wrapped unencoded into
|
|
178
|
+
* `film.mov` in `media/automovie/<film>/transparent` by default, so a layer
|
|
179
|
+
* attempt never replaces the film's report. The layer carries no audio: the
|
|
180
|
+
* film's required soundtrack is not expected, none is passed to the wrap and
|
|
181
|
+
* the report's `layer` says so. The black check, which reads a transparent
|
|
182
|
+
* frame as black, does not block; the profile check is replaced by
|
|
183
|
+
* `auditAutoMovieAlphaSamples`, which requires one sample per drawn frame with
|
|
184
|
+
* the frame file's bytes.
|
|
32
185
|
*/
|
|
33
|
-
export async function renderAutoMovieVideo(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
186
|
+
export async function renderAutoMovieVideo(
|
|
187
|
+
props: {
|
|
188
|
+
/** The opened draw host. */
|
|
189
|
+
host: IDeliveryHost;
|
|
190
|
+
/** The production's root folder. */
|
|
191
|
+
root: string;
|
|
192
|
+
/** The subject's name, or null for the page's only subject. */
|
|
193
|
+
subject: string | null;
|
|
194
|
+
/** Data the subject module reads, as JSON, or null. */
|
|
195
|
+
props: unknown;
|
|
196
|
+
/** Output folder, relative to the root or absolute. */
|
|
197
|
+
out?: string;
|
|
198
|
+
/** FFmpeg executable. */
|
|
199
|
+
ffmpeg: string;
|
|
200
|
+
/**
|
|
201
|
+
* Guide passes other than `beauty` drawn at every frame into
|
|
202
|
+
* `<out>/controls/`; absent or empty draws the film alone.
|
|
203
|
+
*/
|
|
204
|
+
passes?: readonly string[];
|
|
205
|
+
/**
|
|
206
|
+
* `transparent` renders a straight-alpha layer as `film.mov` with no audio,
|
|
207
|
+
* into `media/automovie/<film>/transparent` by default; absent or `scene`
|
|
208
|
+
* renders the film.
|
|
209
|
+
*/
|
|
210
|
+
background?: "scene" | "transparent";
|
|
211
|
+
},
|
|
212
|
+
run: typeof runAutoMovieFfmpeg = runAutoMovieFfmpeg,
|
|
213
|
+
): Promise<{
|
|
53
214
|
video: string;
|
|
54
|
-
|
|
55
|
-
/** The report written beside it. */
|
|
56
215
|
report: string;
|
|
57
|
-
|
|
58
|
-
/** Frames drawn. */
|
|
59
216
|
frames: number;
|
|
217
|
+
controls: string | null;
|
|
60
218
|
}> {
|
|
61
|
-
const session
|
|
219
|
+
const session = await props.host.session({
|
|
62
220
|
subject: props.subject,
|
|
63
221
|
props: props.props,
|
|
64
222
|
});
|
|
65
|
-
const name:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
223
|
+
const { name, delivery: intent } = session.subject;
|
|
224
|
+
|
|
225
|
+
// A transparent layer has its own folder, so its attempts never replace the
|
|
226
|
+
// report of the film in `videos/`.
|
|
227
|
+
const transparent: boolean = props.background === "transparent";
|
|
228
|
+
const file: "film.mp4" | "film.mov" = transparent ? "film.mov" : "film.mp4";
|
|
229
|
+
const out = path.resolve(
|
|
71
230
|
props.root,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
231
|
+
props.out ??
|
|
232
|
+
path.join(
|
|
233
|
+
"media",
|
|
234
|
+
"automovie",
|
|
235
|
+
name,
|
|
236
|
+
transparent ? "transparent" : "videos",
|
|
237
|
+
),
|
|
75
238
|
);
|
|
76
|
-
const
|
|
239
|
+
const video = path.join(out, file);
|
|
240
|
+
const report = path.join(out, "render-report.json");
|
|
241
|
+
const reservation = path.join(out, ".render-publish");
|
|
242
|
+
let reservationTicket: string | undefined;
|
|
243
|
+
let staging: string | undefined;
|
|
244
|
+
let scratch: string | undefined;
|
|
77
245
|
try {
|
|
78
|
-
await fs.mkdir(scratch, { recursive: true });
|
|
79
246
|
await fs.mkdir(out, { recursive: true });
|
|
80
|
-
|
|
81
|
-
|
|
247
|
+
staging = await fs.mkdtemp(path.join(out, ".render-"));
|
|
248
|
+
reservationTicket = await AutoMovieRenderOutputReservation.reserve(
|
|
249
|
+
staging,
|
|
250
|
+
reservation,
|
|
251
|
+
out,
|
|
252
|
+
);
|
|
253
|
+
const candidate = path.join(staging, file);
|
|
254
|
+
const pendingReport = path.join(staging, "render-report.json");
|
|
255
|
+
const attempt: IDeliveryReport = {
|
|
256
|
+
subject: name,
|
|
257
|
+
revision: readAutoMovieRevision(props.root),
|
|
258
|
+
backend: session.backend,
|
|
259
|
+
status: "failed",
|
|
260
|
+
video: null,
|
|
261
|
+
args: [],
|
|
262
|
+
frames: [],
|
|
263
|
+
diagnostics: null,
|
|
264
|
+
sound: null,
|
|
265
|
+
delivery: null,
|
|
266
|
+
profile: null,
|
|
267
|
+
source: null,
|
|
268
|
+
...(transparent
|
|
269
|
+
? {
|
|
270
|
+
layer: {
|
|
271
|
+
background: "transparent" as const,
|
|
272
|
+
audio: "none" as const,
|
|
273
|
+
},
|
|
274
|
+
}
|
|
275
|
+
: {}),
|
|
276
|
+
};
|
|
277
|
+
const writeReport = async (): Promise<void> =>
|
|
278
|
+
fs.writeFile(pendingReport, JSON.stringify(attempt, null, 2) + "\n");
|
|
279
|
+
let phase = "draw";
|
|
280
|
+
const soundtrack: string | null = transparent
|
|
281
|
+
? null
|
|
282
|
+
: (intent?.audio?.path ?? null);
|
|
283
|
+
try {
|
|
284
|
+
const frameRoot = path.join(props.root, ".cache", "render");
|
|
285
|
+
await fs.mkdir(frameRoot, { recursive: true });
|
|
286
|
+
scratch = await fs.mkdtemp(path.join(frameRoot, "frames-"));
|
|
287
|
+
|
|
288
|
+
// Control frames are staged beside the film and published with it,
|
|
289
|
+
// inside the output folder whose publish lock this attempt holds.
|
|
290
|
+
const controls =
|
|
291
|
+
(props.passes ?? []).length === 0
|
|
292
|
+
? null
|
|
293
|
+
: {
|
|
294
|
+
staged: path.join(staging, "controls"),
|
|
295
|
+
installed: path.join(out, "controls"),
|
|
296
|
+
};
|
|
297
|
+
if (controls !== null) await fs.mkdir(controls.staged);
|
|
298
|
+
const result = await props.host.render.renderAutoMovieDrawnVideo({
|
|
82
299
|
session,
|
|
83
300
|
spec: SPEC,
|
|
84
301
|
frameDir: scratch.split(path.sep).join("/"),
|
|
85
|
-
outputPath:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
302
|
+
outputPath: candidate,
|
|
303
|
+
...(transparent ? { background: "transparent" as const } : {}),
|
|
304
|
+
...(controls === null
|
|
305
|
+
? {}
|
|
306
|
+
: {
|
|
307
|
+
controls: {
|
|
308
|
+
passes: props.passes ?? [],
|
|
309
|
+
frameDir: controls.staged.split(path.sep).join("/"),
|
|
310
|
+
},
|
|
311
|
+
}),
|
|
312
|
+
audio:
|
|
313
|
+
soundtrack === null ? null : path.resolve(props.root, soundtrack),
|
|
314
|
+
write: (file, data) => fs.writeFile(file, data),
|
|
315
|
+
read: async (file) => fs.readFile(path.resolve(props.root, file)),
|
|
316
|
+
encode: async (args, drawn) => {
|
|
317
|
+
attempt.args = args;
|
|
318
|
+
// The soundtrack lives in the frame scratch, which is released, so
|
|
319
|
+
// the report names it by file name beside its digest.
|
|
320
|
+
attempt.sound =
|
|
321
|
+
drawn.sound === undefined
|
|
322
|
+
? null
|
|
323
|
+
: { ...drawn.sound, file: path.posix.basename(drawn.sound.file) };
|
|
324
|
+
attempt.frames = drawn.frames.map(({ index, seconds, hash }) => ({
|
|
325
|
+
index,
|
|
326
|
+
seconds,
|
|
327
|
+
hash,
|
|
328
|
+
}));
|
|
329
|
+
attempt.diagnostics = drawn.diagnostics ?? null;
|
|
330
|
+
if (drawn.cut !== undefined) attempt.cut = drawn.cut;
|
|
331
|
+
phase = "encode";
|
|
332
|
+
await run(props.ffmpeg, args);
|
|
91
333
|
},
|
|
92
334
|
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
335
|
+
|
|
336
|
+
phase = "audit";
|
|
337
|
+
const hash = createHash("sha256");
|
|
338
|
+
for await (const chunk of createReadStream(candidate)) hash.update(chunk);
|
|
339
|
+
attempt.source = {
|
|
340
|
+
file: path.relative(out, candidate).split(path.sep).join("/"),
|
|
341
|
+
sha256: hash.digest("hex"),
|
|
342
|
+
};
|
|
343
|
+
// The decoded audio meets the targets the mix applied (the production's
|
|
344
|
+
// own or EBU R 128), or the production's own for a supplied soundtrack.
|
|
345
|
+
const loudness =
|
|
346
|
+
attempt.sound?.loudness.intent ?? intent?.loudness ?? undefined;
|
|
347
|
+
const expected = {
|
|
348
|
+
frameCount: result.frames.length,
|
|
349
|
+
frameRate: result.frameRate,
|
|
350
|
+
audioRequired: transparent ? false : (intent?.audio?.required ?? false),
|
|
351
|
+
contentRequired: intent !== undefined,
|
|
352
|
+
...(intent?.allowances === undefined
|
|
353
|
+
? {}
|
|
354
|
+
: { allowances: intent.allowances }),
|
|
355
|
+
...(loudness === undefined ? {} : { loudness }),
|
|
356
|
+
};
|
|
357
|
+
const thresholds = intent?.thresholds ?? THRESHOLDS;
|
|
358
|
+
const streams = await runAutoMovieDeliveryDecode(
|
|
359
|
+
props.ffmpeg,
|
|
360
|
+
candidate,
|
|
361
|
+
expected,
|
|
362
|
+
thresholds,
|
|
363
|
+
run,
|
|
364
|
+
props.host.render.createAutoMovieLoudnessMeter,
|
|
365
|
+
);
|
|
366
|
+
// The drawn frames and the soundtrack as the encoder read them, measured
|
|
367
|
+
// the same way, before the frame scratch is released.
|
|
368
|
+
const reference = await runAutoMovieDeliveryReferenceDecode(
|
|
369
|
+
props.ffmpeg,
|
|
370
|
+
attempt.args,
|
|
371
|
+
expected,
|
|
372
|
+
thresholds,
|
|
373
|
+
run,
|
|
374
|
+
);
|
|
375
|
+
attempt.delivery = props.host.render.auditAutoMovieDeliveryContent({
|
|
376
|
+
source: attempt.source,
|
|
377
|
+
expected,
|
|
378
|
+
thresholds,
|
|
379
|
+
streams,
|
|
380
|
+
reference,
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// The file must carry the picture and sound profiles its types declare;
|
|
384
|
+
// the encoder muxed a soundtrack exactly when it had a second input.
|
|
385
|
+
// A transparent layer instead holds each drawn PNG file as one sample.
|
|
386
|
+
attempt.profile = transparent
|
|
387
|
+
? await auditAutoMovieAlphaSamples({
|
|
388
|
+
path: candidate,
|
|
389
|
+
frames: result.frames.map(({ file }) => file),
|
|
390
|
+
})
|
|
391
|
+
: await auditAutoMovieDeliveryProfile({
|
|
392
|
+
render: props.host.render,
|
|
393
|
+
path: candidate,
|
|
394
|
+
width: session.subject.width,
|
|
395
|
+
height: session.subject.height,
|
|
396
|
+
frameRate: result.frameRate,
|
|
397
|
+
audio:
|
|
398
|
+
attempt.args.indexOf("-i", attempt.args.indexOf("-i") + 2) >= 0,
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
const failures = [
|
|
402
|
+
...listAutoMovieReleaseFindings(
|
|
403
|
+
attempt.diagnostics,
|
|
404
|
+
attempt.delivery,
|
|
405
|
+
transparent ? ["black"] : [],
|
|
406
|
+
),
|
|
407
|
+
...attempt.profile.map(
|
|
408
|
+
(finding: IAutoMovieDeliveryProfileFinding): string =>
|
|
409
|
+
`unsupported-${finding.media}-profile.${finding.field}: expected ${finding.expected}, observed ${finding.observed}`,
|
|
410
|
+
),
|
|
411
|
+
// A phoneme-driven line whose sound and mouth part by more than the
|
|
412
|
+
// detectability window blocks; unmeasured and inconclusive lines are
|
|
413
|
+
// only reported.
|
|
414
|
+
...(attempt.sound?.lipSync ?? []).flatMap(
|
|
415
|
+
(entry: IAutoMovieDialogueLipSync): string[] =>
|
|
416
|
+
entry.status === "measured" && entry.verdict === "fail"
|
|
417
|
+
? [
|
|
418
|
+
`lip-sync ${entry.line}: the sound is ${entry.lagMilliseconds.toFixed(1)} ms after the mouth, outside -45 to +125 ms`,
|
|
419
|
+
]
|
|
420
|
+
: [],
|
|
421
|
+
),
|
|
422
|
+
];
|
|
423
|
+
if (failures.length > 0) {
|
|
424
|
+
attempt.status = "blocked";
|
|
425
|
+
throw new Error(failures.join(" | "));
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
phase = "publish";
|
|
429
|
+
attempt.status = "published";
|
|
430
|
+
attempt.video = file;
|
|
431
|
+
await writeReport();
|
|
432
|
+
if (controls !== null)
|
|
433
|
+
await writeControlRecord(controls.staged, {
|
|
434
|
+
film: name,
|
|
435
|
+
revision: attempt.revision,
|
|
436
|
+
backend: attempt.backend,
|
|
437
|
+
clock: {
|
|
438
|
+
frameRate: result.frameRate,
|
|
439
|
+
frameCount: result.frames.length,
|
|
440
|
+
width: session.subject.width,
|
|
441
|
+
height: session.subject.height,
|
|
442
|
+
},
|
|
443
|
+
filmSha256: attempt.source.sha256,
|
|
444
|
+
channels: result.controls ?? [],
|
|
445
|
+
});
|
|
446
|
+
await publishAutoMovieRenderAttempt({
|
|
447
|
+
candidate,
|
|
448
|
+
video,
|
|
449
|
+
pendingReport,
|
|
450
|
+
report,
|
|
451
|
+
previous: path.join(staging, "previous-" + file),
|
|
452
|
+
...(controls === null
|
|
453
|
+
? {}
|
|
454
|
+
: {
|
|
455
|
+
controls: {
|
|
456
|
+
candidate: controls.staged,
|
|
457
|
+
installed: controls.installed,
|
|
458
|
+
previous: path.join(staging, "previous-controls"),
|
|
459
|
+
},
|
|
114
460
|
}),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
461
|
+
});
|
|
462
|
+
return {
|
|
463
|
+
video,
|
|
464
|
+
report,
|
|
465
|
+
frames: result.frames.length,
|
|
466
|
+
controls: controls === null ? null : controls.installed,
|
|
467
|
+
};
|
|
468
|
+
} catch (cause) {
|
|
469
|
+
attempt.video = null;
|
|
470
|
+
if (attempt.status !== "blocked") attempt.status = "failed";
|
|
471
|
+
const message = cause instanceof Error ? cause.message : String(cause);
|
|
472
|
+
attempt.failure = { phase, message };
|
|
473
|
+
try {
|
|
474
|
+
await writeReport();
|
|
475
|
+
await fs.rename(pendingReport, report);
|
|
476
|
+
} catch (reportFailure) {
|
|
477
|
+
throw new AggregateError(
|
|
478
|
+
[cause, reportFailure],
|
|
479
|
+
"Render failed and could not publish " + report + ": " + message,
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
throw new Error(
|
|
483
|
+
"Render " + attempt.status + ": " + message + "\n" + report,
|
|
484
|
+
{ cause },
|
|
485
|
+
);
|
|
486
|
+
}
|
|
122
487
|
} finally {
|
|
123
|
-
await
|
|
124
|
-
|
|
125
|
-
|
|
488
|
+
await Promise.all([
|
|
489
|
+
session.close(),
|
|
490
|
+
...(staging === undefined ? [] : [fs.rm(staging, { recursive: true })]),
|
|
491
|
+
...(scratch === undefined ? [] : [fs.rm(scratch, { recursive: true })]),
|
|
492
|
+
...(reservationTicket === undefined
|
|
493
|
+
? []
|
|
494
|
+
: [
|
|
495
|
+
AutoMovieRenderOutputReservation.release(
|
|
496
|
+
reservation,
|
|
497
|
+
reservationTicket,
|
|
498
|
+
),
|
|
499
|
+
]),
|
|
500
|
+
]);
|
|
126
501
|
}
|
|
127
502
|
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Writes a control folder's `record.json`, the file a generation request names
|
|
506
|
+
* and a manifest digests.
|
|
507
|
+
*/
|
|
508
|
+
async function writeControlRecord(
|
|
509
|
+
folder: string,
|
|
510
|
+
record: IAutoMovieControlRecord,
|
|
511
|
+
): Promise<void> {
|
|
512
|
+
await fs.writeFile(
|
|
513
|
+
path.join(folder, "record.json"),
|
|
514
|
+
JSON.stringify(record, null, 2) + "\n",
|
|
515
|
+
);
|
|
516
|
+
}
|
|
@@ -1,33 +1,26 @@
|
|
|
1
|
+
import type { AutoMovieFfmpegStaticPath } from "./AutoMovieFfmpegStaticPath";
|
|
2
|
+
import type { IAutoMovieFfmpegSources } from "./IAutoMovieFfmpegSources";
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* Find the FFmpeg executable a capture of a video file runs: `FFMPEG_PATH` when
|
|
5
|
+
* Find the FFmpeg executable a capture of a video file runs: `FFMPEG_PATH` when
|
|
6
|
+
* the environment sets it to a non-blank path, else the binary of the
|
|
7
|
+
* production's `ffmpeg-static`.
|
|
3
8
|
*
|
|
4
|
-
*
|
|
9
|
+
* A production without `ffmpeg-static` installed refuses with the loader's own
|
|
10
|
+
* error, which names the package and the production; one whose `ffmpeg-static`
|
|
11
|
+
* has no binary for this platform refuses naming both `FFMPEG_PATH` and
|
|
12
|
+
* `ffmpeg-static`, so a capture that plans a video says how to supply one
|
|
13
|
+
* before it touches its folder.
|
|
5
14
|
*
|
|
6
|
-
* @
|
|
7
|
-
* @
|
|
8
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure Read the variable, else load the package, else refuse.
|
|
9
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No `ffmpeg` on the search path is guessed, because a capture records the binary it ran.
|
|
10
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms One module load at most.
|
|
11
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Resolved once per capture.
|
|
12
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns a path and keeps nothing.
|
|
15
|
+
* @param props The environment and the production's loader.
|
|
16
|
+
* @returns The executable's path.
|
|
13
17
|
*/
|
|
14
|
-
export function resolveAutoMovieFfmpeg(props: {
|
|
15
|
-
/** The environment, read for `FFMPEG_PATH`. */
|
|
16
|
-
env: Readonly<Record<string, string | undefined>>;
|
|
17
|
-
|
|
18
|
-
/** Loads a package from the production, throwing when it is not installed. */
|
|
19
|
-
load: (id: string) => unknown;
|
|
20
|
-
}): string {
|
|
18
|
+
export function resolveAutoMovieFfmpeg(props: IAutoMovieFfmpegSources): string {
|
|
21
19
|
const given: string | undefined = props.env.FFMPEG_PATH?.trim();
|
|
22
20
|
if (given !== undefined && given !== "") return given;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
binary = props.load("ffmpeg-static");
|
|
26
|
-
} catch {
|
|
27
|
-
binary = null;
|
|
28
|
-
}
|
|
29
|
-
if (typeof binary === "string" && binary !== "") return binary;
|
|
21
|
+
const binary: AutoMovieFfmpegStaticPath = props.load("ffmpeg-static");
|
|
22
|
+
if (binary !== null) return binary;
|
|
30
23
|
throw new Error(
|
|
31
24
|
"A video capture needs FFmpeg: set FFMPEG_PATH to an ffmpeg executable, or install ffmpeg-static in the production",
|
|
32
25
|
);
|
|
33
|
-
}
|
|
26
|
+
}
|