Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

客户端拉取hls2流100% crash #104

Open
lystormenvoy opened this issue Feb 8, 2023 · 1 comment
Open

客户端拉取hls2流100% crash #104

lystormenvoy opened this issue Feb 8, 2023 · 1 comment

Comments

@lystormenvoy
Copy link

image

image

@lystormenvoy
Copy link
Author

lystormenvoy commented Feb 8, 2023

两个hls2的location

location ^~ /media-server/hls2 {
                include conf.d/hlsplus_rewrite.conf;
                include conf.d/options.conf;
                error_log logs/live_error.log warn;
                access_log  logs/live_hlsplus_access_$logDate.log;
                hls2_live 1935 app=hls;
                add_header 'Access-Control-Allow-Origin' '*';
        }
location /hls2 {
                include conf.d/options.conf;
                access_log  logs/live_hlsplus_access_$logDate.log;
                hls2_live 1935 app=hls;
                add_header 'Access-Control-Allow-Origin' '*';
        }

hlsplus_rewrite.conf内容:

 #设置这个变量为有location和协议参数的,这个就避免hls+里主m3u8返回的m3u8地址不对
                        set $hls_args location=/media-server&scheme=$scheme;
                        #默认要重写
                        set $rewrite 1;
                        if ($args) {
                                #如果已经有参数了,就不需要重写了
                                set $rewrite 0;
                                set $hls_args $args&location=/media-server&scheme=$scheme;
                        }
                        if ($rewrite = 1) {
                                rewrite ^/(.*)/(.*)\.(.*)$ $scheme://$host:$server_port/media-server/hls2/$2.$3?$hls_args break;
                        }

crash的是访问media-server格式的m3u8会crash

491行代码应该是:

 cscf = addr_conf->default_server->ctx->
            srv_conf[ngx_rtmp_core_module.ctx_index];


image

拉流location /hls2 无法拉流,提示410 Gone,相关日志打印:

2023/02/08 12:18:29 [info] 28151#28151: *107 hls-http: close| finalize http request, client: 192.168.19.161, server: _, request: "GET /hls2/ll_ch1_s1.m3u8?session=1675829825t-0i-0p-101c HTTP/1.1", host: "192.168.36.70:80"
2023/02/08 12:18:29 [info] 28151#28151: *107 client 192.168.19.161 closed keepalive connection (104: Connection reset by peer)
2023/02/08 12:18:29 [error] 28151#28151: *109 hls-http: m3u8_handler| hls session 1675829825t-0i-0p-101c not found, client: 192.168.19.161, server: _, request: "GET /hls2/ll_ch1_s1.m3u8?session=1675829825t-0i-0p-101c HTTP/1.0", host: "192.168.36.70"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant