My answer to "What song is that?" during art streams in OBS:

Home Forums General Banter My answer to "What song is that?" during art streams in OBS:

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #67510

    So I do art streams. A lot of people like me have a media player running in the background so people can have something to listen to whilst we do our thing. Now, for whatever reason, people inevitably ask what song is playing, so instead of having to stop arting so we can answer the question, we opt to have the song info rendered on top of the stream using text sources in OBS.

    Under Windows, it’s as easy as this:
    https://www.youtube.com/watch?v=WbBB1_5DRvc

    But under Linux, there was no such simple solution… So I said “FUCK IT”, did a table flip, and made this puppy: https://github.com/aFoxNamedMorris/grab-song/blob/master/grab-song.sh

    Requires qdbus and ImageMagick to run.
    Supports any MPRIS enabled media player.

    Must (for now) be run from the directory that it’s stored in.
    WIP! There are a few bugs, and it is not entirely finished.

    Outputs the song title, artist, and album data, as well as the album art to the ‘Output’ subdirectory.
    If no album art is found, a generic one is substituted in. The album art is always converted to a 500x500px AlbumArt.jpg so as to keep your OBS scene composition uniform between data updates.

    Usage:

    Code:
    ./grab-song.sh <player>

    Keep in mind that you must have your player of choice running or the script will produce errors.

    Examples:

    Code:
    ./grab-song.sh pithos
    ./grab-song.sh audacious
    ./grab-song.sh clementine
    ./grab-song.sh vlc
    ./grab-song.sh NuvolaAppSpotify

    The script will remember the last player specified, so it can be run without having to specify the player each time.

    A utility is included which will list the available players’ arguments, so you don’t have to guess. It can also be paired with the ‘watch -t’ command to give a real(ish)-time update, so as to avoid having to rerun the utility each time a new media player is started.

    Usages:

    Code:
    ./check-media-players.sh
    watch -t ./check-media-players.sh

    In OBS, add the necessary text and/or image sources, and point them to their respective files in the ‘Output’ subdirectory. OBS will automagically reload the sources each time grab-song.sh updates them.

    There you have it! Hope this is useful to somebody out there.

    SCREENSHOTS OR IT DIDN’T HAPPEN:
    Y4gMWT8.png
    w7qyWei.png
    yXXAgOG.png

    DOWNLOAD:
    https://github.com/aFoxNamedMorris/grab-song/archive/master.zip

    Constructive criticism, bug reports, and testing on non-Ubuntu distros is much appreciated.

    If you would like to contribute, please feel free to fork the project on GitHub. https://github.com/aFoxNamedMorris/grab-song

    #76049
    strider
    Participant

    That’s really cool and way better looking than the Windows alternative! I’ll try it soon!

    As for criticism, having this on Github would be way better than Google Drive :p

    #76050
    strider wrote:
    That’s really cool and way better looking than the Windows alternative! I’ll try it soon!

    As for criticism, having this on Github would be way better than Google Drive :p

    I appreciate the compliment. However, it feels weird to me because it’s just a command line tool. The screenshots are of the final output of the script that has been customized with extra fonts and images in OBS.

    The most fun and satisfying part for me is that unlike the Windows equivalent, my tool grabs the album art. Hehe.

    You’re right, of course, about Github. But make no buts about it, I intended to host the scripts there from the start. I’d just rather wait until the thing is more polished before I share it. I need to make the verbosity optional, defaulting to false. I also need to make it possible to change the player selection while the script is still active. I also intend to either make a GUI frontend or find somebody willing to make one for me.

    #76051
    strider
    Participant
    aFoxNamedMorris wrote:
    I’d just rather wait until the thing is more polished before I share it.

    I tend to hear that a lot but IMO, there’s nothing wrong with having Github repos with early stage code. I even have repos that have little more than a README and a vague idea of what’s going on!

    Take Icculus’ version of the Serious Engine for example. It’s far from usable right now but it’s been on Github since it was possible for him to legally share the code.

    #76052

    I really hope you will add this to the OBS plugin forum as there is a severe lack of plugins that support Linux currently on there

    #76053
    strider wrote:
    aFoxNamedMorris wrote:
    I’d just rather wait until the thing is more polished before I share it.

    I tend to hear that a lot but IMO, there’s nothing wrong with having Github repos with early stage code. I even have repos that have little more than a README and a vague idea of what’s going on!

    Take Icculus’ version of the Serious Engine for example. It’s far from usable right now but it’s been on Github since it was possible for him to legally share the code.

    You have a valid point. Besides, I could use all the help I can get.

    Here, have a link:
    https://github.com/aFoxNamedMorris/grab-song

    Lord Drachenblut wrote:
    I really hope you will add this to the OBS plugin forum as there is a severe lack of plugins that support Linux currently on there

    I agree, wholeheartedly.
    As a matter of fact, the name of the directory I keep this project in on my machine is ‘OBS-Addon-NowPlaying’. I fully intend to present it for possible adoption at some point.

    #76054
    strider
    Participant

    Neat! I’ll try out this and probably send some pull requests your way.

    #76059

    Looking forward to it, dude! :D You do very impressive work.

    #76061
    MichaelP
    Member

    This is why I like the Linux Community, two thumbs up.

    #76062
    MichaelP wrote:
    This is why I like the Linux Community, two thumbs up.

    Back at ya! :D Glad you like my work.

    #76063
    __eMpTy__
    Participant
    aFoxNamedMorris wrote:
    So I do art streams.

    Just curious: an “art stream” is what exactly?

    #76064
    Frojoe
    Keymaster
    __eMpTy__ wrote:
    aFoxNamedMorris wrote:
    So I do art streams.

    Just curious: an “art stream” is what exactly?

    Gonna hazard a guess here and say a stream where someone draws? That or someone actually drawing pictures in the snow with urine.

    #76066
    Frojoe wrote:
    __eMpTy__ wrote:
    aFoxNamedMorris wrote:
    So I do art streams.

    Just curious: an “art stream” is what exactly?

    Gonna hazard a guess here and say a stream where someone draws? That or someone actually drawing pictures in the snow with urine.

    The former. I draw airships and fantasy characters and such while people watch and critique.

    #76067
    __eMpTy__
    Participant
    aFoxNamedMorris wrote:
    Frojoe wrote:
    __eMpTy__ wrote:
    Just curious: an “art stream” is what exactly?

    Gonna hazard a guess here and say a stream where someone draws? That or someone actually drawing pictures in the snow with urine.

    The former. I draw airships and fantasy characters and such while people watch and critique.

    That’s cool. I’ll have to check out one sometime.

    #76068

    For a few examples, check out https://picarto.tv/.

    EDIT: Updated the original post with current links and info.

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.