# ReplayGain: trouble getting GStreamer to work

**URL:** <https://discourse.beets.io/t/replaygain-trouble-getting-gstreamer-to-work/193>\
**Category:** Help\
**Created:** [September 30, 2017, 6:32am UTC](https://discourse.beets.io/t/replaygain-trouble-getting-gstreamer-to-work/193 "2017-09-30T06:32:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorade](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@dorade](https://discourse.beets.io/u/dorade)\
**Post date:** [September 30, 2017, 6:32am UTC](https://discourse.beets.io/t/replaygain-trouble-getting-gstreamer-to-work/193/1 "2017-09-30T06:32:21Z")

</div>

Hello. Can anyone, please, help me to get ReplayGain to work?

My goal is to analyze FLAC files. I figured that that format could be handled by the GStreamer backend. So, on my macOS I installed both GStreamer and its dependency – PyGObject 3.x (python-gi):

```
$brew ls
...
gstreamer
pygobject
pygobject3

```

But when I enable the ReplayGain plugin, beets throws an error:

```
$ beet
error: replaygain initialization failed: Failed to load GStreamer: python-gi not found

```

What am I doing wrong? Is there an easier way to analyze FLACs?

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [October 1, 2017, 2:40am UTC](https://discourse.beets.io/t/replaygain-trouble-getting-gstreamer-to-work/193/2 "2017-10-01T02:40:30Z")

</div>

Huh! GStreamer dependencies can be tricky. Can you check that the Python versions agree—i.e., that both beets and pygobject are installed for either Python 2.x or 3.x?

---

<div class="post-metadata">

**Author:** ![dorade](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@dorade](https://discourse.beets.io/u/dorade)\
**Post date:** [October 1, 2017, 7:50am UTC](https://discourse.beets.io/t/replaygain-trouble-getting-gstreamer-to-work/193/3 "2017-10-01T07:50:58Z")

</div>

Here’s what I get:

```
$ beet version
beets version 1.4.5
Python version 3.6.2

$ brew info pygobject
pygobject: stable 2.28.6 (bottled)
GLib/GObject/GIO Python bindings for Python 2

$ brew info pygobject3
pygobject3: stable 3.26.0 (bottled)

```

Is pygobject for Pyton 2 in conflict with pygobject3? Shall I delete it?

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [October 1, 2017, 2:32pm UTC](https://discourse.beets.io/t/replaygain-trouble-getting-gstreamer-to-work/193/4 "2017-10-01T14:32:16Z")

</div>

Hmm—I’m not familiar enough with the vagaries of Homebrew to know if there’s any manner of conflict. It might be useful to ask there! The goal should be to be able to open a `python3` prompt and type `import gi` without triggering an error.

---

<div class="post-metadata">

**Author:** ![dorade](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@dorade](https://discourse.beets.io/u/dorade)\
**Post date:** [October 1, 2017, 4:11pm UTC](https://discourse.beets.io/t/replaygain-trouble-getting-gstreamer-to-work/193/5 "2017-10-01T16:11:31Z")

</div>

Thanks, Adrian. You’ve pointed me in the right direction and I googled my way to victory:

1. To achieve an errorless `$ python3 -c "import gi`, I did [this](https://github.com/Homebrew/homebrew-core/issues/8403).
2. Then GStreamer started to complain about missing plugins. I did `$ homebrew install gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav` and GStreamer shut up.

Now I must learn to actually use ReplayGain. In your experience, is GStream the best backend for equalizing the loudness of FLACs?

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [October 1, 2017, 5:47pm UTC](https://discourse.beets.io/t/replaygain-trouble-getting-gstreamer-to-work/193/6 "2017-10-01T17:47:20Z")

</div>

Aha! That’s tricky. Maybe we should mention that extra flag in the docs for the RG plugin?

I actually don’t have a solid opinion about which backend produces the best RG results. This actually seems hard to measure—a thorough comparison could be an interesting project if anyone’s interested!
