Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unexpected file type recognition on audio m4a files #3273

@bczhc

Description

@bczhc

What system are you running Yazi on?

Linux X11

What terminal are you running Yazi in?

alacritty 0.12.0-dev (53110c6)

yazi --debug output

Yazi
    Version: 25.9.15 (157156b5 2025-10-23)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.92.0-nightly (fa3155a6 2025-09-30)

Ya
    Version: 25.5.31 (Arch Linux 2025-07-23)

Emulator
    TERM                : Some("xterm-256color")
    TERM_PROGRAM        : None
    TERM_PROGRAM_VERSION: None
    Brand.from_env      : None
    Emulator.detect     : Emulator { kind: Right(Unknown { kgp: false, sixel: true }), light: false, csi_16t: (0, 0), force_16t: false }

Adapter
    Adapter.matches    : Sixel
    Dimension.available: Dimension { rows: 44, columns: 196, width: 2548, height: 1364 }

Desktop
    XDG_SESSION_TYPE           : Some("tty")
    WAYLAND_DISPLAY            : None
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : Some("/bin/zsh")
    EDITOR             : Some("vim")
    VISUAL             : None
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None
    YAZI_ZOXIDE_OPTS   : None
    FZF_DEFAULT_OPTS   : None
    FZF_DEFAULT_COMMAND: Some("fd -HI")

Text Opener
    default     : Some(OpenerRule { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for: None, spread: true })
    block-create: Some(OpenerRule { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for: None, spread: true })
    block-rename: Some(OpenerRule { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : tmux 3.5a
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file          : 5.46
    ueberzugpp    : No such file or directory (os error 2)
    ffmpeg/ffprobe: 7.1.1 / 7.1.1
    pdftoppm      : 25.10.0
    magick        : 7.1.2-2
    fzf           : 0.65.1
    fd/fdfind     : 10.3.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : 1.16.2
    zoxide        : 0.9.8
    7zz/7z        : No such file or directory (os error 2) / 25.01
    resvg         : 0.45.1
    jq            : 1.8.1

Clipboard
    wl-copy/paste: No such file or directory (os error 2) / No such file or directory (os error 2)
    xclip        : 0.13
    xsel         : 1.2.1

Routine
    `file -bL --mime-type`: text/plain


See https://yazi-rs.github.io/docs/plugins/overview#debugging on how to enable logging or debug runtime errors.

Describe the bug

Yazi has different file type recognitions on M4A files with different brands. E.g. Yazi treats Apple iTunes ALAC/AAC-LC (.M4A) Audio as audio files, but MP4 Base Media v1 [ISO 14496-12:2003] as video files and other brands as (fallback?) files (to me they just get opened and played in the browser).

For MP4 Base Media v1 [ISO 14496-12:2003] M4A files, in the spotter view, Yazi shows `ffmpeg` exited with error code: 234. yt-dlp downloads audios in isom m4a and Xiaomi mobile records audio in isom m4a, however Yazi resolves them as video.

Screenshots:

Image Image

Commands to create these demo files:

cat /dev/urandom | ffmpeg -f s8 -i - -t 1s -brand m4a -y 1.m4a
cat /dev/urandom | ffmpeg -f s8 -i - -t 1s -brand isom -y 2.m4a
cat /dev/urandom | ffmpeg -f s8 -i - -t 1s -brand random-nonsense -y 3.m4a

Minimal reproducer

  1. Create three m4a files using the commands above.
  2. Open Yazi.
  3. Observe: content in the spotter view, different menu when pressing O, different program used for opening when pressing o.

Anything else?

The three demo m4a files all get recognized as MPEG-4 Audio in Thunar file explorer which also determines file types by their magic i.e. via file(1), and all get opened using the default audio player (mpv for me for example).

Image Image Image

Checklist

  • I tried the latest nightly build, and the issue is still reproducible
  • I updated the debug information (yazi --debug) input box to the nightly that I tried
  • I can reproduce it after disabling all custom configs/plugins (mv ~/.config/yazi ~/.config/yazi-backup)

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions