Software⏱️ 3 min read📅 2026-06-11

How to Fix: Why do malformed AAC tracks sound perfect in Movie Studio, but return "Input buffer exhausted before END element found" error when muxing in FFmpeg?

FFmpeg issue with malformed AAC tracks and input buffer exhausted error when muxing in FFmpeg.

Quick Answer: Check the audio format and settings for both video and commentary tracks, as well as the recording software used to capture the commentary.

The 'Input buffer exhausted before END element found' error occurs when FFmpeg fails to properly read and process audio data from an AAC track in Movie Studio. This issue affects users who are muxing h.264 video with a secondary WAV commentary track, without re-encoding anything on the video side.

This error can be frustrating, especially when it causes noticeable video/audio desync in the final output. In this troubleshooting guide, we will explore the root causes of this issue and provide two primary fix methods to resolve the problem.

⚠️ Common Causes

  • The first main reason why this error happens is due to malformed audio streams. When Bandicam records a separate .wav file simultaneously, it may not always produce perfectly formatted audio data. This can lead to issues when muxing the commentary track with the h.264 video in FFmpeg.
  • An alternative reason for this error could be related to FFmpeg's handling of AAC audio streams. Although the user has updated their FFmpeg executables to the latest builds, there might still be compatibility or configuration issues that contribute to the problem.

🚀 How to Resolve This Issue

Resample and re-encode the commentary track using a compatible resampler

  1. Step 1: Use FFmpeg's -f lavfi option with the 'aresample' filter to resample the commentary track's audio to a compatible sample rate. For example: `ffmpeg -i input.mp4 -i commentary.wav -c:v copy -c:a aresample=48000:1 output.mp4`.
  2. Step 2: Apply additional re-encoding if necessary using FFmpeg's -c:a option with the 'aac' codec. This may help ensure that the audio data is properly formatted for muxing in Movie Studio.
  3. Step 3: Verify that the commentary track's audio has been successfully resampled and re-encoded before proceeding to the next step.

Use a different AAC resampler or audio processing tool

  1. Step 1: Try using a different AAC resampler, such as 'aresample=48000:2' or 'aresample=96000:1', to see if it resolves the issue. You can do this by modifying the FFmpeg command from the previous step.
  2. Step 2: Consider using an external audio processing tool, such as Audacity or Adobe Audition, to preprocess the commentary track's audio before muxing it with the h.264 video.

💡 Conclusion

To resolve the 'Input buffer exhausted before END element found' error when muxing AAC tracks in Movie Studio, try resampling and re-encoding the commentary track using a compatible resampler or using an external audio processing tool. If these methods do not work, further troubleshooting may be necessary to identify the root cause of the issue.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions