Giter Site home page Giter Site logo

icecast-hls's Introduction

icecast-hls

This is a program that accepts an Icecast stream and re-encodes it into 1 or more HLS streams.

It's main use is with chained Ogg streams with FLAC audio, which allows for in-band metadata, images, etc. It can also work with any other format + codec supported by libavformat/libavcodec - though using a lossless source like FLAC is preferred.

Everything is implemented as a plugin - decoding can be done via different plugins, encoding done via plugins, muxing done via plugins.

The HLS streams can use either packed audio or fragmented MP4. The main benefit to fragmented MP4 is having a wider range of codecs available, and the ability to encode loudness metadata. Both formats allow adding timed ID3 metadata.

Features

  • Reads from standard input, files, and URLs via libCURL.
  • Parses Icecast/Shoutcast metadata.
  • Writes to standard output, files, folders, and URLs, including S3-compatible storage
  • Special support for chained Ogg FLAC.
    • this allows rich in-band metadata and images.
  • Apply filters with libavfilter
  • Multi-threaded encoding.
  • Customizable tag mapping.
  • Encoder plugins for:
  • Output to HLS using packed audio and/or fragmented MP4.
  • Output to Icecast using AAC, MP3, Opus, and FLAC.
  • Embed timed ID3 metadata.
  • Embed album art (either in-band or as a linked image).

Documentation

I've tried to write as extensive documentation as possible as a wiki. It includes details on every plugin and its options, as well as tips on how to produce chained Ogg streams with FLAC audio.

Release tarballs will include an offline copy of the wiki in the docs folder. There will be a pre-generated, standalone HTML file, as well as the original wiki content in Markdown format.

License

MIT, see the file LICENSE.

Some files are third-party and have their own licensing:

  • src/base64decode.h: Public Domain.
  • src/base64encode.h: BSD 3-Clause License
  • src/miniflac.h: BSD Zero Clause License.
  • src/minifmp4.h: BSD Zero Clause License.
  • src/miniogg.h: BSD Zero Clause License.
  • src/ini.h: New BSD License.
  • src/thread.h: Public Domain.

icecast-hls's People

Contributors

jprjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

icecast-hls's Issues

Compiling error - thread.h

I was trying to compile this beautiful project in order to test some functionalities but unfortunately I encountered several issues during the process.

All of the listed dependencies are installed (-dev) but the same issue is still there also if I disable the features.

Commmand:
make ENABLE_CURL=0 ENABLE_AVFORMAT=0 ENABLE_AVCODEC=0 ENABLE_EXHALE=0 ENABLE_FDK_AAC=0 ENABLE_AVFILTER=0

Result:

