Skip to content

Replace taglib-ruby with ffmpeg for metadata operations#54

Merged
pixelate merged 1 commit into
mainfrom
claude/wavesync-crystal-evaluation-A07eM
Apr 25, 2026
Merged

Replace taglib-ruby with ffmpeg for metadata operations#54
pixelate merged 1 commit into
mainfrom
claude/wavesync-crystal-evaluation-A07eM

Conversation

@pixelate
Copy link
Copy Markdown
Owner

@pixelate pixelate commented Apr 20, 2026

Summary

  • Replaces all taglib-ruby usage with ffmpeg/ffprobe for reading and writing BPM metadata across MP3, M4A, AIFF, and WAV formats
  • Adds copy_streams, map_metadata, and metadata builder methods to FFMPEG for stream-copy metadata writes
  • Adds a tags method to FFMPEG::Probe exposing format.tags from ffprobe JSON output
  • Removes taglib-ruby from gemspec, Gemfile, and CI workflows; deletes the taglib RBS stub

How it works

Reading BPM: FFMPEG::Probe#tags returns the format tags hash from ffprobe. bpm_from_mp3/aiff/wav look for the TBPM key; bpm_from_m4a looks for BPM (ffprobe's name for the tmpo atom) and converts to Integer.

Writing BPM / transliterating tags: Uses ffmpeg -i input -c copy -map_metadata 0 -metadata KEY=VALUE output, which copies all existing metadata and overrides specific keys. The original file is replaced with the rewritten output.

Tag transliteration: transliterate_tags reads current tags via ffprobe, identifies which ones changed after NFD normalization, then writes only the changed tags back using ffmpeg's stream-copy metadata path. Unchanged tags survive via -map_metadata 0.

@pixelate pixelate force-pushed the claude/wavesync-crystal-evaluation-A07eM branch from 1769785 to 736d767 Compare April 21, 2026 18:24
BPM reading now uses ffprobe format tags instead of taglib file handles.
BPM writing and tag transliteration use ffmpeg stream copy with -metadata
flags. For MP3 conversion targets, transliterated tag changes are folded
into the transcode ffmpeg call, eliminating the second subprocess that
previously re-muxed the transcoded file just to apply transliteration.

This removes taglib-ruby as a native dependency.
@pixelate pixelate force-pushed the claude/wavesync-crystal-evaluation-A07eM branch from 736d767 to f2c5a16 Compare April 24, 2026 17:59
@pixelate pixelate merged commit 5726249 into main Apr 25, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant