Awesome command-line cross-platform media player (including for Android)

Do you have a useful link that involves the Church and the technology discussed on this site? Post your links and resources here.
munaish
Member
Posts: 124
Joined: Sun Apr 01, 2012 1:58 pm

Awesome command-line cross-platform media player (including for Android)

#1

Post by munaish »

Some of you probably have a bunch of mp3s (or other compressed audio) for content pertaining to The Church of Jesus Christ of Latter-day Saints, which you downloaded from churchofjesuschrist.org or its predecessor, whether they be music, audiobooks, General Conference, or whatever.

I imagine some of you use Android, and want to be able to customize your audio media experience, have it be super fast, have keyboard shortcuts, and stuff like that.

Anyway, I've discovered a command-line media player for Termux (which is kind of like a Linux command-line for Android) that has loads of features; it's called mpv (via Termux--not the GUI-based one on Google Play). It's super fast and efficient. You can even make your own features with Lua scripts (and you can do lots of cool stuff with Termux, of course). I'm planning to program a countdown timer that pauses/resumes with play/pause of the media (to make listening to the scriptures for a certain amount of time more convenient).

While it doesn't have DAAP client functionality, you could always set up a local HTTP server on your desktop, and make playlist files of links (from the local website) to run on your Android device with mpv. That would probably be easier to organize, anyway. It does actually stream http links without downloading the whole thing first (I'm testing it on a General Conference session MP3 URL online, now; it started playing almost right away; fast forwarding and rewinding is also fast while streaming).

See this link to an answer to a question on StackExchange for more information about features and how to get started:
https://softwarerecs.stackexchange.com/ ... 3513#83513

Anyway, it's free. No ads. It's open-source.

In my opinion, this software deserves some awards.
Last edited by munaish on Fri Jul 22, 2022 2:23 am, edited 7 times in total.
munaish
Member
Posts: 124
Joined: Sun Apr 01, 2012 1:58 pm

Re: Awesome command-line cross-platform media player (including for Android)

#2

Post by munaish »

