ZixiPlugin is the tight integration of Zixi SDK to Ant Media Server.
It can connect and pulls the stream from ZixiBroadcaster to Ant Media Server so that you can watch the stream with WebRTC/HLS/DASH etc. on Ant Media Server. In other words, any stream in ZixiBroadcaster can be available in Ant Media Server
It can push the stream in Ant Media Server to ZixiBroadcaster so that any stream ingested by WebRTC, RTSP, RTMP, SRT, etc. in Ant Media Server can be available in ZixiBroadcaster
You can control everything through REST Methods. REST Methods will be available for each application in the Ant Media Server. For all methods, please take a look at the ZixiRestService.java
You need to install Ant Media Server Enterprise Edition in your instance.
ZixiPlugin is compatible with Ant Media Server 2.5.2 and later versions. Current zixi-plugin.jar
is x86_64 compatible.
- Download the pre-built
zixi-plugin.jar
file
wget https://github.com/ant-media/Plugins/raw/master/ZixiPlugin/build/zixi-plugin.jar
- Copy the
zixi-plugin.jar
file toplugins
directory under/usr/local/antmedia
sudo cp zixi-plugin.jar /usr/local/antmedia/plugins
- Restart the service
sudo service antmedia restart
ZixiPlugins have REST Methods so start ZixiClient and ZixiFeeder. Firstly, please install your ZixiBroadcast to your instance. Please reach out to Zixi to have ZixiBroadcaster and instructions.
-
Add a new stream with
Push
type. You can give any name for stream id. In the sample below, we use asstream1
. -
Push a stream to ZixiBroadcaster. You need to have Zixi SDK to push the stream to ZixiBroadcaster. Here are the commands we use to push the stream
$ git clone https://github.com/ant-media/Plugins.git $ cd Plugins/ZixiPlugin/src/test/resources/zixi_sdks-antmedia-16.4.44489/linux64/test/ $ ffmpeg -re -i ../../../test.flv -codec copy -f mpegts udp://127.0.0.1:1234?pkt_size=1316
The command above push the content of a UDP stream to the 1234 port of localhost. In a second terminal go to Zixi SDK directory again
$ cd Plugins/ZixiPlugin/src/test/resources/zixi_sdks-antmedia-16.4.44489/linux64/test/ $ export LD_LIBRARY_PATH=../lib $ ./feeder_interface_tester 1234 127.0.0.1 2088 stream1 1000 10000 0 -1 0
The command above gets the packet from
1234
port and push to the ZixiBroadcasters in127.0.0.1
through2088
port andstream1
channel. -
You must see that
stream1
is online on the ZixiBroadcaster as shown below -
Call the REST Method below to let Ant Media Server pull the stream from ZixiBroadcaster through the following url
zixi://127.0.0.1:2077/stream1
curl -X "POST" http://127.0.0.1:5080/LiveApp/rest/zixi/client?start=true -H 'Content-Type: application/json' -d '{"streamUrl":"zixi://127.0.0.1:2077/stream1"}'
The method should return something below. Please pay attention to
dataId
field because it's the stream id to play the stream in Ant Media Server{"success":"true", "message":"Stream pulling is started for ", "dataId":"zLPmjtlT7whX1670583419181", "errorId":0}
-
Visit
http://AMS_SERVER_IP:5080/LiveApp/player.html
. Write the stream id(zLPmjtlT7whX1670583419181
) to the box below and click theStart Playing
button. -
Stop the streaming from client. Pay attention that the stream id(
zLPmjtlT7whX1670583419181
) is being used in the URLcurl -X "DELETE" http://127.0.0.1:5080/LiveApp/rest/zixi/client/zLPmjtlT7whX1670583419181 -H 'Content-Type: application/json'
-
Add a new stream with
Push
type. You can give any name for stream id. In the sample below, we use asstream2
. -
Publish a stream to Ant Media Server through WebRTC on https://AMS_FQDN_DOMAIN:5443/LiveApp as shown below with 'webrtc_stream'
-
Call the following REST method to push the 'webrtc_stream' to the ZixiBroadcaster. Pay attention that we use
webrtc_stream
in the url below and add the ZixiBroadcaster endpoint as url parameter(zixi://127.0.0.1:2088/stream2
)curl -X "POST" http://127.0.0.1:5080/LiveApp/rest/zixi/feeder/webrtc_stream?url=zixi://127.0.0.1:2088/stream2 -H 'Content-Type: application/json'
-
Go to the ZixiBroadcaster and see that
stream2
is connected on ZixiBroadcaster -
Stop the ZixiFeeder with the following command by using stream id
webrtc_stream
at the end of the urlcurl -X "DELETE" http://127.0.0.1:5080/LiveApp/rest/zixi/feeder/webrtc_stream -H 'Content-Type: application/json'