Moonbase59 / loudgain

ReplayGain 2.0 loudness normalizer based on the EBU R128/ITU BS.1770 standard (-18 LUFS, FLAC, Ogg, MP2, MP3, MP4, M4A, AAC, ALAC, Opus, ASF, WMA, WAV, AIFF, WavPack, APE)
Other
190 stars 24 forks source link

MP3 with Lyrics3v2 tag show "Error while sending a packet to the decoder" #11

Open Moonbase59 opened 5 years ago

Moonbase59 commented 5 years ago

When loudgaining MP3 files that have a Lyrics3v2 tag at the end, loudgain will display Error while sending a packet to the decoder for each such file (but still proceed). This is non-critical since the audio data is already fully decoded and the calculated loudness values will be correct.

This has been observed with loudgain v0.6.8. I’m looking for a solution.

In the meantime, one could either ignore the error message or entirely remove the Lyrics3v2 tag.

Lyrics3v2 tags were used with ID3v1/ID3v1.1 in earlier times, and stored at the end of the audio data, just before the ID3v1 tag. Since ID3v2, there are special tag fields for synced and unsynced lyrics (SYLT and USLT frames in ID3v2.3 and ID3v2.4) which should be preferred.

My personal recommendation would be to remove the Lyrics3v2 tags entirely (before loudgaining), and (if needed) use USLT and SYLT for storing lyrics in MP3 files instead.

Moonbase59 commented 5 years ago

Turns out this is an upstream bug in an ffmpeg library that apparently doesn’t understand Lyrics3 tags and thinks these are still audio data.

To reproduce using ffmpeg, take an MP3 file with Lyrics3 tag and try something like:

ffmpeg -v 9 -loglevel 99 -i test.mp3 test.wav

and it will show:

Header missing
Error while decoding stream #0:0: Invalid data found when processing input

Please comment/open an issue with ffmpeg.

Moonbase59 commented 5 years ago

In the meantime, you could use my rmlyrics3 Lyrics3 tag remover to get rid of any Lyrics3 tags in MP3 files.