WebRTC开发者社区为开发者提供最新最全的WebRTC资料
目录
  • 首页
  • WebRTC概念与基础
  • WebRTC项目与应用
  • WebRTC教程资料
  • WebRTC开发资源
  • WebRTC源码分析
  • WebRTC服务端开发
  • WebRTC网络与通信
  • WebRTC编码与解码
  • WebRTC问题与缺陷
  • WebRTC-Androd端开发
  • WebRTC-RFC文档

Janus源码分析(6)——Streaming分析

2020-12-31 05:59:19

1. 运行效果图

Streaming演示的是播放视频或音频流,可用于网络直播或转播,效果如下图所示:
在这里插入图片描述

2. Streaming插件API分析

2.1 会议配置信息及API分类

1、插件配置文件位置 conf/janus.plugin.streaming.jcfg,流配置格式如下:

stream-name: {
	type = rtp|live|ondemand|rtsp
		   rtp = stream originated by an external tool (e.g., gstreamer or
				 ffmpeg) and sent to the plugin via RTP
		   live = local file streamed live to multiple viewers
				  (multiple viewers = same streaming context)
		   ondemand = local file streamed on-demand to a single listener
					  (multiple viewers = different streaming contexts)
		   rtsp = stream originated by an external RTSP feed (only
				  available if libcurl support was compiled)
	id = <unique numeric ID>
	description = This is my awesome stream
	is_private = true|false (private streams don't appear when you do a 'list' request)
	filename = path to the local file to stream (only for live/ondemand)
	secret = <optional password needed for manipulating (e.g., destroying
					or enabling/disabling) the stream>
	pin = <optional password needed for watching the stream>
	audio = true|false (do/don't stream audio)
	video = true|false (do/don't stream video)
	   The following options are only valid for the 'rtp' type:
	data = true|false (do/don't stream text via datachannels)
	audioport = local port for receiving audio frames
	audiortcpport = local port for receiving and sending audio RTCP feedback
	audiomcast = multicast group for receiving audio frames, if any
	audioiface = network interface or IP address to bind to, if any (binds to all otherwise)
	audiopt = <audio RTP payload type> (e.g., 111)
	audiortpmap = RTP map of the audio codec (e.g., opus/48000/2)
	audiofmtp = Codec specific parameters, if any
	audioskew = true|false (whether the plugin should perform skew
			analisys and compensation on incoming audio RTP stream, EXPERIMENTAL)
	videoport = local port for receiving video frames (only for rtp)
	videortcpport = local port for receiving and sending video RTCP feedback
	videomcast = multicast group for receiving video frames, if any
	videoiface = network interface or IP address to bind to, if any (binds to all otherwise)
	videopt = <video RTP payload type> (e.g., 100)
	videortpmap = RTP map of the video codec (e.g., VP8/90000)
	videofmtp = Codec specific parameters, if any
	videobufferkf = true|false (whether the plugin should store the latest
			keyframe and send it immediately for new viewers, EXPERIMENTAL)
	videosimulcast = true|false (do|don't enable video simulcasting)
	videoport2 = second local port for receiving video frames (only for rtp, and simulcasting)
	videoport3 = third local port for receiving video frames (only for rtp, and simulcasting)
	videoskew = true|false (whether the plugin should perform skew
			analisys and compensation on incoming video RTP stream, EXPERIMENTAL)
	videosvc = true|false (whether the video will have SVC support; works only for VP9-SVC, default=false)
	collision = in case of collision (more than one SSRC hitting the same port), the plugin
			will discard incoming RTP packets with a new SSRC unless this many milliseconds
			passed, which would then change the current SSRC (0=disabled)
	dataport = local port for receiving data messages to relay
	dataiface = network interface or IP address to bind to, if any (binds to all otherwise)
	databuffermsg = true|false (whether the plugin should store the latest
			message and send it immediately for new viewers)
	threads = number of threads to assist with the relaying part, which can help
			if you expect a lot of viewers that may cause the RTP receiving part
			in the Streaming plugin to slow down and fail to catch up (default=0)

	In case you want to use SRTP for your RTP-based mountpoint, you'll need
	to configure the SRTP-related properties as well, namely the suite to
	use for hashing (32 or 80) and the crypto information for decrypting
	the stream (as a base64 encoded string the way SDES does it). Notice
	that with SRTP involved you'll have to pay extra attention to what you
	feed the mountpoint, as you may risk getting SRTP decrypt errors:
	srtpsuite = 32
	srtpcrypto = WbTBosdVUZqEb6Htqhn+m3z7wUh4RJVR8nE15GbN

	The following options are only valid for the 'rstp' type:
	url = RTSP stream URL
	rtsp_user = RTSP authorization username, if needed
	rtsp_pwd = RTSP authorization password, if needed
	rtsp_failcheck = whether an error should be returned if connecting to the RTSP server fails (default=true)
	rtspiface = network interface IP address or device name to listen on when receiving RTSP streams
}

实际配置中可参考示例配置文件中给出的配置信息:
在这里插入图片描述

2、Streaming插件分2种类型API:同步请求、异步请求;

2.2 同步请求API

在这里插入图片描述

2.3 异步请求API

在这里插入图片描述

3. 主要API处理分析

3.1 获取流列表list

在这里插入图片描述

3.2 观看流watch

在这里插入图片描述

4. 参考资料

  • 官网Streaming插件API文档
    https://janus.conf.meetecho.com/docs/streaming.html

By:rasp | WebRTC服务端开发 |

  • 分类目录

    • WebRTC概念与基础 (225)
    • WebRTC项目与应用 (33)
    • WebRTC教程资料 (38)
    • WebRTC开发资源 (13)
    • WebRTC源码分析 (12)
    • WebRTC服务端开发 (23)
    • WebRTC网络与通信 (26)
    • WebRTC编码与解码 (15)
    • WebRTC问题与缺陷 (2)
    • WebRTC-Androd端开发 (2)
    • WebRTC-RFC文档 (1)
  • 最新文章

    • 音视频相关的书籍,多媒体技术
    • SFU级联解决方案——Jitsi
    • SFU级联解决方案——Licode
    • Janus源码分析(6)——Streaming分析
    • janus Streaming插件推流指南
    • 流媒体服务器 
    • WebRTC+libwebsockets+Janus的秒开实践
    • 基于WebRTC的直播CDN
    • 不需要SFU实现WebRTC联播实践  
    • webrtc 开启Simulcast功能
    • Migrating your native/mobile application to Unified Plan/WebRTC 1.0 API
    • WebRTC源码分析rfc4588 RTP重传有效载荷格式
    • WebRTC网关服务器搭建:开源技术 vs 自行研发
    • WebRTC网关服务器搭建:开源技术 vs 自行研发
    • 自研WebRTC网关服务器架构的实践之路
    • WEBRTC三种类型(Mesh、MCU 和 SFU)的多方通信架构  
    • janus的videoroom插件
    • WebRTC+libwebsockets+Janus的秒开实践
    • Janus源码分析(7)——videoroom分析
    • Janus源码分析(5)——echotest分析
    • Janus源码分析(4)——信令交互过程
    • WebRTC+libwebsockets+Janus的秒开实践
    • 前向纠错码(FEC)的RTP荷载格式
    • WebRTC 开发实践:从一对一通话到多人会议
    • Distord如何使用WebRTC处理250万用户同时进行的音频交流
    • 了不起的WebRTC:生态日趋完善,或将实时音视频技术白菜化
    • 基于WebRTC技术的多人音视频解决方案
    • 谁是最好的WebRTC SFU?
    • WebRTC媒体服务器
    • 使用Janus作为对讲服务器的后台框架和业务流程
  • 链接

    • WebRTC官网
    • xSky 实验室
    • 树莓派技术圈
    • 声网 Agora
    • WebRTC中文网
    • web性能权威指南
    • WebRTC官网
    • webrtc在线源码
    • webrtc在线源码
    • webrtc
    • webrtc示例
    • LiveVideoStack
    • 雷霄骅(leixiaohua1020)的专栏
  • 开源项目


Powered By xblog Copyright 0xsky.com All Rights Reserved.

Copyright WebRTC.ren All Rights Reserved.