Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Replaygain tags stripped from opus #2999

Closed
3 tasks done
c0utta opened this issue May 6, 2024 · 6 comments
Closed
3 tasks done

[Bug]: Replaygain tags stripped from opus #2999

c0utta opened this issue May 6, 2024 · 6 comments
Labels
bug triage New bug reports that need to be evaluated

Comments

@c0utta
Copy link

c0utta commented May 6, 2024

I confirm that:

  • I have searched the existing open AND closed issues to see if an issue already exists for the bug I've encountered
  • I'm using the latest version (your issue may have been fixed already)

Version

0.52.0

Current Behavior

Navidrome strips out Replaygain tags when transcoding to opus. MP3 is fine.

Expected Behavior

Tags available to be read by applications

Steps To Reproduce

Using the Web UI, download an opus transcoded file with Replaygain tags and review the tags of the resulting file.

Environment

- OS: Debian 10
- Browser: Edge 124.0.2478.51 (Official build) (64-bit) on Windows 11
- Client: dSub, Symfonium

How Navidrome is installed?

Binary (from downloads page)

Configuration

MusicFolder="/mnt"
DevActivityPanel=false
EnableStarRating=false
SessionTimeout="72h"
EnableExternalServices=false

Relevant log output

No response

Anything else?

No response

Code of Conduct

  • I agree to follow Navidrome's Code of Conduct
@c0utta c0utta added bug triage New bug reports that need to be evaluated labels May 6, 2024
@c0utta
Copy link
Author

c0utta commented May 6, 2024

When I use the transcode command:
ffmpeg -i %s -map 0:0 -b:a 256k -v 0 -c:a libopus -f opus test.opus

test.opus does have the replay gain tags :

Input #0, ogg, from 'test.opus':
Duration: 00:03:18.55, start: 0.000000, bitrate: 261 kb/s
Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
Metadata:
encoder : Lavc58.91.100 libopus
ALBUM : UK GRIM
ARTIST : Sleaford Mods
DATE : 2023
TITLE : UK GRIM
TRACKTOTAL : 1
track : 1
replaygain_album_gain: -9.34 dB
replaygain_album_peak: 0.988739
replaygain_track_gain: -10.02 dB
replaygain_track_peak: 0.988739

@deluan
Copy link
Member

deluan commented May 8, 2024

I was not able to reproduce your issue. I just dowloaded a song from my library with transcoding to Opus, and this is what I get:

$ ffmpeg -i ~/Downloads/Crush\!.opus                                                                                                                                                            
ffmpeg version 7.0 Copyright (c) 2000-2024 the FFmpeg developers
Input #0, ogg, from '/Users/deluan/Downloads/Crush!.opus':
  Duration: 00:03:41.58, start: 0.000000, bitrate: 127 kb/s
  Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
      Metadata:
        encoder         : Lavc61.3.100 libopus
        ALBUMARTISTSORT : SOIL&“PIMP”SESSIONS
        MUSICBRAINZ_ALBUMARTISTID: b8e2848f-f5e1-448d-94cf-990c2983c05c
        track           : 1
        TOTALTRACKS     : 4
        MUSICBRAINZ_ALBUMID: 9f004609-38e1-4829-96ca-38a50eed29f1
        ORIGINALDATE    : 2006-02-08
        MEDIA           : CD
        ISRC            : JPVI00545970;JPVI00601960
        TOTALDISCS      : 1
        ARTISTS         : SOIL&“PIMP”SESSIONS
        ORIGINALYEAR    : 2006
        BARCODE         : 4988002495887
        ASIN            : B000CIXKOI
        GENRE           : Contemporary Jazz;Jazz
        RELEASETYPE     : ep
        RELEASESTATUS   : official
        DATE            : 2006-02-08
        MUSICBRAINZ_ARTISTID: b8e2848f-f5e1-448d-94cf-990c2983c05c
        REPLAYGAIN_ALBUM_PEAK: 1.000000
        MUSICBRAINZ_RELEASETRACKID: d9064f7d-4815-3d8b-a384-3bd6d1175f1b
        REPLAYGAIN_TRACK_GAIN: -9.50 dB
        album_artist    : SOIL&“PIMP”SESSIONS
        MUSICBRAINZ_TRACKID: 26034dc5-1e81-4f60-828e-586ec5f455ce
        MUSICBRAINZ_RELEASEGROUPID: 4361621b-83e6-3958-aa50-84a339d5b785
        CATALOGNUMBER   : VICL-35950
        TITLE           : Crush!
        RELEASECOUNTRY  : JP
        ARTIST          : SOIL&“PIMP”SESSIONS
        disc            : 1
        ARTISTSORT      : SOIL&“PIMP”SESSIONS
        SCRIPT          : Latn
        REPLAYGAIN_ALBUM_GAIN: -8.86 dB
        ALBUM           : Crush!
        LABEL           : Victor
        REPLAYGAIN_TRACK_PEAK: 1.000000
        TRACKTOTAL      : 4
        DISCTOTAL       : 1

You can see the RG tags are present. Not sure what could be happening in your case.

@c0utta
Copy link
Author

c0utta commented May 8, 2024

Isn't that strange?

The downloaded original and MP3 versions from the WebUI have the replay gain tags present.

The opus version still strips out the tags.

I have loaded the three files with foobar and the opus shows no replay gain tags.

Is it worth your valuable time to trace this issue? I'm happy to just use mp3 with dSub via "Players".

Thanks for your work. Navidrome is awesome

@deluan
Copy link
Member

deluan commented May 8, 2024

I can assure you Navidrome does not touch any tags in the transcoded OR original file.

One thing I can see is that the transcode command you posted above is not the one used by default by Navidrome.

Yours:

ffmpeg -i %s -map 0:0 -b:a 256k -v 0 -c:a libopus -f opus test.opus

ND Default:

ffmpeg -i %s -map 0:a:0 -b:a 256k -v 0 -c:a libopus -f opus test.opus

Not sure if this would make any difference though.
Did you change the transcoding command?

@c0utta
Copy link
Author

c0utta commented May 9, 2024

Hi Deluan,

No, I didn't change the transcoding command as I didn't even know I could! My Navidrome installation is approximately 2 years old, and I upgrade from binary download. Did the transcoding commands change in the last 2 years?

mp3 = ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -
opus = ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -c:a libopus -f opus -

I have now changed them to:

mp3 = ffmpeg -i %s -map 0:a:0 -b:a %bk -v 0 -f mp3 -
opus = ffmpeg -i %s -map 0:a:0 -b:a %bk -v 0 -c:a libopus -f opus -

Ffmeg shows that downloaded flac, mp3 and opus have the replay gain tags.

Some interesting differences:

  • the flac & mp3 have "Side data" whereas the opus does not:
    Side data:
      replaygain: track gain - -10.020000, track peak - 0.000023, album gain - -9.340000, album peak - 0.000023, 
  • the flac has the album art imbedded (the original has no imbedded album art)
    Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 700x700 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Cover (front)

I'm not actually sure what any of this means!

Now when I try to download opus I get a zero length file, so I'm going to give up for now. Even after clearing the cache.

@c0utta
Copy link
Author

c0utta commented May 12, 2024

Deluan - I agree this is not Navidrome so I will close this issue.

I think dSub is stripping the replaygain tags out of the opus. I can also see that the opus has a flac extension too.

Sorry to trouble you.

@c0utta c0utta closed this as completed May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage New bug reports that need to be evaluated
Projects
None yet
Development

No branches or pull requests

2 participants