cc -o icecast-hls src/ini.o src/map.o src/main.o src/membuf.o src/miniflac.o src/minifmp4.o src/codecs.c src/decoder.o src/decoder_plugin.o src/decoder_plugin_auto.o src/decoder_plugin_miniflac.o src/decoder_plugin_passthrough.o src/demuxer.o src/demuxer_plugin.o src/demuxer_plugin_auto.o src/demuxer_plugin_flac.o src/demuxer_plugin_ogg.o src/destination.o src/destinationlist.o src/destination_sync.o src/encoder.o src/encoder_plugin.o src/encoder_plugin_passthrough.o src/filter.o src/filter_plugin.o src/filter_plugin_passthrough.o src/frame.o src/hls.o src/ich_time.o src/id3.o src/input.o src/input_plugin.o src/input_plugin_file.o src/input_plugin_stdin.o src/logger.o src/muxer.o src/muxer_plugin.o src/muxer_plugin_adts.o src/muxer_plugin_flac.o src/muxer_plugin_fmp4.o src/muxer_plugin_ogg.o src/muxer_plugin_ogg_flac.o src/muxer_plugin_ogg_opus.o src/muxer_plugin_packedaudio.o src/muxer_plugin_passthrough.o src/output.o src/output_plugin.o src/output_plugin_file.o src/output_plugin_icecast.o src/output_plugin_stdout.o src/output_plugin_folder.o src/packet.o src/samplefmt.o src/segment.o src/socket.o src/source.o src/sourcelist.o src/source_sync.o src/str.o src/strbuf.o src/tag.o src/tagmap.o src/tagmap_default.o src/thread.o src/version.o src/encoder_plugin_opus.o  -L/usr/local/lib -lopus
/usr/bin/ld: src/thread.o: in function `thread_create':
/user/dev/icecast-hls/src/thread.h:710: undefined reference to `pthread_create'
/usr/bin/ld: src/thread.o: in function `thread_destroy':
/user/dev/icecast-hls/src/thread.h:730: undefined reference to `pthread_join'
/usr/bin/ld: src/thread.o: in function `thread_join':
/user/dev/icecast-hls/src/thread.h:750: undefined reference to `pthread_join'
/usr/bin/ld: src/thread.o: in function `thread_detach':
/user/dev/icecast-hls/src/thread.h:767: undefined reference to `pthread_detach'
/usr/bin/ld: src/thread.o: in function `thread_tls_create':
/user/dev/icecast-hls/src/thread.h:1459: undefined reference to `pthread_key_create'
/usr/bin/ld: src/thread.o: in function `thread_tls_destroy':
/user/dev/icecast-hls/src/thread.h:1478: undefined reference to `pthread_key_delete'
/usr/bin/ld: src/thread.o: in function `thread_tls_set':
/user/dev/icecast-hls/src/thread.h:1494: undefined reference to `pthread_setspecific'
/usr/bin/ld: src/thread.o: in function `thread_tls_get':
/user/dev/icecast-hls/src/thread.h:1510: undefined reference to `pthread_getspecific'
collect2: error: ld returned 1 exit status
make: *** [Makefile:275: icecast-hls] Error 1

Is there anything I'm missing? If I disable only the Exhale feature (since I don't need it now), another error is displayed:

cc -Wall -Wextra -g -O2 -fPIC -I/usr/include/x86_64-linux-gnu -c -o src/avcodec_utils.o src/avcodec_utils.c
cc -Wall -Wextra -g -O2 -fPIC -I/usr/include/x86_64-linux-gnu -c -o src/avframe_utils.o src/avframe_utils.c
cc -Wall -Wextra -g -O2 -fPIC -I/usr/include/x86_64-linux-gnu -c -o src/avpacket_utils.o src/avpacket_utils.c
cc -o icecast-hls src/ini.o src/map.o src/main.o src/membuf.o src/miniflac.o src/minifmp4.o src/codecs.c src/decoder.o src/decoder_plugin.o src/decoder_plugin_auto.o src/decoder_plugin_miniflac.o src/decoder_plugin_passthrough.o src/demuxer.o src/demuxer_plugin.o src/demuxer_plugin_auto.o src/demuxer_plugin_flac.o src/demuxer_plugin_ogg.o src/destination.o src/destinationlist.o src/destination_sync.o src/encoder.o src/encoder_plugin.o src/encoder_plugin_passthrough.o src/filter.o src/filter_plugin.o src/filter_plugin_passthrough.o src/frame.o src/hls.o src/ich_time.o src/id3.o src/input.o src/input_plugin.o src/input_plugin_file.o src/input_plugin_stdin.o src/logger.o src/muxer.o src/muxer_plugin.o src/muxer_plugin_adts.o src/muxer_plugin_flac.o src/muxer_plugin_fmp4.o src/muxer_plugin_ogg.o src/muxer_plugin_ogg_flac.o src/muxer_plugin_ogg_opus.o src/muxer_plugin_packedaudio.o src/muxer_plugin_passthrough.o src/output.o src/output_plugin.o src/output_plugin_file.o src/output_plugin_icecast.o src/output_plugin_stdout.o src/output_plugin_folder.o src/packet.o src/samplefmt.o src/segment.o src/socket.o src/source.o src/sourcelist.o src/source_sync.o src/str.o src/strbuf.o src/tag.o src/tagmap.o src/tagmap_default.o src/thread.o src/version.o src/filter_plugin_avfilter.o src/demuxer_plugin_avformat.o src/encoder_plugin_avcodec.o src/decoder_plugin_avcodec.o src/encoder_plugin_opus.o src/avcodec_utils.o src/avframe_utils.o src/avpacket_utils.o  -L/usr/local/lib -lopus -lavformat -lavfilter -lavcodec -lavutil
/usr/bin/ld: src/thread.o: undefined reference to symbol 'pthread_getspecific@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:275: icecast-hls] Error 1

