Skip to content

fix: transcode non-AAC audio to AAC for MP4 container - #1357

Open
Tingting-Y wants to merge 1 commit into
ModelTC:mainfrom
Tingting-Y:fix/audio-codec-mp4-container
Open

fix: transcode non-AAC audio to AAC for MP4 container#1357
Tingting-Y wants to merge 1 commit into
ModelTC:mainfrom
Tingting-Y:fix/audio-codec-mp4-container

Conversation

@Tingting-Y

Copy link
Copy Markdown
Collaborator

Problem

Generated MP4 files use MP3 audio codec, which is not supported by macOS QuickTime, AVFoundation, and some web browsers. This causes no audio when previewing in web players or QuickTime.

Solution

  • Video stream: copy directly, no re-encoding
  • AAC audio: copy directly (passthrough)
  • MP3/WAV and other non-AAC audio: transcode to AAC 256k

Verification

  • 4 unit tests passed
  • Python compile check passed
  • git diff --check passed
  • Real FFmpeg test confirmed:
    • AAC audio is passed through directly
    • MP3/WAV audio is transcoded to AAC 256k
    • Video stream hash is identical across all 3 output types (no re-encoding)

@Tingting-Y
Tingting-Y requested a review from xinyiqin August 10, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant