int ret = ERROR_SUCCESS;/* 检测是够使能了 hls */if(!hls_enabled) {returnret; }/* hls_dispose: HLS 清理的过期时间(s),系统重启或者超过这个时间时, * 清理 HLS 所有的文件,包括 m3u8 和 ts。默认为 0,即不清理 *//* update the hls time, for hls_dispose */last_update_time =srs_get_...
hls {# whether the hls is enabled.# if off, donot write hls(ts and m3u8) when publish.# default: offenabledon;# the hls fragment in seconds, the duration of a piece of ts.# default: 10hls_fragment10;# the hls m3u8 target duration ratio,# EXT-X-TARGETDURATION = hls_td_ratio * ...
# on_hls_notify, never config in here, should config in http_hooks. # we support the variables to generate the notify url: # [app], replace with the app. # [stream], replace with the stream. # [ts_url], replace with the ts url. # for the hls http callback, @see http_hooks....
以SRS为例,它在组装TS包时做了特殊处理,在每个TS包的开头位置,就自动插入SPS与PPS等配置帧。具体代码在SRS框架的trunk/src/main/srs_main_ingest_hls.cpp,查看该源码的SrsIngestHlsOutput::on_ts_video函数,找到以下的代码片段,可见程序在写入H.264流时,先写入SPS帧和PPS帧,再写入I帧、P帧和B帧。 if((ret...
on_stop http://192.168.7.100:9000/srs_http_call_back; on_dvr http://192.168.7.100:9000/srs_http_call_back; on_hls http://192.168.7.100:9000/srs_http_call_back; on_hls_notify http://192.168.7.100:9000/srs_http_call_back; }
hls_window 60; } http_remux { enabled on; mount [vhost]/[app]/[stream].flv; hstrs on; } } 验证配置是否成功 在客户端进⾏推流验证: ffmpeg -re -i source.200kbps.768x320.flv -vcodec copy -acodec copy -f flv -y rtmp://8.141.75.248/live/livestream ...
#SRS内置的HTTP服务器分发HLS切片 #也可以使用Nginx等Web服务器分发 http_server { enabled on; listen 8080; dir ./objs/nginx/html; crossdomain on; } vhost __defaultVhost__ { hls { enabled on; hls_path ./objs/nginx/html; hls_fragment 10; ...
SRS流媒体服务部署起来之后,需要实现截图功能。本文是实现过程。 2. 思路 可选有两种方式实现。方式1:HTTP回调+自建服务步骤如下: 1、启动一个HTTP服务,这个服务可以接收来自 SRS 的HTTP回调 2、启动SRS, 3、当客户端发布流时SRS触发回调事件 on_publish,on_unpublish ,会发送 HTTP请求到第一步的“HTTP服务” ...
SRS是一个简单高效的实时视频服务器,支持RTMP/WebRTC/HLS/HTTP-FLV/SRT/GB28181。 一、Ubuntu / Mac 系统编译 Linux 或 Mac 系统可以在SRS git 仓库中,选择对应版本的源码下载进行编译;根据 SRS 对 WebRTC 的支持,源码编译版本选择目前 4.x 最新版4.0.198 ...
, flush async on_dvr/on_hls events before stop. 3.0.118 v3.0, 2020-02-14,3.0 beta1(3.0.117)released. 121964 lines. , migrating streaming from ossrs.net to r.ossrs.net. 3.0.117 3.0 beta0(3.0.112)released. 121709 lines.