For the record, mpv also works for Linux, Windows, MacOS, and you can use it with videos there, too (videos don't work on Termux unless you set up X-windows and do some stuff). I imagine there's probably a Cygwin version, too.

There's also a version for Android that doesn't require Termux, but it seems to be GUI-based and may have more limited functionality because of that. However, it does play videos, unlike the Termux version. I haven't tried it.

Here's the download page if you're not installing via Termux:
https://mpv.io/installation/
Last edited by munaish on Fri Jul 22, 2022 2:26 am, edited 7 times in total.
munaish
Member
Posts: 124
Joined: Sun Apr 01, 2012 1:58 pm

Re: Awesome command-line cross-platform media player (including for Android)

#3

Post by munaish »

If anyone knows any URLs for the Latter-day Saint Channel radio streams that I could pass into mpv, that would be so awesome. They used to have links, but I don't see them anymore; I just see the ability to listen to them on the web-browser and with certain other services (but not with general media players that handle radio stations).
munaish
Member
Posts: 124
Joined: Sun Apr 01, 2012 1:58 pm

Re: Awesome command-line cross-platform media player (including for Android)

#4

Post by munaish »

Now that you've installed mpv, if you have, here's something you can do with it! I collected the mp3 URLs for the April 2022 General Conference, which you can put in an m3u playlist, or such, and play with mpv. It's really nice because they play just like they're downloaded on your device, and you can repeat, shuffle, fast-forward, rewind, skip to the next track, return to the previous track, etc. You can save your position so when you run it again, it continues where it left off in the time on the file and position in the same playlist (shuffled or not). You can have it repeat forever.

Here are the URLs

Full sessions:

Code: Select all

https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-1000-saturday-morning-session-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-2000-saturday-afternoon-session-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-3000-womens-session-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-4000-sunday-morning-session-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-5000-sunday-afternoon-session-32k-eng.mp3
Individual talks:

Code: Select all

https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-1010-russell-m-nelson-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-1020-m-russell-ballard-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-1030-reyna-i-aburto-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-1040-david-a-bednar-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-1050-neil-l-andersen-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-1060-eduardo-gavarret-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-1070-larry-s-kacher-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-1080-henry-b-eyring-32k-eng.mp3

https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-2010-sustaining-of-general-authorities-area-seventies-and-general-officers-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-2020-church-auditing-department-report-2021-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-2030-jeffrey-r-holland-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-2040-patrick-kearon-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-2050-marcos-a-aidukaitis-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-2060-gerrit-w-gong-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-2070-adrian-ochoa-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-2080-kevin-s-hamilton-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-2090-quentin-l-cook-32k-eng.mp3

https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-3010-dallin-h-oaks-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-3020-susan-h-porter-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-3030-rebecca-l-craven-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-3040-video-presentation-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-3050-jean-b-bingham-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-3060-dale-g-renlund-32k-eng.mp3

https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-4010-d-todd-christofferson-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-4020-amy-a-wright-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-4030-gary-e-stevenson-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-4040-michael-t-ringwood-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-4050-ronald-a-rasband-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-4060-hugo-e-martinez-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-4070-russell-m-nelson-32k-eng.mp3

https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-5010-dallin-h-oaks-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-5020-adeyinka-a-ojediran-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-5030-jrg-klebingat-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-5040-mark-l-pace-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-5050-ulisses-soares-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-5060-randy-d-funk-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-5070-dieter-f-uchtdorf-32k-eng.mp3
https://media2.ldscdn.org/assets/general-conference/april-2022-general-conference/2022-04-5080-russell-m-nelson-32k-eng.mp3
To make an m3u playlist, just copy and paste the URLs into a plaintext file and make the file extension .m3u.

While it's not required, you might want to make some bash scripts similar to these, for convenience (don't forget to make them executable, with such as `chmod +x myFileName` and put them in your path if you want that; you'll want to adjust the filepaths below to reflect where you put your m3u files and what you named them, and add or remove --shuffle, depending on if you want it):

Code for the file to execute to play the sessions (name the file whatever you want):

Code: Select all

#!/bin/bash

mpv --loop-playlist --save-position-on-quit /data/data/com.termux/files/home/playlists/gc/2022/april/sessions.m3u
Code for the file to execute to play the talks (name the file whatever you want):

Code: Select all

#!/bin/bash

mpv --shuffle --loop-playlist --save-position-on-quit /data/data/com.termux/files/home/playlists/gc/2022/april/talks.m3u
munaish
Member
Posts: 124
Joined: Sun Apr 01, 2012 1:58 pm

Re: Awesome command-line cross-platform media player (including for Android)

#5

Post by munaish »

If you want to get URLs for General Conference videos (MP4s) instead of the audio MP3s, I know it looks like they don't exist for download anymore, but they do!

The way to get them from an Android 10 device on Chrome is to long-press on the embedded video for General Conference, and then a button pops up that says Asset info. Press that, and it gives you the option to download different qualities of video (which you can stream instead of download with mpv, which you probably only want to do if you're not using Termux, even though it'll still play the audio).

Videos are slower to start streaming than audio, of course.
munaish
Member
Posts: 124
Joined: Sun Apr 01, 2012 1:58 pm

Re: Awesome command-line cross-platform media player (including for Android)

#6

Post by munaish »

I made several m3u playlists for the scriptures to stream with mpv:
scriptures.tar
(2.72 MiB) Downloaded 38 times
(The m3u playlists are files of URLs to mp3s; each mp3 is for a scripture chapter/section/etc.)

You could use them with some other clients besides mpv, I imagine, but mpv is the most convenient one I've found, for me, at least.

A tar file is a compressed file, like zip, for those who don't know. Most decompression programs should be able to extract it.

These playlists are nice, because as long as you're connected to the Internet, you can play them in mpv the same as if they're actually on your device. You can repeat, shuffle, have it remember where you are in the playlist and in the file you're playing, etc. It's fast. It's nice.
munaish
Member
Posts: 124
Joined: Sun Apr 01, 2012 1:58 pm

Re: Awesome command-line cross-platform media player (including for Android)

#7

Post by munaish »

Okay, so I finally tried mpv on Xubuntu (a Linux distribution), and unlike what it does on Termux, it launched a GUI with it by default, which hid many of mpv's features. If that happens with you, and you're listening to audio rather than watching videos, I recommend starting mpv with the `--no-video` flag, like this: `mpv --no-video`, or else the GUI you see won't be the command-line media player I described in previous posts (you can still control it from the command-line even when the GUI is open, however).

I also discovered that if you supply the `--shuffle` flag, it reshuffles every time you open it, even if you used/use `--save-position-on-quit`, instead of finishing the initial shuffled playlist before it shuffles again. So, you might want to remove either the `--shuffle` flag or the `--save-position-on-quit` flag. I'm hoping to program something that accomplishes my desired functionality there, unless such a time as they fix it comes first. Fortunately, it's totally possible to program it.

As a correction to a previous post, tar files aren't compressed, but they are archives (I would have given a zip or something else instead, but it was kind of inconvenient at the time).

Anyway, I made some more m3u playlists of URLs (for Hymns, The Children's Songbook, and scriptures in both English and Spanish; both words, and music and music only are included). Here you go:

scriptures.zip
(186.67 KiB) Downloaded 39 times
music.zip
(66.08 KiB) Downloaded 33 times

I recommend trying this command on the playlist indicated for a nice experience:

`mpv --shuffle --loop-playlist hymnsCSBWAM_English_and_Spanish.m3u`
munaish
Member
Posts: 124
Joined: Sun Apr 01, 2012 1:58 pm

Re: Awesome command-line cross-platform media player (including for Android)

#8

Post by munaish »

I found the radio stream URLs.

radio.zip
(162 Bytes) Downloaded 53 times
munaish
Member
Posts: 124
Joined: Sun Apr 01, 2012 1:58 pm

Re: Awesome command-line cross-platform media player (including for Android)

#9

Post by munaish »

Here's an M3U playlist of all the currently available MP3 General Conference talks (and associated meetings) from April 1971 to October 2022:
General Conference talks.m3u.zip
(29.65 KiB) Downloaded 24 times

So, while the file in the archive above is perfectly usable for streaming with mpv, you should note that you can also use it to download the files, if you have wget installed.

To download them all (so they're on your computer for use without the Internet), unzip the file, install wget (if you don't have it installed already) and from the command-line from the same directory as the .m3u file, type:

wget -i "General Conference talks.m3u"

Make sure you're in the directory where you want the files to download to.

Then all you have to do is wait a really long time, and you should have all the MP3s. You can download the MP3 scriptures and music from the M3U files above, this way, too.
munaish
Member
Posts: 124
Joined: Sun Apr 01, 2012 1:58 pm

Re: Awesome command-line cross-platform media player (including for Android)

#10

Post by munaish »

If you're on Linux or Termux, you can make aliases to make your life easier with mpv.

Open `~/.bashrc` (i.e. type `nano ~/.bashrc`). Then in that file make your aliases. For example, you can type this:

alias mps="mpv --no-video --shuffle --loop-playlist --replaygain=album"
alias mpa="mpv --no-video --save-position-on-quit --replaygain=album"

Then save the file and quit (ctrl+s; ctrl+x).

Then exit your terminal, open it again, and you can type `mps myPlaylist.m3u` instead of `mpv --no-video --shuffle --loop-playlist --replaygain=album myPlaylist.m3u`. This will shuffle and loop the playlist, and is great for streaming.

And you can type `mpa myDirectory` to listen to the files in a directory in order, and have it remember the order (don't use this for streaming, since --save-position-on-quit doesn't work well with that if you lose your Internet connection).
Post Reply

Return to “Links & Resources”