diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c80baba..af1eea0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,16 +32,10 @@ jobs: - name: Create Checksum run: | - chmod +x ./burrito_out/* - shasum -a 256 ./burrito_out/* > shinkai_checksums.txt - - - name: Create GitHub Release - id: create_release - uses: actions/create-release@v1 - with: - tag_name: ${{ github.ref_name }} - release_name: Release ${{ github.ref_name }} - draft: true + cd ./burrito_out + chmod +x ./* + shasum -a 256 ./* > shinkai_checksums.txt + cd .. - name: Publish archives and packages uses: softprops/action-gh-release@v1 @@ -50,4 +44,3 @@ jobs: generate_release_notes: true files: | ./burrito_out/* - ./shinkai_checksums.txt diff --git a/README.md b/README.md index 23261b8..5fcb05d 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,15 @@ Live streams can be published to the server using: | Protocol | Variants | Video Codecs | Audio Codecs | |----------|----------|--------------|--------------| -| RTSP client/cameras | TCP/UDP | H264, H265, AV1 | MPEG-4(AAC), G711(PCMA/PCMU) |\ -| RTMP client/publish | - | H264, H265, AV1 | MPEG-4(AAC), G711(PCMA/PCMU) | +| RTSP client/cameras/publish | TCP/UDP | H264, H265, AV1 | MPEG-4(AAC), G711(PCMA/PCMU), Opus | +| RTMP client/publish | - | H264, H265, AV1 | MPEG-4(AAC), G711(PCMA/PCMU), Opus | Live streams can be read from the server with: | Protocol | Variants | Video Codecs | Audio Codecs | |----------|----------|--------------|--------------| | HLS | fMP4/mpeg-ts/Low Latency | H264, H265, AV1 | MPEG-4(AAC) | +| RTMP | - | H264, H265, AV1 | MPEG-4(AAC), G711(PCMA/PCMU), Opus | ## Usage and configuration @@ -29,12 +30,12 @@ Check the [configuration documentation](https://hexdocs.pm/shinkai/Shinkai.html) [HLS](https://developer.apple.com/streaming/) (HTTP Live Streaming) is an http based protocol widely supported on many devices. It works by splitting the media stream into small chunks and serving them over HTTP. You can access the generated HLS by hitting the web page at: -``` +```bash http://localhost:8888/hls/ ``` or get the manifest file link and feed it to your player: -``` +```bash ffplay http://localhost:8888/hls//master.m3u8 ``` @@ -42,12 +43,27 @@ ffplay http://localhost:8888/hls//master.m3u8 [RTMP](https://en.wikipedia.org/wiki/Real-Time_Messaging_Protocol) (Real-Time Messaging Protocol) is a protocol for streaming audio, video, and data over the internet. It is widely used for live streaming applications. To publish a stream to the server using RTMP, you can use `ffmpeg`: -``` +```bash ffmpeg -re -i input.mp4 -c copy -f flv rtmp://localhost:1935/live/test ``` The stream will be available under the name `live-test` for playback. +To play any source using rtmp, you can use the source name as follows: +```bash +rtmp://localhost:1935/ +``` + +### RTSP +[RTSP](https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol) (Real-Time Streaming Protocol) is an application-level network protocol designed for multiplexing and packetizing multimedia transport streams (such as interactive media, video and audio) over a suitable transport protocol. + +To publish a stream to the server using RTSP, you can use `ffmpeg`: +```bash +ffmpeg -re -i input.mp4 -c copy -f rtsp rtsp://localhost:8554/live/test +``` + +The stream will be available under the name `live-test` for playback. + ## Installation The package can be installed by adding `shinkai` to your list of dependencies in `mix.exs`: @@ -55,7 +71,7 @@ The package can be installed by adding `shinkai` to your list of dependencies in ```elixir def deps do [ - {:shinkai, "~> 0.2.0"} + {:shinkai, "~> 0.3.0"} ] end ``` diff --git a/lib/shinkai/application.ex b/lib/shinkai/application.ex index 0d4b0cf..9112a9f 100644 --- a/lib/shinkai/application.ex +++ b/lib/shinkai/application.ex @@ -3,6 +3,8 @@ defmodule Shinkai.Application do use Application + require Logger + alias Shinkai.Sources def start(_type, _args) do @@ -40,6 +42,13 @@ defmodule Shinkai.Application do children end + # Macro.camelize(to_string(:live)) is there to create :live macro + # because burrito releases fails when an rtmp stream is published with + # :live atom not existing. + Logger.info( + "Shinkai #{Macro.camelize(to_string(:live))} Media Server v#{Application.spec(:shinkai, :vsn)}" + ) + opts = [strategy: :one_for_one, name: Shinkai.Supervisor] Supervisor.start_link(children, opts) end diff --git a/mix.exs b/mix.exs index 2c96bc4..657540f 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Shinkai.MixProject do use Mix.Project - @version "0.2.0" + @version "0.3.0" @github_url "https://github.com/elixir-streaming/shinkai" def project do