Vivoh Logo

Vivoh Media Relay General Usage

๐Ÿ”—

Usage: ./vivoh-media-relay

Vivoh Media Relay will receive multicast video from a source that is specified as a parameter to the playback URL, for example: http://10.0.0.1:8888/index.m3u8?s=rtp://239.0.0.1:1234

Vivoh Media Relay requires
FFmpeg (http://FFmpeg.org)
Vivoh Media Relay 1.0.36
            
Usage:

vivoh-media-relay -w

REQUIRED:

-w websocket mode 
OR
-h HLS mode

You must specify one of either -h or -w

OPTIONAL:

-p port of local web server ... eg "8888"
-e HTTPS encryption. Uses self-signed certificates unless cert paths specified. 
  e.g.: -e 'key.pem,cert.pem,chain.pem'  
-s "Server Poll" mode (more secure). Specify a URL that will return "on" or 
  "off" as JSON. Override default poll time (10 seconds) via the "-t" switch. 
  Override the port in the JSON response: e.g.: { "on": true, "port": 54321 }

Basic Usage (Websocket Mode)

๐Ÿ”—

Usage: ./vivoh-media-relay -w

Vivoh Media Relay will receive multicast video and relay it via a websocket to the browser.

Access this player page via: http://10.0.0.1:8888/ws.html?s=rtp://239.0.0.1:1234
Vivoh Media Relay 1.0.31

LEGEND
*: Starting FFmpeg process
๐Ÿ›ซ: started listening for playlist requests (HTTP server on)

๐Ÿ›ซ
Listening for connections on 0.0.0.0 on port 8888 

2019-2-24 14:52:03 5185  Rtmp -> 1935
2019-2-24 14:52:03 5185  Http -> 8888
2019-2-24 14:52:03 5185  WebSocket -> 8888
*2019-2-24 14:52:08 5185  [websocket-flv connect] id=5QS39OY2 ip=::1 args={"s":"udp://239.0.0.1:1234"}
2019-2-24 14:52:08 5185  [websocket-flv play] Stream not found. id=5QS39OY2 streamPath=/live/STREAM 
2019-2-24 14:52:13 5185  [rtmp connect] id=BO7KRV58 ip=::1 app=live args={"app":"live","type":"nonprivate","flashVer":"FMLE/3.0 (compatible; Lavf58.12.100)","tcUrl":"rtmp://localhost:1935/live"}
2019-2-24 14:52:13 5185  [rtmp publish] New stream. id=BO7KRV58 streamPath=/live/STREAM streamId=1
2019-2-24 14:52:13 5185  [websocket-flv play] Join stream. id=5QS39OY2 streamPath=/live/STREAM 
2019-2-24 14:52:13 5185  [rtmp publish] Handle video. id=BO7KRV58 streamPath=/live/STREAM frame_type=1 codec_id=7 codec_name=H264 1280x720
2019-2-24 14:52:13 5185  [rtmp publish] Handle audio. id=BO7KRV58 streamPath=/live/STREAM sound_format=10 sound_type=2 sound_size=1 sound_rate=3 codec_name=AAC 96000 0ch
2019-2-24 14:52:13 5185  [rtmp publish] Handle audio. id=BO7KRV58 streamPath=/live/STREAM sound_format=10 sound_type=1 sound_size=1 sound_rate=3 codec_name=AAC 48000 2ch

      

Basic Usage (HLS Mode)

๐Ÿ”—

Usage: ./vivoh-media-relay -h -d /tmp

Vivoh Media Relay starts FFmpeg when the HLS stream is requested and holds open the request until the TS files are ready. When ready, it responds with the playlist.

Access this stream via: http://10.0.0.1:8888/index.m3u8?s=rtp://239.0.0.1:1234
Access player page at http://10.0.0.1:8888/hls.html?s=rtp://239.0.0.1:1234
Vivoh Media Relay 1.0.31

LEGEND

*: Starting FFmpeg process
@: waiting, waiting for the TS files to be ready

Media Relay listening on http://10.0.0.183:8888


*@@@@@@@@@@@@@@@@.....

Server Poll (more secure)

๐Ÿ”—

Usage: ./vivoh-media-relay-linux -d /tmp -s http://broadcaststatus/status.txt

In "Server Poll" mode, Vivoh Media Relay polls a server for status. Vivoh Media Relay does not start listening as a web server until it receives a successful status response from the poll server. It will immediately shutdown its web server when it receives a status message of โ€œoffโ€. You specify a status URL using the -s switch. This server must return either the text "on" or "off", or JSON like { "on" : true }. You can specify the -t switch to indicate the time in seconds you want to wait until polling again (it defaults to 10 seconds). You can also remotely change the port used by Vivoh Media Relay to listen to client requests by adding it to the JSON like { "on": true, "port": 54321 }, however, this will only change if Vivoh Media Relay is not already bound to a port. Unbind Vivoh Media Relay by sending an "off" status.

Access this stream via: http://10.0.0.1:8888/index.m3u8?s=rtp://239.0.0.1:1234
$ ./vivoh-media-relay-linux -h -d /tmp -s http://broadcaststatus/status.txt -t 5

Vivoh Media Relay 1.0.31

LEGEND

*: Starting FFmpeg process
.: TS files and m3u8 file ready, broadcast started
@: holding for the TS files to be ready
๐Ÿ›ซ: started listening for playlist requests (HTTP server on)
๐Ÿ›ฌ: stopped listening for playlist requests (HTTP server off)
โœˆ: the server indicates broadcasting is on
๐Ÿšซ: the server indicates broadcasting is off
โ†ฏ: an error occurred when contacting the server

In POLL (SECURE) mode 
โ†ฏ๐Ÿšซ๐Ÿ“ป๐Ÿ›ซ
Listening for connections on 0.0.0.0 on port 8888

๐Ÿšซ๐Ÿ›ฌ
Shutting down server

๐Ÿšซ๐Ÿ“ป๐Ÿ›ซ
Listening for connections on 0.0.0.0 on port 8888

Custom FFmpeg extras for HLS or Websocket Mode

๐Ÿ”—

Usage: vivoh-media-relay-linux -d tmp -f --ffmpegExtras='-c:a aac -ar 48000 -b:a 128k -c:v h264 -profile:v main -crf 20 -g 48 -keyint_min 48 -sc_threshold 0 -b:v 2500k -maxrate 2675k -bufsize 3750k -hls_time 4 -hls_flags delete_segments'

There may be times when you need to customize the FFmpeg command. You can provide extra switches with the --ffmpegExtras switch

$ vivoh-media-relay-linux -h -d tmp \
--ffmpegExtras='-c:a aac -ar 48000 -b:a 128k -c:v h264 -profile:v main -crf 20 -g 48 -keyint_min 48 -sc_threshold 0 -b:v 2500k -maxrate 2675k -bufsize 3750k -hls_time 4 -hls_flags delete_segments'

Vivoh Media Relay 1.0.31

LEGEND

*: Starting FFmpeg process
.: TS files and m3u8 file ready, broadcast started
@: holding for the TS files to be ready

๐Ÿ›ซ
Listening for connections on 0.0.0.0 on port 8888

*@@@@....