VionConfig.java
1.74 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
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 Boolean authEnabled;
private String receiveResultPrefixPath;
/** 支持的视频格式列表 */
private List<String> supportedVideoFormats;
/** 需要跳过 token 验证的 url 的正则表达式列表 */
private List<String> skipAuth;
/** 平台srs的配置 */
private Srs srs;
/** 视频云平台对接的配置 */
private VideoCloud videoCloud;
public @Getter
@Setter
static class Image {
/** images 本地存储路径 */
private String path;
/** 访问 images 前缀,images 包含录像文件和分析图片 */
private String urlPrefix;
}
public @Getter
@Setter
static class Srs {
private String ip;
private String rtmpPort = "1935";
public String getRtmpUrl(String taskUnid) {
String url = "rtmp://" + ip + ":" + rtmpPort + "/live/" + taskUnid;
log.debug(url);
return url;
}
}
public @Getter
@Setter
static class VideoCloud {
private String id;
private String url;
}
}