Skip to content

[Bug]: Audiobookshelf ignores embedded title from m4a files #5639

Open

Description

@burgerga

What happened?

I imported a directory of m4a files, which I have tagged with mp3tag.
However, instead of the tagged titles, Audiobookshelf uses the filename without extension (e.g., 01 Ik Ben Benjamin Ben, with the track number) as chapter name, even though it is able to read the embedded metadata:

Image

For completeness, the probe information:

{
  "programs": [],
  "streams": [
    {
      "index": 0,
      "codec_name": "aac",
      "codec_long_name": "AAC (Advanced Audio Coding)",
      "profile": "LC",
      "codec_type": "audio",
      "codec_tag_string": "mp4a",
      "codec_tag": "0x6134706d",
      "sample_fmt": "fltp",
      "sample_rate": "44100",
      "channels": 2,
      "channel_layout": "stereo",
      "bits_per_sample": 0,
      "id": "0x1",
      "r_frame_rate": "0/0",
      "avg_frame_rate": "0/0",
      "time_base": "1/44100",
      "start_pts": 2112,
      "start_time": "0.047891",
      "duration_ts": 1568768,
      "duration": "35.572971",
      "bit_rate": "248570",
      "nb_frames": "1532",
      "extradata_size": 2,
      "disposition": {
        "default": 1,
        "dub": 0,
        "original": 0,
        "comment": 0,
        "lyrics": 0,
        "karaoke": 0,
        "forced": 0,
        "hearing_impaired": 0,
        "visual_impaired": 0,
        "clean_effects": 0,
        "attached_pic": 0,
        "timed_thumbnails": 0,
        "captions": 0,
        "descriptions": 0,
        "metadata": 0,
        "dependent": 0,
        "still_image": 0
      },
      "tags": {
        "creation_time": "2026-07-17T09:27:04.000000Z",
        "language": "und",
        "vendor_id": "[0][0][0][0]"
      }
    },
    {
      "index": 1,
      "codec_name": "mjpeg",
      "codec_long_name": "Motion JPEG",
      "profile": "Baseline",
      "codec_type": "video",
      "codec_tag_string": "[0][0][0][0]",
      "codec_tag": "0x0000",
      "width": 600,
      "height": 591,
      "coded_width": 600,
      "coded_height": 591,
      "closed_captions": 0,
      "film_grain": 0,
      "has_b_frames": 0,
      "pix_fmt": "yuvj444p",
      "level": -99,
      "color_range": "pc",
      "color_space": "bt470bg",
      "chroma_location": "center",
      "refs": 1,
      "id": "0x0",
      "r_frame_rate": "90000/1",
      "avg_frame_rate": "0/0",
      "time_base": "1/90000",
      "start_pts": 4310,
      "start_time": "0.047889",
      "duration_ts": 3201567,
      "duration": "35.572967",
      "bits_per_raw_sample": "8",
      "disposition": {
        "default": 0,
        "dub": 0,
        "original": 0,
        "comment": 0,
        "lyrics": 0,
        "karaoke": 0,
        "forced": 0,
        "hearing_impaired": 0,
        "visual_impaired": 0,
        "clean_effects": 0,
        "attached_pic": 1,
        "timed_thumbnails": 0,
        "captions": 0,
        "descriptions": 0,
        "metadata": 0,
        "dependent": 0,
        "still_image": 0
      }
    }
  ],
  "chapters": [],
  "format": {
    "filename": "/data/kids/Ik Ben Benjamin Ben/01 Ik Ben Benjamin Ben.m4a",
    "nb_streams": 2,
    "nb_programs": 0,
    "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
    "format_long_name": "QuickTime / MOV",
    "start_time": "0.047889",
    "duration": "35.572971",
    "size": "1238635",
    "bit_rate": "278556",
    "probe_score": 100,
    "tags": {
      "major_brand": "M4A ",
      "minor_version": "0",
      "compatible_brands": "M4A mp42isom",
      "creation_time": "2026-07-17T09:27:04.000000Z",
      "Encoding Params": "vers",
      "track": "1/35",
      "compilation": "0",
      "gapless_playback": "0",
      "genre": "Children's",
      "date": "1998",
      "WWW": "https://www.discogs.com/release/9363345-Marja-Hofstee-Bill-Angel-Ik-Ben-Benjamin-Ben",
      "encoder": "Muziek 1.5.6.11",
      "title": "Ik Ben Benjamin Ben",
      "STYLE": "Story, Nursery Rhymes",
      "MEDIATYPE": "CD (Album)",
      "iTunSMPB": " 00000000 00000840 0000032C 000000000017E494 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000",
      "iTunNORM": " 0000030B 000002BE 0000258C 000022A9 000059CB 000059CB 00005C45 000052C5 000050D0 000050D0",
      "iTunes_CDDB_TrackNumber": "1",
      "iTunes_CDDB_1": "F00BCE23+226800+35+182+2845+6595+18607+23457+31145+34157+41545+44582+52595+56057+69232+73495+79695+82720+90407+93620+105320+112457+114957+128332+132470+141782+145657+157682+161470+169720+173670+181470+184970+199170+202445+213595+217295+224445",
      "DISCOGS_RELEASE_ID": "9363345",
      "COUNTRY": "Netherlands",
      "composer": "Harry Govers",
      "CATALOGNUMBER": "SABRA 393-2",
      "artist": "Marja Hofstee, Bill Angel",
      "sort_album_artist": "Marja Hofstee, Bill Angel",
      "album": "Ik Ben Benjamin Ben"
    }
  }
}

