Skip to content

Webm support #141

Open
Open

Description

@canadaduane

What would it take to support webm format for audio?

My understanding is it is an "audiovisual media file format" so it has both audio and video, but popular websites use this as a container for audio only since it supported by the HTML5 spec.

Activity

  1. added
    enhancement
    on Feb 10, 2023
  2. Serial-ATA commented on Feb 11, 2023

    @Serial-ATA
    Owner

    Matroska support would have to come before WebM, since WebM is a subset of that.

    I've always wanted to support both, but I'm currently very low on time. It could be quite awhile before I'm able to get around to implementing it.

  3. Serial-ATA commented on Jun 8, 2023

    @Serial-ATA
    Owner

    I'll work on this in the next few weeks for 0.15.0. :)

  4. Serial-ATA commented on Aug 5, 2023

    @Serial-ATA
    Owner

    I finally got back around to working on this. Sorry this didn't make 0.15.0. This time I won't make any promises about when I'll get it done 😄.

  5. canadaduane commented on Aug 6, 2023

    @canadaduane
    Author

    No need to apologize! Your working on it is a gift to the audio-listening community :)

  6. added this to the 0.22.0 milestone on Jul 29, 2024
  7. modified the milestones: 0.22.0, 0.23.0 on Jul 8, 2025
  8. Serial-ATA commented on Jul 12, 2025

    @Serial-ATA
    Owner

    #218 is almost done now. There are still a few features to work on, like cover art support. But you can read/write tags and most audio properties are supported. If anyone has files in their library to test with that'd be great.

    @milesegan @uklotzde any chance you have Matroska/WebM files in your libraries?

  9. milesegan commented on Jul 12, 2025

    @milesegan

    Sure I can do some testing of this.

  10. milesegan commented on Jul 12, 2025

    @milesegan

    Ok here's some test data. I took a free mp3 from archive.org and transcoded it to webm using this command:

    ❯ ffmpeg -i test.mp3 -c:a libopus -b:a 128k -map_metadata 0 -vn test.webm
    

    When I then run the lofty tag_reader example from the matroska branch on the file it doesn't seem to pick up the tags. Should this work?

    ...
    warning: `lofty` (lib) generated 5 warnings
        Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
         Running `target/debug/examples/tag_reader /Users/miles/dl/output.webm`
    --- Tag Information ---
    Title: None
    Artist: None
    Album: None
    Genre: None
    Album Artist: BUDDY CLARK, Bud Freeman, Morey Feld, Jess Stacy, Marty Marsala, Brad Gowans, Pee Wee Russell, Sid Weiss, Mack Gordon
    --- Audio Properties ---
    Bitrate (Audio): 0
    Bitrate (Overall): 0
    Sample Rate: 48000
    Bit depth: 32
    Channels: 2
    

    ffprobe seems to be able to read the tag:

    ❯ ffprobe test.webm
    Input #0, matroska,webm, from 'test.webm':
      Metadata:
        title           : THIS IS THE BEGINNING OF THE END (El Principio del Fin)
        COMMENT         : https://archive.org/details/78_this-is-the-beginning-of-the-end-el-principio-del-fin_buddy-clark-bud-freeman-mor_gbia0349177b
        ARTIST          : BUDDY CLARK, Bud Freeman, Morey Feld, Jess Stacy, Marty Marsala, Brad Gowans, Pee Wee Russell, Sid Weiss, Mack Gordon
        track           : 01
        ALBUM           : THIS IS THE BEGINNING OF THE END (El Principio del Fin)
        GENRE           : Fox-Trot
        TLEN            : 175.19
        ENCODER         : Lavf61.7.100
      Duration: 00:02:55.20, start: -0.007000, bitrate: 145 kb/s
      Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
          Metadata:
            ENCODER         : Lavc61.19.101 libopus
            DURATION        : 00:02:55.202000000
    

    webm-tag-test.zip

  11. Serial-ATA commented on Jul 12, 2025

    @Serial-ATA
    Owner

    FFmpeg doesn't handle Matroska metadata correctly at all right now: #218 (comment)

    There's a patch that'd make it significantly better, but who knows when/if that'll get in.

    I'm not really sure where to get real world Matroska files, it's not super well supported by taggers.

  12. milesegan commented on Jul 12, 2025

    @milesegan

    Interesting I had no idea. Here's another mka I created using the mkvmerge command. Do you know if VLC is more standard compliant for reading tags? When I open that webm in VLC it doesn't find any tags but it does for this mka. The matroska branch of lofty doesn't seem to but I'm not sure if these tags are standard either. I don't know much about mka.

    test.mka.zip

    Image
  13. milesegan commented on Jul 12, 2025

    @milesegan

    There are also some test files here that seem to crash the current matroska branch but do scan ok in VLC & ffmpeg. Apologies if these are also non or pre-standard:

    https://github.com/ietf-wg-cellar/matroska-test-files

  14. Serial-ATA commented on Jul 12, 2025

    @Serial-ATA
    Owner

    The tags in test.mka look a lot better. They don't show up with the tag_reader though since they're attached to an audio track.

    Matroska lets you optionally attach tags to specific audio/video tracks, chapters, and AttachedFiles. Those tags are read, and you can see them in the MatroskaTag, but when they get converted to Tag they get ignored:

    let target_type = match &t.target {
    Some(t) if !t.has_uids() => t.target_type,
    // We cannot use any tags bound to uids
    Some(_) => return TAG_RETAINED,
    None => TargetType::default(),
    };

    Didn't think that feature was actually used. Good to know. Not really sure how to retain that information though, especially since you can write a Tag to many different files, in which case the track UID would be garbage.

    Also good to know that the official test files crash. I have them in the test assets and forgot to actually make tests for them.

  15. akashskypatel commented on Sep 10, 2025

    @akashskypatel

    Would this solution also include WebA, the audio-only portion of a WebM file?

  16. Serial-ATA commented on Sep 11, 2025

    @Serial-ATA
    Owner

    @akashskypatel Yes, they should be fine assuming they're just WebM files that only have audio tracks. Lofty only cares about the audio tracks, anyway.

  17. modified the milestones: 0.23.0, 0.24.0 on Jan 31, 2026
  18. removed this from the 0.24.0 milestone on Jun 10, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions