fix: honor FFMPEG_PROCESS_TIMEOUT_MS during video-frame extraction - #3918
Open
miga-heygen wants to merge 1 commit into
Open
fix: honor FFMPEG_PROCESS_TIMEOUT_MS during video-frame extraction#3918miga-heygen wants to merge 1 commit into
miga-heygen wants to merge 1 commit into
Conversation
FFMPEG_PROCESS_TIMEOUT_MS resolves correctly into EngineConfig and is
correctly forwarded to the audio-extraction ffmpeg call, but
runExtractVideosStage (shared by both the in-process renderer and
distributed plan()) built the config object it passes to
extractAllVideoFrames with only { extractCacheDir, extractCacheMaxBytes },
silently dropping ffmpegProcessTimeout even though the full EngineConfig
was already in scope. That config flows straight into
extractVideoFramesRange, which falls back to a hardcoded 300s deadline
whenever the field is undefined -- so video-frame extraction always
used a fixed 300s timeout no matter what the env var was set to.
Threads cfg.ffmpegProcessTimeout into that config literal the same way
the two cache fields already are.
Co-Authored-By: Miguel Angel <miguel.sierra@heygen.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FFMPEG_PROCESS_TIMEOUT_MSresolves correctly intoEngineConfig.ffmpegProcessTimeoutand is correctly forwarded to the audio-extraction ffmpeg call, butrunExtractVideosStage— shared by both the in-process renderer and distributedplan()— built the config object it passes toextractAllVideoFrameswith only{ extractCacheDir, extractCacheMaxBytes }, silently droppingffmpegProcessTimeouteven though the fullEngineConfig(which already has that field) was in scope. That config flows straight intoextractVideoFramesRange, which falls back to a hardcoded 300s deadline whenever the field isundefined— so video-frame extraction always used a fixed 300s timeout no matter what the env var was set to, independent of--workers, cache settings, or keyframe density.Fix
One-line addition:
ffmpegProcessTimeout: cfg.ffmpegProcessTimeoutin the config literal passed toextractAllVideoFrames, alongside the two cache fields already there.Worth noting: this does unify video-frame extraction onto the same timeout knob that other ffmpeg operations (mux/faststart, audio extraction) already use. If a deployment set
FFMPEG_PROCESS_TIMEOUT_MSlow for a different ffmpeg step, video extraction on long/large source clips now inherits that same shorter deadline instead of the previous fixed 300s ceiling — this is the intended effect of the fix (the whole point is making the var actually apply here), but worth being aware of if a very short value is already set somewhere for an unrelated reason.Test plan
extractVideosStage.ffmpegTimeout.test.ts(mirrors the existingextractVideosStage.timelineBound.test.tsmocking pattern): asserts a non-defaultffmpegProcessTimeoutoverride reaches the config objectextractAllVideoFramesreceives, plus a counter-test confirming the default still passes through unchanged.bunx tsc --noEmitclean;oxlint/oxfmt --checkclean on both touched files.ffmpegProcessTimeoutkey at all); restored and confirmed green again.extractAllVideoFrames/extractVideoFramesRange(this one), so no sibling config-builder has the same gap, and confirmed both callers ofrunExtractVideosStage(in-process render and distributedplan()) build their config viaresolveConfig()(or a caller-suppliedEngineConfig, which is non-optional on this field), so the fix applies uniformly to both paths.