Skip to content

FFmpeg export fails due to missing input stream validation when generating filter graph #137

Description

@elgenawi

Description

The export pipeline can fail because the generated FFmpeg filter graph assumes that all referenced input streams (audio/video) exist without validating them first.

Root Cause

The application constructs a static FFmpeg filter graph based on the expected input layout rather than the actual streams available in the input media. If any referenced stream is missing (e.g., an input does not contain an audio or video stream), the generated filter graph still references it.

When FFmpeg initializes the filter graph, it cannot resolve the missing stream and terminates with an error similar to:

Stream specifier ':a' matches no streams.
Error binding filtergraph inputs/outputs: Invalid argument

This causes the export to fail with:

Exit Code: -22 (Invalid argument)

Expected Behavior

Before generating the filter graph, the application should inspect the streams of each input and build the graph dynamically. If an expected stream is unavailable, it should:

  • Skip the missing stream when possible.
  • Substitute an appropriate placeholder (e.g., silent audio).
  • Or report a clear validation error before invoking FFmpeg.

Actual Behavior

The export process generates a filter graph containing references to streams that may not exist, causing FFmpeg to fail during filter graph initialization and abort the export.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions