perf(snap): 优化点播成功后截图使用 rtsp 流, 新增对 H265 编码视频截图的支持
| | |
| | | sendPost(mediaServerItem, "kick_sessions",param, null); |
| | | } |
| | | |
| | | public void getSnap(MediaServerItem mediaServerItem, String flvUrl, int timeout_sec, int expire_sec, String targetPath, String fileName) { |
| | | public void getSnap(MediaServerItem mediaServerItem, String streamUrl, int timeout_sec, int expire_sec, String targetPath, String fileName) { |
| | | Map<String, Object> param = new HashMap<>(3); |
| | | param.put("url", flvUrl); |
| | | param.put("url", streamUrl); |
| | | param.put("timeout_sec", timeout_sec); |
| | | param.put("expire_sec", expire_sec); |
| | | sendGetForImg(mediaServerItem, "getSnap", param, targetPath, fileName); |
| | |
| | | |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("api.secret",mediaServerItem.getSecret()); // -profile:v Baseline |
| | | param.put("ffmpeg.snap", "%s -rtsp_transport tcp -i %s -y -f mjpeg -t 0.001 %s"); |
| | | param.put("hook.enable","1"); |
| | | param.put("hook.on_flow_report",""); |
| | | param.put("hook.on_play",String.format("%s/on_play", hookPrex)); |
| | |
| | | onPublishHandlerForPlay(mediaServerItemInuse, response, device.getDeviceId(), channelId); |
| | | hookEvent.response(mediaServerItemInuse, response); |
| | | logger.info("[点播成功] deviceId: {}, channelId: {}", device.getDeviceId(), channelId); |
| | | String streamUrl = String.format("http://127.0.0.1:%s/%s/%s.live.flv", mediaServerItemInuse.getHttpPort(), "rtp", ssrcInfo.getStream()); |
| | | String streamUrl = String.format("rtsp://127.0.0.1:%s/%s/%s", mediaServerItemInuse.getRtspPort(), "rtp", ssrcInfo.getStream()); |
| | | String path = "snap"; |
| | | String fileName = device.getDeviceId() + "_" + channelId + ".jpg"; |
| | | // 请求截图 |