Android音视频学习

Nginx rtmp 拉流播放(play)

2021-12-07  本文已影响0人  mfdalf

系列文章
Nginx rtmp 推流(publish) 解析_fdsafwagdagadg6576的专栏-CSDN博客
Nginx rtmp 拉流播放(play)_fdsafwagdagadg6576的专栏-CSDN博客
Nginx rtmp 拉流(转发pull)_fdsafwagdagadg6576的专栏-CSDN博客
Nginx rtmp 转推_fdsafwagdagadg6576的专栏-CSDN博客
Nginx rtmp 点播流程_fdsafwagdagadg6576的专栏-CSDN博客

终端play拉流分成两种场景

Nginx rtmp server有流场景和没流场景.

整体结构图

image.png
image.png

流程图:

image

流程步骤

  1. handshake,connect,createstream和publish场景一样.ngx_rtmp_recv消息接收也一样.
  2. 发送play消息
  3. ngx_rtmp_live_join 注册作为subscribe接收,本地liveav发的流
  4. 流媒体ngx_rtmp_live_av转流
    绿色模块参见relay 拉流(pull)篇

源码分析

static ngx_int_t
ngx_rtmp_live_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
    ....
    /* join stream as subscriber */
//把上游rtmp服务器的session加入到这个流的订阅者中去
//参数3决定0 is subscriber
    ngx_rtmp_live_join(s, v->name, 0);
    ....
next:
    return next_play(s, v);
}

如果对您有所帮助,请随手点赞,谢谢

上一篇 下一篇

猜你喜欢

热点阅读