core icon indicating copy to clipboard operation
core copied to clipboard

Local library: list .mp4 (and .m4b) files that carry an audio track

Open timanders22 opened this issue 3 weeks ago • 4 comments

Version: 4.0.0-beta.22; the first two lists below are unchanged on main.

What happens

A folder in the local music library that holds only .mp4 files (concert recordings, music videos) shows "(No content)" in the Loxone app, although the files are readable inside the container.

I checked the 13 files in that folder with ffprobe: every one has an AAC audio stream (codec_name=aac), i.e. the same codec sonn already plays from .m4a and .aac files.

Why

The library only accepts six extensions:

  • src/adapters/content/providers/localLibraryProvider.ts, isAudioFile(): ['.mp3', '.flac', '.m4a', '.aac', '.ogg', '.wav']
  • src/adapters/http/adminApi/content/contentHandlers.ts: /\.(mp3|flac|m4a|aac|ogg|wav)$/i
  • dist/adapters/mediaserver/trackStreamHandler.js strips mp3|m4a|aac|flac|wav from display names, so a .mp4 (or .ogg) name would keep its extension.

.mp4 and .m4a are the same container (ISO BMFF); .m4b (audiobooks) is too.

Request

Accept .mp4 (and possibly .m4b) in the local library, ideally only when the file has an audio stream, so a video-only file does not show up as an unplayable track. The video stream would simply be ignored (-vn).

Workaround for now: extract the audio without re-encoding (ffmpeg -i in.mp4 -vn -c:a copy out.m4a).

I have not patched or tested this in sonn; I can test a build on a Raspberry Pi 4 with Google Cast zones.

timanders22 avatar Nov 08 '26 22:11 timanders22

Added on dev, in the next beta: .mp4 and .m4b are listed in the local library, served as audio/mp4 like .m4a. An .mp4 is only indexed when the scan finds an audio stream in it, so a video without sound doesn't show up as a track. The video stream is ignored on playback. Happy to hear how it works with your concert recordings.

rudyberends avatar Nov 11 '26 16:11 rudyberends

Thank you! I will check the concert recordings with beta.24 and report back here; if they show up and play, I will close the issue.

timanders22 avatar Nov 22 '26 10:11 timanders22

This fix is in beta.24, so I'm closing this. If it still happens on beta.24 or later, just leave a comment here and I'll reopen it.

rudyberends avatar Nov 28 '26 18:11 rudyberends

Thanks for closing it. beta.24 is running here (image 7a99016f); if one of the concert recordings with an audio track is missing from the library, I'll comment here.

timanders22 avatar Nov 28 '26 21:11 timanders22