fix: bound the audio-less clip bed with atrim (the card bed was fixed; this branch was missed by a silent no-op replace)
This commit is contained in:
parent
8401aa3d37
commit
f3631307aa
1 changed files with 6 additions and 1 deletions
|
|
@ -143,7 +143,12 @@ export function clipVideoChain(rotate: EdlRotate, fit: "cover" | "contain", aspe
|
||||||
|
|
||||||
function clipAudioChain(volumeDb: number, hasAudio: boolean, inputIndex: number, trimSpanSec: string): string {
|
function clipAudioChain(volumeDb: number, hasAudio: boolean, inputIndex: number, trimSpanSec: string): string {
|
||||||
const aformat = `aformat=sample_fmts=fltp:sample_rates=${ASSEMBLE_PRESET.sampleRate}:channel_layouts=stereo`;
|
const aformat = `aformat=sample_fmts=fltp:sample_rates=${ASSEMBLE_PRESET.sampleRate}:channel_layouts=stereo`;
|
||||||
if (!hasAudio) return `anullsrc=r=${ASSEMBLE_PRESET.sampleRate}:cl=stereo,aformat=sample_fmts=fltp:sample_rates=${ASSEMBLE_PRESET.sampleRate}:channel_layouts=stereo`;
|
if (!hasAudio) {
|
||||||
|
// anullsrc is an INFINITE source — unbounded, concat never finishes the
|
||||||
|
// segment and the encode deadlocks (2026-10-16 production hang). atrim pins
|
||||||
|
// the bed to the clip's trim span; asetpts restarts timestamps.
|
||||||
|
return `anullsrc=r=${ASSEMBLE_PRESET.sampleRate}:cl=stereo,atrim=0:${trimSpanSec},asetpts=PTS-STARTPTS,aformat=sample_fmts=fltp:sample_rates=${ASSEMBLE_PRESET.sampleRate}:channel_layouts=stereo`;
|
||||||
|
}
|
||||||
return `[${inputIndex}:a]${aformat}${volumeDb === 0 ? "" : `,volume=${volumeDb}dB`}`;
|
return `[${inputIndex}:a]${aformat}${volumeDb === 0 ? "" : `,volume=${volumeDb}dB`}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue