ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.

Home Page:https://ossrs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Visit HTTP FLV: http://192.168.1.170:8080/push/live/livestream.flv, why doesn't it work?

zhuwh1118 opened this issue · comments

Taking the streaming server IP as an example, it is 192.168.1.170.
FMS URL: rtmp://192.168.1.170/live?vhost=push
Stream: livestream

Why can't I access HTTP FLV: http://192.168.1.170:8080/push/live/livestream.flv?

Print information:
[2018-11-01 16:12:04.230][warn][4695][117][2] http miss file=./objs/nginx/html/push/live/livestream.flv, pattern=/, upath=/push/live/livestream.flv

Configuration as follows,
listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
vhost push {
min_latency on;
gop_cache off;
forward x.x.x.x:1935;
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
hstrs on;

}

}

TRANS_BY_GPT3

Accessing HTTP FLV: http://192.168.1.170:8080/live/livestream.flv is also not working.

TRANS_BY_GPT3

Has this problem been resolved later?

TRANS_BY_GPT3

You used vhost, so the stream goes to that vhost. Accessing the default actually means __defaultVhost__, which of course has no stream. This vhost is designed for isolation, so it cannot be accessed.

TRANS_BY_GPT3

If there is a vhost, how should the access address for http be constructed?
Previously, when constructing an rtmp address, it could be written as rtmp://..../name?vhost=vhostName. However, when I tried to construct an http address using the same method, it didn't work. How should I modify it?

If you use vhost, the stream will be directed to that vhost. Accessing the default vhost, which is actually __defaultVhost__, will not have any streams. This vhost is meant for isolation, so it cannot be accessed.

TRANS_BY_GPT3

vhost is the domain name, for example, a server serving two clients (domain name or vhost), the configured vhost is:

vhost ossrs.net {
}

There are two ways for this client to access resources:

  1. http://ossrs.net:8080/live/livestream.flv
  2. http://10.11.12.13:8080/live/livestream.flv?vhost=ossrs.net

The second way mentioned above is the server IP and vhost in the parameters.

TRANS_BY_GPT3

rtmp is the same as http, just change the protocol to rtmp. For example:

  1. rtmp://ossrs.net/live/livestream
  2. rtmp://10.11.12.13/live/livestream?vhost=ossrs.net

TRANS_BY_GPT3

I tried the second method and it didn't work. The first method is not applicable either due to cross-domain issues. We have a separate deployment of nginx, so it doesn't work either.

The vhost refers to the domain name, for example, when a server serves two clients (domains or vhosts), the configured vhost is:

vhost ossrs.net {
}

Then this client can access resources in two ways:

  1. http://ossrs.net:8080/live/livestream.flv
  2. http://10.11.12.13:8080/live/livestream.flv?vhost=ossrs.net

The second way mentioned above is using the server IP and vhost as parameters.

TRANS_BY_GPT3

Just to add, I am using the current 2.0 version of the code.

TRANS_BY_GPT3

I tried it out, and there is a problem with the last stream. I will fix it in SRS3.

SRS 3.0.90 fixed.

TRANS_BY_GPT3

In this case, are there any other methods to view the live streams in the vhost rt.ossrs.net, apart from the second last format (http://rt.ossrs.net:8080/live/livestream.flv)? If possible, please provide a solution based on HTTP FLV.

TRANS_BY_GPT3

Fixed in 3.0.90.