The metadata priority order is the default.

What did you expect to happen?

It should use the embedded titles

Steps to reproduce the issue

  1. Copy tagged files into library folder
  2. Click Scan in library overview
  3. Watch audiobook show up
  4. Observe incorrect titles

Audiobookshelf version

v2.37.1

How are you running audiobookshelf?

Debian/PPA

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Chrome

Logs

root@audiobookshelf:/usr/share/audiobookshelf/metadata/items# cat /usr/share/audiobookshelf/metadata/logs/scans/2026-10-07_8348f7b7-eb88-48e4-b1b9-eafa1c1af27a.txt
{"id":"8348f7b7-eb88-48e4-b1b9-eafa1c1af27a","type":"scan","library":{"id":"a3becf83-d218-48b1-ab6f-b2cb9ea09bdf","name":"Kids","displayOrder":3,"icon":"star","mediaType":"book","provider":"google","lastScan":"2026-10-07T10:38:48.519Z","lastScanVersion":"2.37.1","settings":{"coverAspectRatio":1,"disableWatcher":false,"autoScanCronExpression":null,"skipMatchingMediaWithAsin":false,"skipMatchingMediaWithIsbn":false,"audiobooksOnly":true,"epubsAllowScriptedContent":false,"hideSingleBookSeries":false,"onlyShowLaterBooksInContinueSeries":false,"metadataPrecedence":["folderStructure","audioMetatags","nfoFile","txtFiles","opfFile","absMetadata"],"markAsFinishedPercentComplete":null,"markAsFinishedTimeRemaining":10},"extraData":{"lastScanMetadataPrecedence":["folderStructure","audioMetatags","nfoFile","txtFiles","opfFile","absMetadata"]},"createdAt":"2026-01-16T14:38:53.379Z","updatedAt":"2026-10-07T10:38:48.519Z","libraryFolders":[{"id":"5da2f701-9cff-4707-bad1-ad7baff9464f","path":"/data/kids","createdAt":"2026-01-16T14:38:53.388Z","updatedAt":"2026-01-16T14:38:53.388Z","libraryId":"a3becf83-d218-48b1-ab6f-b2cb9ea09bdf"}]},"startedAt":1791369528305,"finishedAt":1791369528519,"elapsed":214,"resultsAdded":1,"resultsUpdated":0,"resultsMissing":0}
{"timestamp":"2026-10-07T10:38:48.313Z","message":"16 item data found in folder \"/data/kids\"","levelName":"INFO","level":2}
<SNIP UP-TO-DATE ITEMS>
{"timestamp":"2026-10-07T10:38:48.442Z","message":"\"Ik Ben Benjamin Ben\" Getting metadata with precedence [folderStructure, audioMetatags, nfoFile, txtFiles, opfFile, absMetadata]","levelName":"DEBUG","level":1}
{"timestamp":"2026-10-07T10:38:48.454Z","message":"Extracted embedded cover from audio file at \"/usr/share/audiobookshelf/metadata/items/b07f02fe-147a-4252-8fd2-cb92b02e9951/cover.jpg\" for book \"Ik Ben Benjamin Ben\"","levelName":"DEBUG","level":1}
{"timestamp":"2026-10-07T10:38:48.517Z","message":"Success saving abmetadata to \"/usr/share/audiobookshelf/metadata/items/b07f02fe-147a-4252-8fd2-cb92b02e9951/metadata.json\"","levelName":"DEBUG","level":1}
{"timestamp":"2026-10-07T10:38:48.518Z","message":"Created new library item \"Ik Ben Benjamin Ben\" with id \"b07f02fe-147a-4252-8fd2-cb92b02e9951\"","levelName":"INFO","level":2}
{"timestamp":"2026-10-07T10:38:48.519Z","message":"Scan completed. 1 Added | 0 Updated | 0 Missing","levelName":"INFO","level":2}

Additional Notes

For the above log, I deleted the audiobook from ABS, then did a library scan.

Activity

  1. Christian-Sidak commented on Oct 11, 2026

    @Christian-Sidak

    Opened a fix in #5649: removes the filter in AudioFileScanner that was incorrectly excluding embedded ID3 titles when they matched the book title, so M4A files with a matching embedded title now use it correctly.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions