Reference only

FFmpeg audio contains NaN or Inf: trace effects and decoding upstream

A codec rejecting nonfinite samples is not necessarily missing. Follow the audio entering it back through processing and decoding.

Symptoms and scope

A codec rejecting nonfinite samples is not necessarily missing. Follow the audio entering it back through processing and decoding.

Error fragments for search; IDs, values and filenames may vary:

Input contains (near) NaN/+-Inf
Audio encoding failed

Source-supported context

VideoHelperSuite issue #537 reports this after reverb was added. It supports one audio-chain failure scenario, not a conclusion about every reverb plugin or VAE. Source 1 Source 2

Cases to distinguish

1. An effect, gain or mixing stage generates invalid values detected only during encoding.

2. An earlier decoder or precision conversion has a numerical problem without a separate visible failure.

3. Input media or an extension's sample-data conventions do not match expectations.

Diagnostic sequence

The sequence below is an editorial procedure based on the cited context, not a diagnosis already confirmed for your environment.

Step 1. Preserve stderr and confirm that it explicitly reports NaN/Inf rather than a missing path or encoder.

Step 2. In a copy, bypass effects and send valid original audio directly to composition while retaining the same video frames.

Step 3. Restore reverb, gain, mixing and conversions one at a time to find the first minimal failing branch.

Step 4. Record that branch's version/settings and seek an upstream fix. Do not silently zero every nonfinite value without understanding the audio consequences.

Completion check

Stages process valid audio and encoding completes with sensible content, level and duration. Absence of an exception alone does not validate the effect.

Limitations and cautions

Silence and nonfinite samples are different failures. No real user audio or numerical audit of the effect implementation is included.

Original sources

Localization prepared: 2026-09-22. The source-check dates above were inherited from the existing article; this translation does not claim they were all rechecked today. No GPU run, minimum-memory measurement or runtime guarantee is supplied.

Didn't solve it?

Check the next possible cause

The same symptom can come from a different cause. Work through these related entries in order.

  1. VHS output is nearly silent: inspect audio dtype before increasing gainVHS_VideoCombineThis case-led guide concerns a reported fp16-intermediate scenario, not every silent track. First establish whether audio exists and is valid before composition.
  2. Video export fails or plays incorrectly: check frames, encoding and audio separatelyUnknown encoderExisting output can still be unplayable, silent or the wrong length. Establish whether the issue belongs to generation, encoding, saving or the target player.
Paste your full log into the error finder

Was this page helpful?

Anonymous. Only a yes/no counter is stored; no account, IP address or device details.

Sources & references

Localized from the existing Chinese research draft. Original source-check dates are retained; this translation is not new technical verification or a runtime test.

01VHS FFmpeg audio contains NaN/InfSource checked: 2026-09-2102VideoHelperSuite READMESource checked: 2026-09-21

Report an issue · 93cf48c8-5e6f-525c-8757-26adf0526c65