-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi_guide.txt
More file actions
20717 lines (14850 loc) · 270 KB
/
Copy pathapi_guide.txt
File metadata and controls
20717 lines (14850 loc) · 270 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
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Camera HTTP API
User Guide
Version 8
2023-4
Privacy Protection Notice
As a device user or data controller, you may collect personal data about o
thers. You need to abide by local privacy protection laws and regulations,
and implement measures to protect the legitimate rights and interests o
f others.
Disclaimer
We have tried our best to ensure the completeness and accuracy of the c
ontent of the document, but it is inevitable that there will be technical in
accuracies, inconsistencies with product functions and operations, or pri
nting errors, etc.
If you have any questions or disputes, please refer to our final interpretat
ion.
Revision History
Description
Data
Version 1.0
Initial version
2016-06-01
Revision 1
Version 1.1
Revision 2
1. Add the interface of short connection
2016-11-07
accessing CGI.
2. Add rtmp port parameter to GetNetPort and
SetNetPort interfaces.
3. Add hourFmt parameter to GetTime and
SetTime interfaces.
4. Add streamType and interval parameters to
GetFtp and SetFtp interfaces.
5. Add schedule parameter to GetEmail and
SetEmail interfaces.
6. Add GetPush and SetPush interfaces.
7. Remove enable, action and schedule
parameters to GetAlarm and SetAlarm
interfaces.
8. Add emailSchedule, pushSchedule and
hourFmt to GetAbility interface.
Version 1.2
1. Add UpgradePrepare
Revision 3
2. Add Shutdown
3. Add GetAuth and SetAuth
4. Add Getcloud and Setcloud
5. Get3G and Set3G
6. GetP2p and SetP2p
7. Add Preview
8. Add rtmp=start and rtmp=stop and
rtmp=auth for rtmp
9. Ptz add GetPtzSerial SetPtzSerial
2019-4-26
GetPtzTattern SetPtzTattern command
10. Camera increases GetAutoFocus
SetAutoFocus command of focus
11. LED increases GetIrLights SetIrLights
GetPowerLed SetPowerLed command
12. Add GetAudioAlarm SetAudioAlarm
13. Add HeartBeat
14. Add GetCrop SetCrop
15. Add GetAutoUpgrade SetAutoUpgrade
CheckFirmware UpgradeOnline
UpgradeStatus in system mode
Version 1.3
1. Ptz add GetPtzSerial SetPtzSerial
Revision 4
GetPtzTattern SetPtzTattern command
2019-9-30
2. System delete ImportCfg
3. Security delete GetAuth SetAuth
4. Alarm add SetAudioAlarm
5. Complete the responsed code
Version 1.4
1. Merge CGI commands for NVR and IPC
2021-01-05
Version 1.5
1. AI adds GetAiCfg SetAiCfg GetAiState
2021-12-03
Revison 6
2. Ptz adds GetZoomFocus StartZoomFocus
Revision 5
GetPtzGuard SetPtzGuard GetPtzCheckState
PtzCheck
3. Alarm adds AudioAlarmPlay
4. LED updates GetWhiteLed SetWilteLed
5. System updates GetAbility
6. Network updates GetFtpV20 SetFtpV20
TestFtp GetNetPort SetNetPort
7. Network adds GetCertificateInfo
CertificateClear GetRtspUrl
8. video input updates SetIsp GetIsp
9. Enc updates GetEnc
10. Response updates Error
Version 1.6
1. Improve the description of the example
Revison 7
2. Add the description of video preview
3. Delete the abandoned command (rtmp
start/rtmp stop/rtmp auth)
4. Add the version field to the login command
5. Add GetSysCfg/SetSysCfg/GetStitch/SetStitch
commands
6. ISP adds multi-level frame drop and soft light
sensitivity
7. NVR cut and download video file optional
stream type
8. Increase the ptz guard parameter
9. Increase the white light setting parameters
10. Add description for ftp command
11. Improve the capability set
12. Improve the error code
Version 1.7
Revison 8
Add Privacy Protection Notice and Disclaimer
2022-9-6
Contents
Privacy Protection Notice ................................................................................................................. 2
Disclaimer .......................................................................................................................................... 2
Contents ............................................................................................................................................. 6
1 Scope ..............................................................................................................................................11
2 HTTP & Json ................................................................................................................................... 11
2.1 Protocol ...............................................................................................................................11
2.2 JSON .................................................................................................................................... 12
2.3 Token ................................................................................................................................... 13
2.4 Abbreviations ......................................................................................................................13
2.5 Definitions ...........................................................................................................................14
2.6 Command usage example .................................................................................................. 14
2.6.1 Get encoding configuration through long session connection ...............................15
2. Next execute the GetEnc command ............................................................................................. 16
2.6.2 Get encoding configuration through short session connection ............................. 21
2.7 Preview ............................................................................................................................... 26
2.7.1 rtsp mode preview ...................................................................................................26
1.Preview ipc device video ........................................................................................................... 28
2.7.2 rtmp mode preview .................................................................................................28
1. Main stream url: ........................................................................................................................... 29
2. Ext stream url: ...............................................................................................................................29
3. Sub stream url: ..............................................................................................................................29
1.Preview ipc device video ........................................................................................................... 30
2.7.3 flv mode preview ..................................................................................................... 30
1. Main stream: .................................................................................................................................30
2. Ext stream: .................................................................................................................................... 30
3. Sub stream: ................................................................................................................................... 30
1.Preview ipc device video ........................................................................................................... 30
2.8 Reolink ipc/nvr web reference ........................................................................................... 30
3 Commands ..................................................................................................................................... 33
3.1 System .................................................................................................................................33
3.1.1 GetAbility ................................................................................................................. 33
3.1.2 GetDevInfo ...............................................................................................................66
3.1.3 GetDevName ........................................................................................................... 68
3.1.4 SetDevName ............................................................................................................ 69
3.1.5 GetTime ................................................................................................................... 70
3.1.6 SetTime .................................................................................................................... 76
3.1.7 GetAutoMaint ..........................................................................................................78
3.1.8 SetAutoMaint ...........................................................................................................80
3.1.9 GetHddInfo .............................................................................................................. 82
3.1.10 Format ....................................................................................................................83
3.1.11 Upgrade ................................................................................................................. 84
3.1.12 Restore ...................................................................................................................86
3.1.13 Reboot ................................................................................................................... 87
3.1.14 UpgradePrepare .................................................................................................... 88
3.1.15 GetAutoUpgrade ....................................................................................................89
3.1.16 SetAutoUpgrade .................................................................................................... 90
3.1.17 CheckFirmware ...................................................................................................... 91
3.1.18 UpgradeOnline .......................................................................................................92
3.1.19 UpgradeStatus ....................................................................................................... 93
3.1.20 Getchannelstatus ...................................................................................................95
Interface Description ......................................................................................................... 95
3.2 Security ............................................................................................................................... 98
3.2.1 Login .........................................................................................................................98
3.2.2 Logout ...................................................................................................................... 99
3.2.3 GetUser ..................................................................................................................101
3.2.4 AddUser ................................................................................................................. 102
3.2.5 DelUser .................................................................................................................. 104
3.2.6 ModifyUser ............................................................................................................ 105
3.2.7 GetOnline ...............................................................................................................106
3.2.8 Disconnect ............................................................................................................. 107
3.2.9 GetSysCfg ............................................................................................................... 108
3.2.10 SetSysCfg ..............................................................................................................110
Interface Description ....................................................................................................... 110
3.3 Network ............................................................................................................................ 111
3.3.1 GetLocalLink ...........................................................................................................111
3.3.2 SetLocalLink ........................................................................................................... 114
3.3.3 GetDdns ................................................................................................................. 116
3.3.4 SetDdns ..................................................................................................................118
3.3.5 GetEmail ................................................................................................................ 119
3.3.6 SetEmail ................................................................................................................. 122
3.3.7 GetEmailV20 .......................................................................................................... 125
3.3.8 SetEmailV20 ...........................................................................................................127
3.3.9 TestEmail ................................................................................................................129
3.3.10 GetFtp .................................................................................................................. 131
3.3.11 SetFtp ...................................................................................................................134
3.3.12 GetFtpV20 ............................................................................................................137
3.3.13 SetFtpV20 ............................................................................................................ 144
3.3.14 TestFtp ................................................................................................................. 147
3.3.15 GetNtp ................................................................................................................. 149
3.3.16 SetNtp .................................................................................................................. 151
3.3.17 GetNetPort ...........................................................................................................152
3.3.18 SetNetPort ........................................................................................................... 154
3.3.19 GetUpnp .............................................................................................................. 155
3.3.20 SetUpnp ............................................................................................................... 156
3.3.21 GetWifi .................................................................................................................158
3.3.22 SetWifi ................................................................................................................. 159
3.3.23 TestWifi ................................................................................................................ 160
3.3.24 ScanWifi ............................................................................................................... 162
3.3.25 GetWifiSignal ....................................................................................................... 163
3.3.26 GetPush ................................................................................................................164
3.3.27 SetPush ................................................................................................................ 166
3.3.28 GetPushV20 ......................................................................................................... 168
3.3.29 SetPushV20 ..........................................................................................................170
3.3.30 GetPushCfg .......................................................................................................... 172
3.3.31 SetPushCfg ........................................................................................................... 173
3.3.32 GetP2p ................................................................................................................. 175
3.3.33 SetP2p ..................................................................................................................176
3.3.34 GetCertificateInfo ................................................................................................ 177
3.3.35 CertificateClear .................................................................................................... 178
3.3.36 GetRtspUrl ........................................................................................................... 179
Interface Description ....................................................................................................... 179
3.4 Video input ....................................................................................................................... 181
3.4.1 GetImage ............................................................................................................... 181
3.4.2 SetImage ................................................................................................................ 183
3.4.3 GetOsd ................................................................................................................... 184
3.4.4 SetOsd ....................................................................................................................187
3.4.5 GetIsp .....................................................................................................................189
3.4.6 SetIsp ..................................................................................................................... 195
3.4.7 GetMask .................................................................................................................198
3.4.8 SetMask ................................................................................................................. 200
3.4.9 GetCrop ..................................................................................................................203
3.4.10 SetCrop ................................................................................................................ 205
3.4.11 GetStitch .............................................................................................................. 207
3.4.12 SetStitch ...............................................................................................................208
Interface Description ....................................................................................................... 208
3.5 Enc .....................................................................................................................................210
3.5.1 GetEnc ....................................................................................................................210
3.5.2 SetEnc .................................................................................................................... 216
Interface Description ....................................................................................................... 216
3.6 Record ............................................................................................................................... 218
3.6.1 GetRec ....................................................................................................................218
3.6.2 SetRec .................................................................................................................... 220
3.6.3 GetRecV20 ............................................................................................................. 222
3.6.4 SetRecV20 .............................................................................................................. 225
3.6.5 Search .................................................................................................................... 227
3.6.6 Download ...............................................................................................................232
3.6.7 Snap ....................................................................................................................... 233
3.6.8 Playback ................................................................................................................. 234
3.6.9 NvrDownload .........................................................................................................235
Interface Description ....................................................................................................... 235
3.7 PTZ .....................................................................................................................................238
3.7.1 GetPtzPreset .......................................................................................................... 238
3.7.2 SetPtzPreset ...........................................................................................................257
3.7.3 GetPtzPatrol ...........................................................................................................258
3.7.4 SetPtzPatrol ........................................................................................................... 263
3.7.5 PtzCtrl .................................................................................................................... 265
3.7.6 GetPtzSerial ........................................................................................................... 267
3.7.7 SetPtzSerial ............................................................................................................ 270
3.7.8 GetPtzTattern .........................................................................................................271
3.7.9 SetPtzTattern ......................................................................................................... 275
3.7.10 GetAutoFocus ...................................................................................................... 277
3.7.11 SetAutoFocus .......................................................................................................278
3.7.12 GetZoomFocus .....................................................................................................279
3.7.13 StartZoomFocus ...................................................................................................280
3.7.14 GetPtzGuard ........................................................................................................ 282
3.7.15 SetPtzGuard ......................................................................................................... 283
3.7.16 GetPtzCheckState ................................................................................................ 284
3.7.17 PtzCheck .............................................................................................................. 286
Interface Description ....................................................................................................... 286
3.8 Alarm .................................................................................................................................287
3.8.1 GetAlarm ................................................................................................................287
3.8.2 SetAlarm ................................................................................................................ 296
3.8.3 GetMdAlarm .......................................................................................................... 300
3.8.4 SetMdAlarm ...........................................................................................................314
3.8.5 GetMdState ............................................................................................................319
3.8.6 GetAudioAlarm ...................................................................................................... 320
3.8.7 SetAudioAlarm .......................................................................................................322
3.8.8 GetAudioAlarmV20 ................................................................................................324
3.8.9 SetAudioAlarmV20 ................................................................................................ 327
3.8.10 GetBuzzerAlarmV20 ............................................................................................ 328
3.8.11 SetBuzzerAlarmV20 ............................................................................................. 332
3.8.12 AudioAlarmPlay ................................................................................................... 333
Interface Description ....................................................................................................... 333
3.10 LED .................................................................................................................................. 335
3.10.1 GetIrLights ........................................................................................................... 335
3.10.2 SetIrLights ............................................................................................................ 336
3.10.3 GetPowerLed ....................................................................................................... 337
3.10.4 SetPowerLed ........................................................................................................339
3.10.5 GetWhiteLed ........................................................................................................340
3.10.6 SetWhiteLed ........................................................................................................ 342
3.10.7 GetAiAlarm .......................................................................................................... 344
3.10.8 SetAiAlarm ........................................................................................................... 347
3.10.9 SetAlarmArea .......................................................................................................350
Interface Description ....................................................................................................... 350
3.11 AI ..................................................................................................................................... 353
3.11.1 GetAiCfg ............................................................................................................... 353
3.11.2 SetAiCfg ................................................................................................................355
3.11.3 GetAiState ............................................................................................................356
Interface Description ............................................................................................................... 356
4. Response ..................................................................................................................................... 358
4.1 Error .................................................................................................................................. 358
1 Scope
The document defines a series of HTTP and HTTPS based application
programming interface, covering the System, Security, Network, Video
input, Enc, Record, PTZ, and Alarm modules.
The document applies to both IPC and NVR products,and the differences
will be explained in the commands.
2 HTTP & Json
2.1 Protocol
Support both HTTP and HTTPS. By default, http is turned off. If you need
to use the http protocol, you need to go to Settings -> Network Settings
-> Advanced Settings -> Port Settings to open the http port.
HTTP and HTTPS only support the POST method, get and set all through
it.
POST /cgi-bin/api.cgi?cmd=xxx&token=20343295¶mxxx=xxx HTTP/1.1
The payload type is a JSON or file that is specified by Content-Type.
Content-Type = “application/octet-stream” or "application/json"
2.2 JSON
JSON (JavaScript Object Notation) is based on a subset of the JavaScript
Programming Language, Standard ECMA-262 3rd Edition - December
1999.
Request:
[
{
"cmd":string,
"action":int,
"param“:
{
"name": val,
...
},
}
...
]
Response:
// val = string or int
[
{
"cmd":string,
"code“:int, // rsp code, 0:success, others: false
"value": or "error" // "value" when code = 0, "error" when "code" = 1
{
"name": val,
// val = string or int
...
},
}
...
]
2.3 Token
Token is the only global certification of developers. Token is required
whenever developers are calling each port. Normally the lease for each
token is 3600 seconds and you may regain it after it expires. Please refer
to the Login command for the methods of requiring token.
2.4 Abbreviations
For the purposes of the present document, the following abbreviations
apply:
M/O
Mandatory/Optional
2.5 Definitions
For the purposes of the present document, the following definitions
apply:
initial: The initial value of the configuration.
range: The data range of the configuration.
value: The current value of the configuration.
action : Obtain initial, range and value when the value is 1, obtain only
the value when the value is 0.
channel : The channel number of the current device.
2.6 Command usage example
There are two access methods for reolink ipc/nvr:
1: Long-session access, that is, first send a login request with a user
name and password, and obtain a token, and then all subsequent
commands URL carry the token as authentication information.
2. Short session access, that is, each cgi request url carries the username
and password as authentication information.
The following are examples of the method of sending the GetEnc
command to obtain the encoding configuration through the long session
connection and the short session connection mode
2.6.1 Get encoding configuration through long session
connection
If you want to work over a persistent connection, you need to get the
Token by sending a login request.
1. get token first:
The login request url:
https://<camera_ip>/api.cgi?cmd=Login
The request body:
[
{
"cmd":"Login",
"param":{
"User":{
"Version": "0",
"userName":"admin",
"password":"xxxxxx"
}
}
}
]
Response:
[
{
"cmd" : "Login",
"code" : 0,
"value" : {
"Token" : {
"leaseTime" : 3600,
"name" : "42da7586d7b82a6"
}
}
}
]
It is also possible to simulate the test through the Advanced Rest Client
Application on Google Chrome
2. Next execute the GetEnc command
When sending a request, you need to carry the token name obtained by
the login command.
The GetEnc request url:
https://<camera_ip>/api.cgi?cmd=GetEnc&token=42da7586d7b82a6
The request body:
[
]
{
}
"cmd":"GetEnc",
"action":1,
"param":{
"channel":0
}
Response:
[
{
"cmd" : "GetEnc",
"code" : 0,
"initial" : {
"Enc" : {
"audio" : 0,
"channel" : 0,
"mainStream" : {
"bitRate" : 6144,
"frameRate" : 25,
"gop" : 2,
"height" : 2160,
"profile" : "High",
"size" : "3840*2160",
"vType" : "h265",
"width" : 3840
},
"subStream" : {
"bitRate" : 256,
"frameRate" : 10,
"gop" : 4,
"height" : 360,
"profile" : "High",
"size" : "640*360",
}
}
"vType" : "h264",
"width" : 640
},
"range" : {
"Enc" : [
{
"audio" : "boolean",
"chnBit" : 1,
"mainStream" : {
"bitRate" : [ 4096, 5120, 6144, 7168, 8192 ],
"default" : {
"bitRate" : 6144,
"frameRate" : 25,
"gop" : 2
},
"frameRate" : [ 25, 22, 20, 18, 16, 15, 12, 10, 8, 6, 4, 2 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 2160,
"profile" : [ "Base", "Main", "High" ],
"size" : "3840*2160",
"vType" : "h265",
"width" : 3840
},
"subStream" : {
"bitRate" : [ 64, 128, 160, 192, 256, 384, 512 ],
"default" : {
"bitRate" : 256,
"frameRate" : 10,
"gop" : 4
},
"frameRate" : [ 15, 10, 7, 4 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 360,
"profile" : [ "Base", "Main", "High" ],
"size" : "640*360",
"vType" : "h264",
},
{
8192 ],
}
"width" : 640
"audio" : "boolean",
"chnBit" : 1,
"mainStream" : {
"bitRate" : [ 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168,
"default" : {
"bitRate" : 6144,
"frameRate" : 25,
"gop" : 2
},
"frameRate" : [ 25, 22, 20, 18, 16, 15, 12, 10, 8, 6, 4, 2 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 1440,
"profile" : [ "Base", "Main", "High" ],
"size" : "2560*1440",
"vType" : "h264",
"width" : 2560
},
},
"subStream" : {
"bitRate" : [ 64, 128, 160, 192, 256, 384, 512 ],
"default" : {
"bitRate" : 256,
"frameRate" : 10,
"gop" : 4
},
"frameRate" : [ 15, 10, 7, 4 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 360,
"profile" : [ "Base", "Main", "High" ],
"size" : "640*360",
"vType" : "h264",
"width" : 640
}
{
8192 ],
"audio" : "boolean",
"chnBit" : 1,
"mainStream" : {
"bitRate" : [ 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168,
"default" : {
"bitRate" : 6144,
"frameRate" : 25,
"gop" : 2
},
"frameRate" : [ 25, 22, 20, 18, 16, 15, 12, 10, 8, 6, 4, 2 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 1296,
"profile" : [ "Base", "Main", "High" ],
"size" : "2304*1296",
"vType" : "h264",
"width" : 2304
]
}
},
"value" : {
},
"subStream" : {
"bitRate" : [ 64, 128, 160, 192, 256, 384, 512 ],
"default" : {
"bitRate" : 256,
"frameRate" : 10,
"gop" : 4
},
"frameRate" : [ 15, 10, 7, 4 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 360,
"profile" : [ "Base", "Main", "High" ],
"size" : "640*360",
"vType" : "h264",
"width" : 640
}
]
}
}
"Enc" : {
"audio" : 1,
"channel" : 0,
"mainStream" : {
"bitRate" : 6144,
"frameRate" : 25,
"gop" : 2,
"height" : 2160,
"profile" : "High",
"size" : "3840*2160",
"vType" : "h265",
"width" : 3840
},
"subStream" : {
"bitRate" : 256,
"frameRate" : 10,
"gop" : 4,
"height" : 360,
"profile" : "High",
"size" : "640*360",
"vType" : "h264",
"width" : 640
}
}
2.6.2 Get encoding configuration through short session
connection
The short connection interface is for users to skip the process of logging
in to the IP Camera to get token. In this way, users just need the user
name and password to access the IP Camera easily. Here is how short
connection works.
The request url:
https://<camera_ip>/api.cgi?cmd=GetEnc&user=admin&password=xxxx
The request body:
[
{
}
]
"cmd":"GetEnc",
"action":1,
"param":{
"channel":0
}
Response:
[
{
"cmd" : "GetEnc",
"code" : 0,
"initial" : {
"Enc" : {
"audio" : 0,
"channel" : 0,
"mainStream" : {
"bitRate" : 6144,
"frameRate" : 25,
"gop" : 2,
"height" : 2160,
"profile" : "High",
"size" : "3840*2160",
"vType" : "h265",
"width" : 3840
},
"subStream" : {
"bitRate" : 256,
"frameRate" : 10,
"gop" : 4,
"height" : 360,
"profile" : "High",
"size" : "640*360",
"vType" : "h264",
"width" : 640
}
}
},
"range" : {
"Enc" : [
{
"audio" : "boolean",
"chnBit" : 1,
"mainStream" : {
"bitRate" : [ 4096, 5120, 6144, 7168, 8192 ],
"default" : {
"bitRate" : 6144,
"frameRate" : 25,
"gop" : 2
},
"frameRate" : [ 25, 22, 20, 18, 16, 15, 12, 10, 8, 6, 4, 2 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 2160,
"profile" : [ "Base", "Main", "High" ],
"size" : "3840*2160",
"vType" : "h265",
"width" : 3840
},
"subStream" : {
"bitRate" : [ 64, 128, 160, 192, 256, 384, 512 ],
"default" : {
"bitRate" : 256,
"frameRate" : 10,
"gop" : 4
},
"frameRate" : [ 15, 10, 7, 4 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 360,
"profile" : [ "Base", "Main", "High" ],
"size" : "640*360",
"vType" : "h264",
"width" : 640
}
},
{
8192 ],
"audio" : "boolean",
"chnBit" : 1,
"mainStream" : {
"bitRate" : [ 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168,
"default" : {
"bitRate" : 6144,
"frameRate" : 25,
"gop" : 2
},
"frameRate" : [ 25, 22, 20, 18, 16, 15, 12, 10, 8, 6, 4, 2 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 1440,
"profile" : [ "Base", "Main", "High" ],
"size" : "2560*1440",
"vType" : "h264",
"width" : 2560
},
{
},
"subStream" : {
"bitRate" : [ 64, 128, 160, 192, 256, 384, 512 ],
"default" : {
"bitRate" : 256,
"frameRate" : 10,
"gop" : 4
},
"frameRate" : [ 15, 10, 7, 4 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 360,
"profile" : [ "Base", "Main", "High" ],
"size" : "640*360",
"vType" : "h264",
"width" : 640
}
"audio" : "boolean",
"chnBit" : 1,
"mainStream" : {
"bitRate" : [ 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168,
8192 ],
"default" : {
"bitRate" : 6144,
"frameRate" : 25,
"gop" : 2
},
"frameRate" : [ 25, 22, 20, 18, 16, 15, 12, 10, 8, 6, 4, 2 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 1296,
"profile" : [ "Base", "Main", "High" ],
"size" : "2304*1296",
"vType" : "h264",
"width" : 2304
]
}
},
"subStream" : {
"bitRate" : [ 64, 128, 160, 192, 256, 384, 512 ],
"default" : {
"bitRate" : 256,
"frameRate" : 10,
"gop" : 4
},
"frameRate" : [ 15, 10, 7, 4 ],
"gop" : {
"max" : 4,
"min" : 1
},
"height" : 360,
"profile" : [ "Base", "Main", "High" ],
"size" : "640*360",
"vType" : "h264",
"width" : 640
}
},
"value" : {
"Enc" : {
"audio" : 1,
"channel" : 0,
]
}
}
}
"mainStream" : {
"bitRate" : 6144,
"frameRate" : 25,
"gop" : 2,
"height" : 2160,
"profile" : "High",
"size" : "3840*2160",
"vType" : "h265",
"width" : 3840
},
"subStream" : {
"bitRate" : 256,
"frameRate" : 10,
"gop" : 4,
"height" : 360,
"profile" : "High",
"size" : "640*360",
"vType" : "h264",
"width" : 640
}
2.7 Preview
Reolink IPC supports rtsp/rtmp/flv video transmission protocol, rtmp/flv
video transmission protocol only supports h264 encoding format video,
and rtsp supports h264 and h265 encoding format video.
2.7.1 rtsp mode preview
The rtsp port is closed by default, so before using the rtsp protocol, you
need to go to Settings -> Network Settings -> Advanced Settings -> Port
Settings to open the rtsp port.
1. main stream url
rtsp://(user name):(password)@(ip address):554/Preview_(channel
number)_main
2. sub stream url
rtsp://(user name):(password)@(ip address):554/Preview_(channel
number)_sub
The following is the rtsp url of the historical version, no longer
recommended, but still compatible.
main stream:
rtsp://(user name):(password)@(ip address):554/h264Preview_(channel number)_main
rtsp://(user name):(password)@(ip address):554/h265Preview_(channel number)_main
rtsp://(user name):(password)@(ip address):554/
Sub stream:
rtsp://(user name):(password)@(ip address):554/h264Preview_(channel number)_sub
Note: The “channel number” starts from 01
example:
1.Preview ipc device video
rtsp://admin:xxxx@192.168.123.145:554/Preview_01_main
2.Preview the video of the third channel of nvr
rtsp://admin:xxxx@192.168.0.206:554/Preview_03_main
2.7.2 rtmp mode preview
The rtmp port is closed by default, so before using the rtmp protocol,
you need to go to Settings -> Network Settings -> Advanced Settings ->
Port Settings to open the rtmp port.
The rtmp protocol only supports videos in h264 encoding format, and
videos in h265 encoding format are not supported yet.
1. Main stream url:
rtmp://(ip address)/bcs/channel(channel id)_main.bcs?channel=(channel
id)&stream=0&user=(user name)&password=(user password)
2. Ext stream url:
rtmp://(ip address)/bcs/channel(channel id)_ext.bcs?channel=(channel
id)&stream=0&user=(user name)&password=(user password)
3. Sub stream url:
rtmp://(ip address)/bcs/channel(channel id)_sub.bcs?channel=(channel
id)&stream=1&user=(user name)&password=(user password)
Note: The “channel id” starts from 0