Giter VIP home page Giter VIP logo

goicy's Introduction

goicy - AAC/AACplus/AACplusV2 & MP1/MP2/MP3 Icecast/Shoutcast source client

Screenshots

What's the point?

goicy is a small, portable and fast MPEG1/2/2.5 Layer1/2/3 and AAC/AACplus/AACplusV2 Icecast/Shoutcast source client written in Go. It is written to be extremely light-weight, cross-platform and easy to use. It is a complete rewrite in Go of my old source client called hz and written in Free Pascal: https://github.com/stunndard/hz

How it works?

goicy can work in two modes: ffmpeg and file. In ffmpeg mode goicy feeds audio files to ffmpeg which recodes them in realtime to AAC or MP3 format and sends the output to an Icecast or Shoutcast server.

In file mode goicy reads and parses AAC or MPEG (MP1, MP2, MP3) files and sends them to the server without any further processing.

What files are supported?

In ffmpeg mode: any format of file recognizable by ffmpeg is supported.

In file mode: AAC/AACplus/AACplusV2 and MPEG1/MPEG2/MPEG2.5 LayerI/II/III files can be streamed to a Icecast or Shoutcast server. All possible bitrates are fully supported, including CBR and VBR.

Tell me more.

  • Any audio files readable by ffmpeg are supported. All possible bitrates and their variations, including VBR.
  • Pretty precise timing.
  • Icecast and Shoutcast servers are fully supported.
  • Metadata updating supported. The metadata is read from ID3v1 and ID3v2 tags. It can also be read from cuesheets (.cue file with the same name as audio file).

What platforms are supported?

Linux and Windows at the moment.

What is required?

ffmpeg configured with --enable-libfdk-aac. Compile your own, or get the static compiled binaries, for example here: https://sourceforge.net/projects/ffmpeg-hi/

How do I install goicy?

The go get command will automatically fetch all dependencies required, compile the binary and place it in your $GOPATH/bin directory.

go get github.com/stunndard/goicy

How do I configure it?

Read goicy.ini. Tune it for your needs.

[stream]

; stream type
; must be 'file' or 'ffmpeg'
streamtype = ffmpeg
...

[ffmpeg]

; path to the ffmpeg executable
; can be just ffmpeg or ffmpeg.exe if ffmpeg is in PATH
; your ffmpeg should be compiled with libmp3lame and fdk_aac support enabled!
ffmpeg = ffmpeg-hi10-heaac

; sample rate in Hz
; ffmpeg will use its internal resampler
samplerate = 44100

; number of channels
; 1 = mono, 2 stereo
channels = 2

; AAC stream bitrate
bitrate = 192000

; AAC profile
; must be 'lc' for AAC Low Complexity (LC)
; 'he' for AAC SBR (High Efficiency AAC, HEAAC, AAC+, AACplus)
; 'hev2' for AAC SBR + PS (AACplusV2)
aacprofile = lc

Prepare your static playlist file, like:

/home/goicy/tracks/track1.mp3
/home/goicy/tracks/track2.flac
/home/goicy/tracks/track3.m4a
/home/goicy/tracks/track4.aac
/home/goicy/tracks/track5.ogg

Mixing different formats in one playlist is perfectly valid in ffmpeg mode!

How about a remote file, or a radio station?

http://your.server/your/music.mp3
https://your.box/your/music.mp4
http://your.icecast.radio/

Any input recognizable by ffmpeg is perfectly valid in ffmpeg mode So you can easily reencode and relay internet radios too.

In file mode, though, you can only use AAC or MP1/MP2/MP3 files:

/home/goicy/tracks/track1.aac
/home/goicy/tracks/track2.aac
/home/goicy/tracks/track3.aac
/home/goicy/tracks/track4.aac
/home/goicy/tracks/track5.aac

or

/home/goicy/tracks/track1.mp3
/home/goicy/tracks/track2.mp3
/home/goicy/tracks/track3.mp3
/home/goicy/tracks/track4.mp3
/home/goicy/tracks/track5.mp3

All files should be the same format, bitrate, samplerate and number of channels. Don't mix different format (MPx/AACx) or different samplerate in one playlist if goicy is set to file mode.

How do I run it?

goicy inifile, i.e.:

./goicy /etc/goicy/rock.ini

goicy's People

Contributors

rossb220 avatar stunndard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

goicy's Issues

401 Authentication Required

We have an Icecast2 server and are trying to use goicy as a failover AutoDJ server
This is my goicy ini file's server definition:

`
[server]

; server type
; must be either 'icecast' or 'shoutcast'
server = icecast

; icecast/shoutcast host and port
host = ic.tmw.media
port = 9978

; icecast mountpoint
; valid only for icecast servers
; has no meaning if server is 'shoutcast'
mount = live

; icecast/shoutcast source password
password = [redacted]

; how many times goicy should try to reconnect to a server before giving up
connectionattempts = 5`

But I get a 401 error. Does goicy support Icecast2?

Cannot install on FreeBSD

Hello, I cannot build goicy on FreeBSD:

❯❯❯ go get github.com/stunndard/goicy                                                                                                             
/home/builder/go/src/github.com/stunndard/goicy/goicy.go:6:2: build constraints exclude all Go files in /home/builder/go/src/github.com/stunndard/goicy/daemon
❯❯❯ go version
go version go1.12.5 freebsd/amd64

Is it possible to add FreeBSD as a supported platform?

Use explicit channel-configuration when in ffmpeg-mode

I have encountered an issue when using ffmpeg, libfdk_aac and the he_v2 profile. That profile only supports stereo and some of my tracks in one folder are mono.

Now I have seen that the "-ac"-flag for libmp3lame and libfdk_aac has been commented out. When I comment it in and recompile goicy, all my tracks work fine. Is there a reason for why this has been commented out?

I can open a pull request if you want :)

Is it possible to feed live stream with webcam+mic using ffmpeg to facebook and goicy to shoutcast at the same time using same ffmpeg command?

I have the following ffmpeg running in linux but, hopefully with your help, I can adapt it for windows and have facebook live (mic+webcam) and shoutcast (audio from mic using the webcam) streaming at the same time.

EXEC="/home/ubuntu/encoder/bin/ffmpeg \
        -re \
        -loop 1 \
        -framerate 5 \
        -i $IMAGE \
        -thread_queue_size 1024 \
        -i $SOURCE \
        -profile:v baseline \
        -preset ultrafast \
        -c:v libx264 \
        -tune stillimage \
        -pix_fmt yuv420p \
        -s $SIZE \
        -b:v 750k \
        -maxrate 750k \
        -bufsize 1500k \
        -crf 31 \
        -r 5 \
        -c:a copy \
        -b:a 128k \
        -ar 44100 \
        -g 10 \
        -strict experimental \
        -f flv \
        $FACEBOOK_URL/$FACEBOOK_KEY"

until $EXEC ; do
        echo "$DATE - restarting ffmpeg facebook_live process..."
        sleep 10
done

I know the dshow parameter on ffmpeg can handle the mic and webcam: https://trac.ffmpeg.org/wiki/DirectShow

iTunes Gapless AAC support?

Does this support the iTunes gapless profile for AAC?

Or gapless in mp3?

If I understand correctly gapless is not simply a matter of playing the last bytes of audio from one file directly with the next audio bytes of the next file, but rather looking for a metadata gapless index identifier and stripping the excess bits that pad out the audio frame so that the two files can be joined even when they are split on an unaligned boundary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.