Skip to content

[BUG] Infinite export loop when adding looped background music to a silent video at 1x speed #1284

Description

@shahabhilash

Bug: Infinite export when looping background music on videos without original audio

Description

If a user uploads a video that has no audio track (or mutes the original audio so hasOriginalAudio === false) and adds a background music track with “Loop Music” enabled, the export process never finishes.

The FFmpeg process continues indefinitely, eventually:

  • crashing the browser tab, or
  • generating an extremely large/unplayable output file.

Steps to Reproduce

  1. Upload a video with no audio track
    OR mute the original audio so hasOriginalAudio evaluates to false
  2. Add a background music track
  3. Enable “Loop Music”
  4. Export the video

Expected Behavior

The export should stop when the video duration ends and produce a valid output file.


Actual Behavior

The export runs indefinitely because the looped audio stream never terminates.


Root Cause

In src/lib/ffmpeg.ts inside buildArguments:

  • When loopMusic is enabled, the background music input is prefixed with:
-stream_loop -1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlyduplicateThis issue or pull request already existstype:bugBug fixtype:performancePerformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions