| | |
| | | import com.ruoyi.system.service.ICarTypeService; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | import com.ruoyi.system.util.JavaCVStreamUtil; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarService { |
| | | |
| | | @Value("${live.output.path}") |
| | | private String outputPath; |
| | | |
| | | @Resource |
| | | private UPExgMsgRegisterClient upExgMsgRegisterClient; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 检测视频播放,清除没有播放的视频流 |
| | | */ |
| | | @Override |
| | | public void taskPlayDetection() { |
| | | List<Car> list = this.list(); |
| | | for (Car car : list) { |
| | | if(!redisTemplate.hasKey("live:" + car.getId())){ |
| | | String folderPath = outputPath + "hls\\" + car.getVehicleNumber(); |
| | | JavaCVStreamUtil.close(car.getId(), folderPath); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |