| | |
| | | h264Encoder = new H264Encoder(); |
| | | |
| | | // 设置编码参数(使用配置中的参数) |
| | | int width = config.width; |
| | | int height = config.height; |
| | | int framerate = config.framerate; |
| | | |
| | | |
| | | // 设置编码参数(使用配置中的参数) |
| | | int width = config != null ? config.width : DEFAULT_WIDTH; |
| | | int height = config != null ? config.height : DEFAULT_HEIGHT; |
| | | int framerate = config != null ? config.framerate : DEFAULT_FRAME_RATE; |
| | | h264Encoder.setEncoderParams(width, height, framerate, DEFAULT_BITRATE); |
| | | |
| | | // 禁用文件输出 |
| | |
| | | |
| | | // 设置协议参数(使用默认值,可根据需要从配置中添加) |
| | | // TODO: 如果需要在JSON配置中添加simCardNumber和logicalChannelNumber,可以在这里解析 |
| | | h264Encoder.setProtocolParams("123456789012", (byte)1); |
| | | h264Encoder.setProtocolParams("013120122580", (byte)1); |
| | | |
| | | // 初始化并启动(使用配置中的分辨率) |
| | | int[] resolution = {width, height}; |