OS info:

Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal

Thank you!

Compilation errors

Hi,
Am having the below error when i run make command on ubuntu server 18.04.5 LTS. Please help

cc -Wall -Wextra -g -O3 -c -o src/ini.o src/ini.c
cc -Wall -Wextra -g -O3 -c -o src/map.o src/map.c
cc -Wall -Wextra -g -O3 -c -o src/main.o src/main.c
src/main.c: In function ‘main’:
src/main.c:175:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
int main(int argc, const char* argv[]) {
^~~~
cc -Wall -Wextra -g -O3 -c -o src/membuf.o src/membuf.c
cc -Wall -Wextra -g -O3 -c -o src/miniflac.o src/miniflac.c
cc -Wall -Wextra -g -O3 -c -o src/minifmp4.o src/minifmp4.c
cc -Wall -Wextra -g -O3 -c -o src/decoder.o src/decoder.c
cc -Wall -Wextra -g -O3 -DDECODER_PLUGIN_AVCODEC=1 -c -o src/decoder_plugin.o src/decoder_plugin.c
cc -Wall -Wextra -g -O3 -c -o src/decoder_plugin_miniflac.o src/decoder_plugin_miniflac.c
cc -Wall -Wextra -g -O3 -c -o src/destination.o src/destination.c
cc -Wall -Wextra -g -O3 -c -o src/destinationlist.o src/destinationlist.c
cc -Wall -Wextra -g -O3 -c -o src/destination_sync.o src/destination_sync.c
cc -Wall -Wextra -g -O3 -c -o src/encoder.o src/encoder.c
cc -Wall -Wextra -g -O3 -DENCODER_PLUGIN_AVCODEC=1 -DENCODER_PLUGIN_EXHALE=1 -DENCODER_PLUGIN_FDK_AAC=1 -c -o src/encoder_plugin.o src/encoder_plugin.c
cc -Wall -Wextra -g -O3 -c -o src/filter.o src/filter.c
cc -Wall -Wextra -g -O3 -DFILTER_PLUGIN_AVFILTER=1 -c -o src/filter_plugin.o src/filter_plugin.c
cc -Wall -Wextra -g -O3 -c -o src/filter_plugin_buffer.o src/filter_plugin_buffer.c
cc -Wall -Wextra -g -O3 -c -o src/filter_plugin_passthrough.o src/filter_plugin_passthrough.c
cc -Wall -Wextra -g -O3 -c -o src/frame.o src/frame.c
cc -Wall -Wextra -g -O3 -c -o src/hls.o src/hls.c
cc -Wall -Wextra -g -O3 -c -o src/ich_time.o src/ich_time.c
cc -Wall -Wextra -g -O3 -c -o src/id3.o src/id3.c
cc -Wall -Wextra -g -O3 -c -o src/input.o src/input.c
cc -Wall -Wextra -g -O3 -DINPUT_PLUGIN_CURL=1 -c -o src/input_plugin.o src/input_plugin.c
cc -Wall -Wextra -g -O3 -c -o src/input_plugin_file.o src/input_plugin_file.c
cc -Wall -Wextra -g -O3 -c -o src/input_plugin_stdin.o src/input_plugin_stdin.c
cc -Wall -Wextra -g -O3 -c -o src/muxer.o src/muxer.c
cc -Wall -Wextra -g -O3 -c -o src/muxer_plugin.o src/muxer_plugin.c
cc -Wall -Wextra -g -O3 -c -o src/muxer_plugin_fmp4.o src/muxer_plugin_fmp4.c
cc -Wall -Wextra -g -O3 -c -o src/muxer_plugin_packedaudio.o src/muxer_plugin_packedaudio.c
cc -Wall -Wextra -g -O3 -c -o src/output.o src/output.c
cc -Wall -Wextra -g -O3 -DOUTPUT_PLUGIN_CURL=1 -c -o src/output_plugin.o src/output_plugin.c
cc -Wall -Wextra -g -O3 -c -o src/output_plugin_file.o src/output_plugin_file.c
cc -Wall -Wextra -g -O3 -c -o src/output_plugin_stdout.o src/output_plugin_stdout.c
cc -Wall -Wextra -g -O3 -c -o src/output_plugin_folder.o src/output_plugin_folder.c
cc -Wall -Wextra -g -O3 -c -o src/packet.o src/packet.c
cc -Wall -Wextra -g -O3 -c -o src/samplefmt.o src/samplefmt.c
cc -Wall -Wextra -g -O3 -c -o src/source.o src/source.c
cc -Wall -Wextra -g -O3 -c -o src/sourcelist.o src/sourcelist.c
cc -Wall -Wextra -g -O3 -c -o src/source_sync.o src/source_sync.c
cc -Wall -Wextra -g -O3 -c -o src/str.o src/str.c
cc -Wall -Wextra -g -O3 -c -o src/strbuf.o src/strbuf.c
cc -Wall -Wextra -g -O3 -c -o src/tag.o src/tag.c
cc -Wall -Wextra -g -O3 -c -o src/tagmap.o src/tagmap.c
cc -Wall -Wextra -g -O3 -c -o src/tagmap_default.o src/tagmap_default.c
cc -Wall -Wextra -g -O3 -c -o src/thread.o src/thread.c
In file included from src/thread.c:4:0:
src/thread.h: In function ‘thread_create’:
src/thread.h:696:79: warning: unused parameter ‘stack_size’ [-Wunused-parameter]
thread_ptr_t thread_create( int (thread_proc)( void ), void* user_data, int stack_size )
^~~~~~~~~~
src/thread.h: In function ‘thread_signal_init’:
src/thread.h:895:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning( push )

src/thread.h:896:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning( disable: 4214 ) // nonstandard extension used: bit field types other than int

In file included from src/thread.c:4:0:
src/thread.h:898:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning( pop )

src/thread.h: In function ‘thread_timer_init’:
src/thread.h:1375:41: warning: unused parameter ‘timer’ [-Wunused-parameter]
void thread_timer_init( thread_timer_t* timer )
^~~~~
src/thread.h: In function ‘thread_timer_term’:
src/thread.h:1401:41: warning: unused parameter ‘timer’ [-Wunused-parameter]
void thread_timer_term( thread_timer_t* timer )
^~~~~
src/thread.h: In function ‘thread_timer_wait’:
src/thread.h:1421:41: warning: unused parameter ‘timer’ [-Wunused-parameter]
void thread_timer_wait( thread_timer_t* timer, THREAD_U64 nanoseconds )
^~~~~
src/thread.h: In function ‘thread_tls_create’:
src/thread.h:1460:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
return (thread_tls_t) tls;
^
cc -Wall -Wextra -g -O3 -I/usr/include/x86_64-linux-gnu -I/usr/include/x86_64-linux-gnu -c -o src/filter_plugin_avfilter.o src/filter_plugin_avfilter.c
cc -Wall -Wextra -g -O3 -I/usr/include/x86_64-linux-gnu -I/usr/include/x86_64-linux-gnu -c -o src/encoder_plugin_avcodec.o src/encoder_plugin_avcodec.c
In file included from src/encoder_plugin_avcodec.c:4:0:
src/avpacket_utils.h:8:10: fatal error: libavcodec/packet.h: No such file or directory
#include <libavcodec/packet.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:261: recipe for target 'src/encoder_plugin_avcodec.o' failed
make: *** [src/encoder_plugin_avcodec.o] Error 1

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.