111
k94314517
2025-02-28 04dba6a17f836b5fbdf0eedff8a129c6785fd8a2
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
package org.yzh.protocol.commons.transform.parameter;
 
import io.github.yezhihao.protostar.Schema;
import io.github.yezhihao.protostar.annotation.Field;
import io.netty.buffer.ByteBuf;
 
/**
 * 音视频参数设置
 * @author yezhihao
 * https://gitee.com/yezhihao/jt808-server
 */
public class ParamVideo {
 
    public static final Integer key = 0x0075;
 
    public static final Schema<ParamVideo> SCHEMA = new ParamVideoSchema();
 
    protected static final Schema<ParamVideo> SCHEMA_2 = new ParamVideoSchema2();
 
    @Field(desc = "实时流编码模式:0.CBR(固定码率) 1.VBR(可变码率) 2.ABR(平均码率) 100~ 127.自定义")
    private byte realtimeEncode;
    @Field(desc = "实时流分辨率:0.QCIF 1.CIF 2.WCIF 3.D1 4.WD1 5.720P 6.1080P 100~127.自定义")
    private byte realtimeResolution;
    @Field(desc = "实时流关键帧间隔(1~1000帧)")
    private short realtimeFrameInterval;
    @Field(desc = "实时流目标帧率(1~120帧)")
    private byte realtimeFrameRate;
    @Field(desc = "实时流目标码率(kbps)")
    private int realtimeBitRate;
 
    @Field(desc = "存储流编码模式:0.CBR(固定码率) 1.VBR(可变码率) 2.ABR(平均码率) 100~ 127.自定义")
    private byte storageEncode;
    @Field(desc = "存储流分辨率:0.QCIF 1.CIF 2.WCIF 3.D1 4.WD1 5.720P 6.1080P 100~127.自定义")
    private byte storageResolution;
    @Field(desc = "存储流关键帧间隔(1~1000帧)")
    private short storageFrameInterval;
    @Field(desc = "存储流目标帧率(1~120帧)")
    private byte storageFrameRate;
    @Field(desc = "存储流目标码率(kbps)")
    private int storageBitRate;
 
    @Field(desc = "OSD字幕叠加设置(按位,0.表示不叠加 1.表示叠加):" +
            " [0]日期和时间" +
            " [1]车牌号码" +
            " [2]逻辑通道号" +
            " [3]经纬度" +
            " [4]行驶记录速度" +
            " [5]卫星定位速度" +
            " [6]连续驾驶时间" +
            " [7~l0]保留" +
            " [11~l5]自定义")
    private short odsConfig;
    @Field(desc = "是否启用音频输出:0.不启用 1.启用")
    private byte audioEnable;
 
    public ParamVideo() {
    }
 
    public byte getRealtimeEncode() {
        return realtimeEncode;
    }
 
    public void setRealtimeEncode(byte realtimeEncode) {
        this.realtimeEncode = realtimeEncode;
    }
 
    public byte getRealtimeResolution() {
        return realtimeResolution;
    }
 
    public void setRealtimeResolution(byte realtimeResolution) {
        this.realtimeResolution = realtimeResolution;
    }
 
    public short getRealtimeFrameInterval() {
        return realtimeFrameInterval;
    }
 
    public void setRealtimeFrameInterval(short realtimeFrameInterval) {
        this.realtimeFrameInterval = realtimeFrameInterval;
    }
 
    public byte getRealtimeFrameRate() {
        return realtimeFrameRate;
    }
 
    public void setRealtimeFrameRate(byte realtimeFrameRate) {
        this.realtimeFrameRate = realtimeFrameRate;
    }
 
    public int getRealtimeBitRate() {
        return realtimeBitRate;
    }
 
    public void setRealtimeBitRate(int realtimeBitRate) {
        this.realtimeBitRate = realtimeBitRate;
    }
 
    public byte getStorageEncode() {
        return storageEncode;
    }
 
    public void setStorageEncode(byte storageEncode) {
        this.storageEncode = storageEncode;
    }
 
