channels.conf 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # ============================================================
  2. # 通过海康 ISAPI 批量配置主码流/子码流 示例
  3. #
  4. # 特点:
  5. # 1) 只需填写每台相机的 IP / 账号 / 密码 / 登录通道号,
  6. # 程序自动拼出 主码流(Channels/101) / 子码流(Channels/102)
  7. # RTSP URL,无需手写一长串 URL。
  8. # 2) 启动时通过 ISAPI 读取每台相机编码参数(分辨率/码率/帧率),
  9. # 写入故障日志。
  10. # 3) 可选:通过 [isapi_write] 把指定通道的分辨率/帧率/码率写回相机。
  11. #
  12. # 注意:ISAPI 走 HTTP(默认80),RTSP 走 554;两者端口分开配。
  13. # 运行: ./build/rtsp_multi_view -c channels_isapi.conf
  14. # ============================================================
  15. [output]
  16. 1920 1080
  17. letterbox = 0 ; 少黑边:4:3 画面轻微拉伸铺满各自格子
  18. grid_lines = 1 ; 画面之间画分隔线
  19. # ------------------------------------------------------------
  20. # [camera_list] 批量相机清单(自动生成主/子码流 URL)
  21. # 格式: <id> <ip> <user> <pass> [login_chan] [rtsp_port] [http_port]
  22. # id : 布局/流 里用的编号(0-7)
  23. # ip : 相机 IP 或域名
  24. # user/pass : 相机登录账号密码
  25. # login_chan : 海康登录通道号,默认 1(可留空)
  26. # rtsp_port : RTSP 端口,默认 554
  27. # http_port : ISAPI HTTP 端口,默认 80
  28. #
  29. # 生成规则(海康固定协议):
  30. # 子码流 = rtsp://user:pass@ip:rtsp_port/Streaming/Channels/{chan*100+2}
  31. # 主码流 = rtsp://user:pass@ip:rtsp_port/Streaming/Channels/{chan*100+1}
  32. #
  33. # 一旦配置了 [camera_list],它会**取代** [streams] 和 [main_streams];
  34. # 未配置时仍按旧的 [streams]/[main_streams] 方式。
  35. # ------------------------------------------------------------
  36. [camera_list]
  37. 0 192.168.1.121 admin hd135792468 1 554 80
  38. 1 192.168.1.122 admin hd135792468 1 554 80
  39. 2 192.168.1.123 admin hd135792468 1 554 80
  40. 3 192.168.1.124 admin hd135792468 1 554 80
  41. 4 192.168.1.125 admin hd135792468 1 554 80
  42. 5 192.168.1.126 admin hd135792468 1 554 80
  43. 6 192.168.1.129 admin hd135792468 1 554 80
  44. 7 192.168.1.130 admin hd135792468 1 554 80
  45. # ------------------------------------------------------------
  46. # [isapi_write] 可选:启动时通过 ISAPI 把指定通道改成给定规格。
  47. # 格式: <id> <main|sub> <width> <height> <fps> <bitrate_kbps>
  48. # - 只改你填的字段;width/height 必填,fps/bitrate 填 0 表示不改
  49. # - fps 用"帧率"(程序会自动 x100 换算为海康的 maxFrameRate)
  50. # - 危险:会真实修改相机!默认不启用,需要时去掉下面的注释。
  51. # 示例(把相机0主码流改成 1280x720 @ 10fps 2048kbps):
  52. # 0 main 1280 720 10 2048
  53. # ------------------------------------------------------------
  54. [isapi_write]
  55. 0 sub 640 360 25 2048
  56. 1 sub 640 360 25 2048
  57. 2 sub 640 360 25 2048
  58. 3 sub 640 360 25 2048
  59. 4 sub 640 360 25 2048
  60. 5 sub 640 360 25 2048
  61. 6 sub 640 360 25 2048
  62. 7 sub 640 360 25 2048
  63. [layout]
  64. 0 1 2
  65. 3 4 5
  66. 6 7 x
  67. [layout0]
  68. 0 0 0 0 3
  69. 0 0 0 0 4
  70. 0 0 0 0 5
  71. 0 0 0 0 6
  72. 0 0 0 0 7
  73. [layout1]
  74. 1 1 1 1 3
  75. 1 1 1 1 4
  76. 1 1 1 1 5
  77. 1 1 1 1 6
  78. 1 1 1 1 7
  79. [layout2]
  80. 2 2 2 2 3
  81. 2 2 2 2 4
  82. 2 2 2 2 5
  83. 2 2 2 2 6
  84. 2 2 2 2 7
  85. [layout3]
  86. 1 1 2 2 3
  87. 1 1 2 2 4
  88. 1 1 2 2 5
  89. x x x x 6
  90. x x x x 7
  91. [layout4]
  92. 0 0 1 1 3
  93. 0 0 1 1 4
  94. 2 2 x x 5
  95. 2 2 x x 6
  96. x x x x 7
  97. # ---------- 标题栏 ----------
  98. [title]
  99. enable = 1
  100. type = overlay
  101. height = 80
  102. text = 法兰泰克 · 多路视频随动监控
  103. logo = fltk.png
  104. logo_pad = 8
  105. opacity = 200
  106. font = /usr/share/fonts/truetype/wqy/wqy-microhei.ttc
  107. font_size = 48
  108. color = 0xFFFFFF
  109. # ---------- 故障日志 ----------
  110. [log]
  111. file = flog_isapi.txt
  112. rotate_ms = 3600000
  113. max_bytes = 1048576
  114. [plc]
  115. enable = 1
  116. ip = 192.168.1.240
  117. port = 102
  118. area = db ; m | i | q | db
  119. db = 1000 ; 仅 area=db 时有效
  120. read_start = 0 ; 轮询块的起始字节
  121. read_len = 16 ; 每次轮询读取的字节数
  122. poll_ms = 100
  123. reconnect_ms = 3000
  124. tsap_local = 0x0000
  125. tsap_remote = 0x0000
  126. # ---------- PLC 位 -> 布局切换规则 ----------
  127. [plc_rules]
  128. 0 : 1000.6.6,1000.6.7
  129. 1 : 1000.8.4,1000.8.5
  130. 2 : 1000.8.6,1000.8.7
  131. 3 : 1000.6.6,1000.6.7;1000.8.4,1000.8.5
  132. 4 : 1000.6.6,1000.8.4,1000.8.5;1000.8.6,1000.8.7