Skip to content

Cannot write tags to adts file produced by ffmpeg #584

Closed

Description

@udoprog

Reproducer

With ffmpeg i've converted a high quality mp3 (320kbps) to a very low quality mp3 (32kbps), and then I'm converting this to high quality adts (192k), and finally I'm trying to write tags using lofty:

> cargo run --example tag_writer -- ghosts-3-09.aac
thread 'main' (51962) panicked at lofty/../examples/tag_writer.rs:39:10:
ERROR: Failed to read file!: FileDecoding(Aac: "File contains an invalid sample frequency index")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The rough ffmpeg sequence is something like this, but note that I am not able to reproduce this with other files:

ffmpeg -i low.mp3 -ab 32k low.mp3
ffmpeg -i low.mp3 -ab 192 -t adts high.aac

Summary

I've tried to reproduce this with other songs, but it only happens with this one. The weird conversions are part of the testing processes of one of my tools.

Note that it can be decoded by ffmpeg on my machine:

> ffmpeg -i ghosts-3-09.aac ghosts-3-09.wav

I've included the .aac file which causes lofty to error in ghosts.zip as an attachment.

Note that the original song is part of Ghosts by Nine Inch Nails, which is BY-NC-SA.

Expected behavior

No response

Assets

ghosts.zip

Activity

  1. added
    bug
    on Dec 20, 2025
  2. added this to the 0.23.0 milestone on Jan 7, 2026
  3. Serial-ATA commented on Jan 7, 2026

    @Serial-ATA
    Owner

    Thanks!

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions