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

  1. github-actions commented on May 27, 2026

    @github-actions
    Contributor

    👋 Thanks for opening an issue, @shahabhilash!

    Our maintainers will review this shortly 🚀

    Before you start working

    • 📖 Read the CONTRIBUTING.md guide
    • 💬 Wait for a maintainer to assign you the issue before starting work
    • 🔍 Search for existing issues to avoid duplicates

    For GSSoC'26 contributors

    If you're contributing under GirlScript Summer of Code 2026, please mention it in your comment when requesting assignment:

    "I'd like to work on this — contributing under GSSoC'26"

    Architecture notes

    Reframe is a static Next.js app with output: "export". Key points:

    • All video processing uses FFmpeg.wasm (client-side, no server)
    • headers() in next.config.ts won't work — use vercel.json instead
    • not-found.tsx requires public/404.html + vercel.json routes config

    Happy contributing! ⭐ Star the repo if you find it useful!

  2. shahabhilash commented on May 27, 2026

    @shahabhilash
    ContributorAuthor

    /assign

  3. github-actions commented on May 27, 2026

    @github-actions
    Contributor

    Hey @shahabhilash, this issue has been assigned to you! 🎉 Please make progress within 5 days or it will be automatically unassigned due to inactivity.

  4. github-actions commented on May 29, 2026

    @github-actions
    Contributor

    Hey @shahabhilash, just a friendly reminder that this issue has had no activity for 2 days. Please leave an update or let us know if you need help! ⏰

  5. shahabhilash commented on May 29, 2026

    @shahabhilash
    ContributorAuthor

    @magic-peach A fix has been implemented and PR #1289 is open for review.

  6. github-actions commented on Jun 2, 2026

    @github-actions
    Contributor

    Hey @shahabhilash, final warning! ⚠️ This issue has had no activity for 4 days and will be automatically unassigned in 24 hours if there is no update.

  7. github-actions commented on Jun 8, 2026

    @github-actions
    Contributor

    This issue has been unassigned from @shahabhilash due to 5 days of inactivity and is open for anyone to pick up — comment /assign to claim it!

  8. magic-peach commented on Sep 15, 2026

    @magic-peach
    Collaborator

    Thanks for this report! This looks like the same underlying bug as #1577 (infinite export loop / OOM when looping background music on a video with no original audio) — #1577 has a bit more detail on the root cause, so I'm closing this one in favor of that one to keep the discussion in one place. Please jump into #1577 if you have anything to add — reproduction steps, environment details, anything helps!

  9. github-actions commented on Sep 15, 2026

    @github-actions
    Contributor

    Claude encountered an error —— View job


    I'll analyze this and get back to you.

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