No sound, --aid=auto picks track that cannot be decoded
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- audio-video-rtc
Research direction
The bug is in automatic audio track selection: --aid=auto picks an APAC track that no decoder can open, so playback goes silent. Start from the log lines [ad] Failed to initialize a decoder for codec 'apple_apac' and Audio: no audio to find where the default track is chosen and where decoder setup fails. Reproduce with the attached apple_apac.mov, where --aid=2 plays correctly. Done means the default selection falls back to a decodable track, or the failure is reported, and the iPhone sample plays with sound. The issue also asks a design question about the expected fallback behaviour, so confirm the approach with maintainers first.
Written by the indexing model from the issue text.
Description
mpv Information
mpv v0.41.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.360.1
FFmpeg version: 9.0.2
FFmpeg library versions:
libavcodec 63.1.102
libavdevice 63.1.102
libavfilter 12.1.102
libavformat 63.1.102
libavutil 61.1.102
libswresample 7.1.102
libswscale 10.1.102
Other Information
- macOS version: macOS 15.7.9 (24G830)
- Source of mpv: brew installed
- Latest known working version: Unknown
- Issue started after the following happened: Movies taken on iPhone changed
Reproduction Steps
This issue asks two questions:
- Should the automatic behavior of the aid option be to try another audio stream if the one it picks cannot be decoded?
- How can mpv be configured to not have this problem with iPhone videos?
Newer iPhones will generate movies that have two audio streams. One of the audio streams is encoded using the Apple Positional Audio Codec which FFmpeg 9.0.2 does not support (FFmpeg is adding support). If by default the APAC encoded audio stream is selected then the video plays without sound:
low-batt@gag audio$ mpv --no-config --gpu-debug --log-file=output.txt apple_apac.mov
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: overread end of atom 'stsd' by 184 bytes
● Video --vid=1 (hevc 3840x2160 30 fps) [default]
● Audio --aid=1 (apple_apac 4ch 48000 Hz 413 kbps) [default]
○ Audio --aid=2 (aac 2ch 48000 Hz 195 kbps)
Failed to initialize a decoder for codec 'apple_apac'.
Audio: no audio
VO: [gpu-next] 3840x2160 yuv420p10
V: 00:00:01 / 00:00:01 (97%)
Exiting... (End of file)
low-batt@gag audio$
From the log file:
[ 0.057][v][ad] Codec list:
[ 0.057][v][ad] (no decoders)
[ 0.057][e][ad] Failed to initialize a decoder for codec 'apple_apac'.
[ 0.057][v][lavf] deselect track 1
[ 0.058][i][cplayer] Audio: no audio
The attached file plays fine when --aid=2 is specified. But that cannot be used when playing a playlist with different kinds of files.
Can some sort of conditional auto profile be used as a workaround until FFmpeg supports Apple APAC?
To add to the confusion, I had a friend generate a test video and in that video file the audio stream using APAC is the 2nd audio stream and by default mpv plays it with sound.
This problem was reported against IINA in issue https://github.com/iina/iina/issues/6378.
Expected Behavior
The movie plays with sound.
Actual Behavior
By default the movie plays without any sound.
Log File
Sample Files
I carefully read all instruction and confirm that I did the following:
- I tested and confirmed that the issue exists with the latest release version or newer.
- I provided all required information including system and mpv version.
- I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of
--log-file=output.txt. - I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
- I attached the full, untruncated log file.
- I attached the backtrace in the case of a crash.
- Dominant language
- C
- Stars
- 38.2k
- Forks
- 3.7k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 76
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mpv-player/mpv
-
meta:feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
mpv-player/mpv#18855 · 2 comments ·
Maintainers usually reply within 1 day
-
meta:feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
mpv-player/mpv#18683 · 4 comments ·
Maintainers usually reply within 1 day
-
Subtitle delay value displays "-0ms"May be free again A pull request for this issue was closed without being merged. Openos:linux
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
mpv-player/mpv#18649 · 1 comment ·
Maintainers usually reply within 1 day
-
meta:feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mpv-player/mpv#18464 ·
Maintainers usually reply within 1 day
-
Keyboard shortcut next and previous secondary subtitle filePossibly taken @ravarnax claimed this 225 days ago. Openmeta:feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
mpv-player/mpv#17693 · 5 comments · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
`sha256()` returns a wrong hash when libsql-ffi is built with gcc 11 or laterPossibly taken @colinhacks claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tursodatabase/libsql#2333 ·
Maintainers usually reply within 11 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenPrinting/cups#1826 ·
Maintainers usually reply within 1 day
-
Backport to 3.0 advertises a suffix that does not existPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
389ds/389-ds-base#8152 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RetroAchievements/rcheevos#580 · 1 comment ·
Maintainers usually reply within 5 days