fxinfo.py
1.63 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
# -*- coding: utf-8 -*-
# @Time : 2020/12/10 23:00
# @Author : Young Lee
# @Email : young_lee2017@163.com
import os
import time
import re
# 测试平台信息
driver_path = r"D:\chromedriver.exe"
plat_ip = "192.168.9.234"
# chrome_path = r"D:\Program Files\Google\Chrome\Application\chrome.exe"
user = "admin"
passwd = "admin"
login_url = f"http://{plat_ip}:20080"
home_url = f"http://{plat_ip}:20080/#/video_task/config"
# 本地短时录像信息和任务配置信息
videos_dir = r"\\192.168.9.1\t测试\任务信息库\video"
task_cfg_dir = r"\\192.168.9.1\t测试\任务信息库\config"
videos_fullname = [file for file in os.listdir(videos_dir) if file.endswith(".avi") or
file.endswith(".mp4") or file.endswith(".h264")]
videos_name = [os.path.splitext(file)[0] for file in videos_fullname]
videos_path = [os.path.join(videos_dir, file) for file in videos_fullname]
videos_info = {videos_name[i]: videos_path[i] for i in range(len(videos_name))}
task_cfg_fullname = [file for file in os.listdir(task_cfg_dir) if file.endswith(".tar.gz")]
task_cfg_name = [re.search("(.*)_\w+.tar.gz", file).group(1) for file in task_cfg_fullname]
task_cfg_path = [os.path.join(task_cfg_dir, file) for file in task_cfg_fullname]
task_cfg_info = {task_cfg_name[i]: task_cfg_path[i] for i in range(len(task_cfg_name))}
# 获取所有任务信息的接口
tasks_url = f"http://{plat_ip}:20080/api/v1/devconf_fx/tasks?_t={int(time.time())}&offset=0&source_type=pull_video_stream&task_type=normal"
# ffprobe工具路径
ffprobe_path = r"D:\ffmpeg\bin\ffprobe.exe"
# 存储配置路径
storage_config_path = r"D:\StorageConfigTool_r4348\StorageConfig.xml"