RTMP server and client library for Elixir.
The package can be installed by adding ex_rtmp to your list of dependencies in mix.exs:
def deps do
[
{:ex_rtmp, "~> 0.4.1"}
]
endEnhanced RTMP is supported to some extent, there's a lack of support for Multitrack and ModEx packet types for audio and video.
See the examples folder.
A client publish to an RTMP server and the server stores into flv file.
To publish a stream to the server use ffmpeg:
ffmpeg -re -i input_file.mp4 -c:v copy -c:a copy -f flv rtmp://localhost:1935/live/testThe server stream an mp4 file to connected clients. The mp4 file must have AAC audio and H264/AVC video.
To start the server:
elixir examples/send_mp4.exs "input_file.mp4"and to play the stream, you can use vlc or ffplay:
ffplay -i rtmp://localhost:1935/live/testA client connects to an RTMP server and saves the stream into an flv file.
elixir examples/read_to_flv.exs "rtmp://localhost:1935/live" test output.flvA client publishes an mp4 file to an RTMP server.
elixir examples/publish_mp4.exs "input_file.mp4"