    public byte getStorageResolution() {
        return storageResolution;
    }
 
    public void setStorageResolution(byte storageResolution) {
        this.storageResolution = storageResolution;
    }
 
    public short getStorageFrameInterval() {
        return storageFrameInterval;
    }
 
    public void setStorageFrameInterval(short storageFrameInterval) {
        this.storageFrameInterval = storageFrameInterval;
    }
 
    public byte getStorageFrameRate() {
        return storageFrameRate;
    }
 
    public void setStorageFrameRate(byte storageFrameRate) {
        this.storageFrameRate = storageFrameRate;
    }
 
    public int getStorageBitRate() {
        return storageBitRate;
    }
 
    public void setStorageBitRate(int storageBitRate) {
        this.storageBitRate = storageBitRate;
    }
 
    public short getOdsConfig() {
        return odsConfig;
    }
 
    public void setOdsConfig(short odsConfig) {
        this.odsConfig = odsConfig;
    }
 
    public byte getAudioEnable() {
        return audioEnable;
    }
 
    public void setAudioEnable(byte audioEnable) {
        this.audioEnable = audioEnable;
    }
 
    private static class ParamVideoSchema implements Schema<ParamVideo> {
 
        private ParamVideoSchema() {
        }
 
        @Override
        public ParamVideo readFrom(ByteBuf input) {
            ParamVideo message = new ParamVideo();
            message.realtimeEncode = input.readByte();
            message.realtimeResolution = input.readByte();
            message.realtimeFrameInterval = input.readShort();
            message.realtimeFrameRate = input.readByte();
            message.realtimeBitRate = input.readInt();
 
            message.storageEncode = input.readByte();
            message.storageResolution = input.readByte();
            message.storageFrameInterval = input.readShort();
            message.storageFrameRate = input.readByte();
            message.storageBitRate = input.readInt();
 
            message.odsConfig = input.readShort();
            message.audioEnable = input.readByte();
            return message;
        }
 
        @Override
        public void writeTo(ByteBuf output, ParamVideo message) {
            output.writeByte(message.realtimeEncode);
            output.writeByte(message.realtimeResolution);
            output.writeShort(message.realtimeFrameInterval);
            output.writeByte(message.realtimeFrameRate);
            output.writeInt(message.realtimeBitRate);
 
            output.writeByte(message.storageEncode);
            output.writeByte(message.storageResolution);
            output.writeShort(message.storageFrameInterval);
            output.writeByte(message.storageFrameRate);
            output.writeInt(message.storageBitRate);
 
            output.writeShort(message.odsConfig);
            output.writeByte(message.audioEnable);
        }
    }
 
    public static class ParamVideoSchema2 implements Schema<ParamVideo> {
 
        private ParamVideoSchema2() {
        }
 
        @Override
        public ParamVideo readFrom(ByteBuf input) {
            ParamVideo message = new ParamVideo();
            message.realtimeEncode = input.readByte();
            message.realtimeResolution = input.readByte();
            message.realtimeFrameInterval = input.readShort();
            message.realtimeFrameRate = input.readByte();
            message.realtimeBitRate = input.readInt();
 
            message.storageEncode = input.readByte();
            message.storageResolution = input.readByte();
            message.storageFrameInterval = input.readShort();
            message.storageFrameRate = input.readByte();
            message.storageBitRate = input.readInt();
 
            message.odsConfig = input.readShort();
            return message;
        }
 
        @Override
        public void writeTo(ByteBuf output, ParamVideo message) {
            output.writeByte(message.realtimeEncode);
            output.writeByte(message.realtimeResolution);
            output.writeShort(message.realtimeFrameInterval);
            output.writeByte(message.realtimeFrameRate);
            output.writeInt(message.realtimeBitRate);
 
            output.writeByte(message.storageEncode);
            output.writeByte(message.storageResolution);
            output.writeShort(message.storageFrameInterval);
            output.writeByte(message.storageFrameRate);
            output.writeInt(message.storageBitRate);
 
            output.writeShort(message.odsConfig);
        }
    }
}