You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -36,45 +36,45 @@ Header description of a single DVRIP/Sofia message is based on [Digital Video Re
36
36
37
37

38
38
39
-
1. BIT 0 - message header byte, fixed as 0xFF.
40
-
2. BIT 1 - observed to be equal to 0 for requests and equal to 1 for responses from the IP camera.
41
-
3. BIT 2 - reserved byte 1:
42
-
* Equals `0` when H.264 video codec is used (BIT4 = 0x02 on I-Frame header).
43
-
* Equals `1` when H.265 video codec is used (BIT4 = 0x12 on I-Frame header).
44
-
4. BIT 3 - reserved byte 2:
39
+
1. BIT 0: message header byte, fixed as 0xFF.
40
+
2. BIT 1: observed to be equal to 0 for requests and equal to 1 for responses from the IP camera.
41
+
3. BIT 2: reserved byte 1:
42
+
* Equals `0` when H.264 video codec is used (BIT4 = `0x02` on I-Frame header).
43
+
* Equals `1` when H.265 video codec is used (BIT4 = `0x12` on I-Frame header).
44
+
4. BIT 3: reserved byte 2:
45
45
* Equals `128` when DVRIP message contains audio frames.
46
46
* Equals `0` otherwise.
47
-
5. BIT 4-7 - session ID. Assigned by the camera after successful login. Needs to be present in every subsequent message.
48
-
6. BIT 8-11 - sequence number. Increments from 0 after startup, and after reaching the (unknown) maximum, starts from 0 again.
49
-
7. BIT 12 - total number of packets in a single message. Value of 0 or 1 indicate a single message per packet.
50
-
8. BIT 13 - number of a current packet in message. Meaningful only when the value of total packets (BIT 12) is greater than 1.
51
-
9. BIT 14-15 - command code (also called message id). The code defines what action to perform.
52
-
10. BIT 16-19 - data (payload) length. Length of a JSON payload, which starts immediately after DVRIP/Sofia header.
47
+
5. BIT 4-7: session ID. Assigned by the camera after successful login. Needs to be present in every subsequent message.
48
+
6. BIT 8-11: sequence number. Increments from 0 after startup, and after reaching the (unknown) maximum, starts from 0 again.
49
+
7. BIT 12: total number of packets in a single message. Value of 0 or 1 indicate a single message per packet.
50
+
8. BIT 13: number of a current packet in message. Meaningful only when the value of total packets (BIT 12) is greater than 1.
51
+
9. BIT 14-15: command code (also called message id). The code defines what action to perform.
52
+
10. BIT 16-19: data (payload) length. Length of a JSON payload, which starts immediately after DVRIP/Sofia header.
53
53
54
54
# Audio Header
55
55
56
56

57
57
58
58

59
59
60
-
1. BIT 0-3 - signature
61
-
2. BIT 4 - audio codec (0x0e = G711A)
62
-
3. BIT 5 - sampling rate (0x02 = 8kHz sampling)
63
-
4. BIT 6-7 - length of audio payload
60
+
1. BIT 0-3: signature
61
+
2. BIT 4: audio codec (0x0e = G711A)
62
+
3. BIT 5: sampling rate (0x02 = 8kHz sampling)
63
+
4. BIT 6-7: length of audio payload
64
64
65
65
# I-Frame Header
66
66
67
67

68
68
69
69

70
70
71
-
1. BIT 0-3 - signature
72
-
2. BIT 4 - video codec (0x01 = MPEG4, 0x02 = H.264, 0x12 = H.265)
73
-
3. BIT 5 - encoded framerate (variable; 1-25 for PAL, 1-30 for NTSC)
74
-
4. BIT 6 - low 8 bits of image width; the value is actual width divided by 8
75
-
5. BIT 7 - low 8 bits of image height; the value is actual height divided by 8
76
-
6. BIT 8-11 - datetime of the capture
77
-
7. BIT 12-15 - length of I-Frame payload
71
+
1. BIT 0-3: signature
72
+
2. BIT 4: video codec (0x01 = MPEG4, 0x02 = H.264, 0x12 = H.265)
73
+
3. BIT 5: encoded framerate (variable; 1-25 for PAL, 1-30 for NTSC)
74
+
4. BIT 6: low 8 bits of image width; the value is actual width divided by 8
75
+
5. BIT 7: low 8 bits of image height; the value is actual height divided by 8
76
+
6. BIT 8-11: datetime of the capture
77
+
7. BIT 12-15: length of I-Frame payload
78
78
79
79
First 4 bits of an I-Frame payload (BITS 16-19) are equal to `0x00000001`
80
80
@@ -88,8 +88,8 @@ Same exact header fields are shared between I-Frames (FC) and snapshots (FE).
88
88
89
89
Extension of I-Frames.
90
90
91
-
1. BIT 0-3 - signature
92
-
2. BIT 4-7 - length of P-Frame payload
91
+
1. BIT 0-3: signature
92
+
2. BIT 4-7: length of P-Frame payload
93
93
94
94
First 4 bits of a P-Frame payload (BITS 8-11) are equal to `0x00000001`
95
95
@@ -99,12 +99,12 @@ First 4 bits of a P-Frame payload (BITS 8-11) are equal to `0x00000001`
99
99
100
100

101
101
102
+
1. BIT 0-3: signature
103
+
2. BIT 4: general information (unconfirmed)
104
+
3. BIT 5: unused value
105
+
4. BIT 6-7: payload length
102
106
103
107
Used for information transmission. First byte after signature (byte 4):
104
108
105
109
1. 0x01 - general information.
106
-
2. 0x06 - unknown value.
107
-
108
-
# To Do
109
-
110
-
1. Implement frame keys, so that separate audio/video streams could be saved for data from multiple IP cameras / data stream sessions on the same Wireshark capture file.
0 commit comments