VionConfig.java
2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.viontech.fanxing.commons.config;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
import java.util.List;
/**
* .
*
* @author 谢明辉
* @date 2021/9/8
*/
@RefreshScope
@Configuration
@Getter
@Setter
@ConfigurationProperties(prefix = "vion")
@Slf4j
public class VionConfig {
private Image image;
/** 是否启用转发 */
private boolean enableForward;
/** auth 服务地址 */
private String authPath;
private Gateway gateway;
/** 支持的视频格式列表 */
private List<String> supportedVideoFormats;
/** 需要跳过 token 验证的 url 的正则表达式列表 */
private List<String> skipAuth;
/** 平台srs的配置 */
private Srs srs;
public @Getter
@Setter
static class Image {
/** images 本地存储路径 */
private String path;
/** 图片保存天数 */
private Integer keep;
/** 访问 images 前缀,images 包含录像文件和分析图片 */
private String urlPrefix;
}
public @Getter
@Setter
static class Gateway {
/** 网关 ip,以后可能改为 nginx */
private String ip;
/** 网关端口 */
private String port;
}
public @Getter
@Setter
static class Srs {
private String ip;
private String rtmpPort = "1935";
private String httpPort = "8080";
public String getRtmpUrl(String taskUnid) {
String url = "rtmp://" + ip + ":" + rtmpPort + "/live/" + taskUnid;
log.debug(url);
return url;
}
public String getHttpUrl(String taskUnid) {
String url = "http://36.112.68.214:30010/srs/live/" + taskUnid + ".flv";
// String url = "http://" + ip + ":" + httpPort + "/srs/live/" + taskUnid + ".flv";
log.debug(url);
return url;
}
}
}