Sign inSign up

salfter/streamshifter

By salfter

Updated over 2 years ago

Image
0

250

salfter/streamshifter repository overview

Capture streaming audio from your favorite sources to build a custom podcast stream. This container builds on the php:fpm container to include tools and scripts for capturing streaming audio, transcoding it to HE-AAC, and storing it as a set of HTTP live streams and a podcast.

Three environment variables are exposed to configure StreamShifter:

  • BASEURL: base URL under which the site will be served (required)
  • CHANNELS: number of audio channels to encode (default 2)
  • BITRATE: encoding bitrate, kbps (default: 32)

The recordings and scripts to be served are stored in a named volume. Configure your webserver to serve it under a vhost by whatever means you would configure it to serve php:fpm.

Start the PHP FPM server with something like this:

docker run -d --name streamshifter -e BASEURL=https://streamshifter.alfter.us/ -v streamshifter-data:/var/www/html salfter/streamshifter

To schedule recordings, use the record.sh script in a running container (use docker exec) with four parameters, all required:

  • duration, seconds
  • short name for the stream (no spaces, used as part of filenames)
  • stream URL
  • long name for the stream (may have spaces, written into stream metadata)

Use whatever task scheduler your system provides (crontab, systemd timer unit, etc.) to run the script at the appropriate time. This example saves 10 seconds of the stream from KDWN, a talk-radio station in Las Vegas (streaming URL subject to change at their whim):

docker exec -it streamshifter record.sh 10 test "https://14983.live.streamtheworld.com/KDWNAMAAC.aac?tdsdk=js-2.9&pname=TDSdk&pversion=2.9&banners=320x50&sbmid=ddc0cb91-c9a7-46c4-bf53-85841c22c8e4" Test

There is also a cleanup script you can run periodically that will remove everything more than one week old:

docker exec -it streamshifter cleanup.sh

Container development happens at https://gitlab.com/salfter/streamshifter.

Tag summary

Content type

Image

Digest

sha256:81b2d5ee4

Size

467.8 MB

Last updated

over 2 years ago

docker pull salfter/streamshifter