如何使用rtmp URL流视频?

时间:2019-05-27 17:44:06

标签: ant-media-server

我已经使用ant rest api创建了广播

https://xyz.antmedia.io:5443/LiveApp/rest/broadcast/create/?name=Testing

,它已成功创建它并返回json。 虚拟示例:

{
    "streamId": "043428553080627566897529",
    "status": "created",
    "type": "liveStream",
    "name": "zrft",
    "description": null,
    "publish": true,
    "date": 1558978714814,
    "plannedStartDate": null,
    "duration": null,
    "endPointList": null,
    "publicStream": true,
    "is360": false,
    "listenerHookURL": null,
    "category": null,
    "ipAddr": null,
    "username": "******",
    "password": "*****",
    "quality": null,
    "speed": 0,
    "streamUrl": null,
    "originAdress": null,
    "mp4Enabled": 0,
    "expireDurationMS": 0,
    "rtmpURL": "rtmp://***.**.**.17/LiveApp/043428553080627566897522",
    "zombi": false,
    "pendingPacketSize": 0,
    "hlsViewerCount": 0,
    "webRTCViewerCount": 0,
    "rtmpViewerCount": 0
}

此处rtmpURL =“ rtmp:// *。。**。server_ip / LiveApp / 043428553080627566897522” 因此,现在有任何第三方应用程序或播放器可以连接此rtmp网址并开始直播吗?

1 个答案:

答案 0 :(得分:1)

请确保您使用ffplayvlc player之类的工具播放RTMP流。 如果您使用ffplay,请不要忘记在网址的末尾添加live = 1。

ffplay  "rtmp://*..**.server_ip/LiveApp/043428553080627566897522 live=1"

如果要将实时流发布到Ant Media Server,则可以使用OBS

如果您想要超低延迟,也可以publish/play with WebRTC