Commit e625520bc8be62a844735195ffa5a76daf021d40
1 parent
f75b3e6c
修改转码接口以使用127.0.0.1, 作为源IP
Showing
2 changed files
with
4 additions
and
1 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java
| ... | ... | @@ -64,6 +64,7 @@ public class PlayController { |
| 64 | 64 | DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(); |
| 65 | 65 | // 超时处理 |
| 66 | 66 | result.onTimeout(()->{ |
| 67 | + logger.warn(String.format("设备点播超时,deviceId:%s ,channelId:%s", deviceId, channelId)); | |
| 67 | 68 | RequestMessage msg = new RequestMessage(); |
| 68 | 69 | msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); |
| 69 | 70 | msg.setData("Timeout"); |
| ... | ... | @@ -141,7 +142,8 @@ public class PlayController { |
| 141 | 142 | MediaServerConfig mediaInfo = storager.getMediaInfo(); |
| 142 | 143 | String dstUrl = String.format("rtmp://%s:%s/convert/%s", "127.0.0.1", mediaInfo.getRtmpPort(), |
| 143 | 144 | streamId ); |
| 144 | - JSONObject jsonObject = zlmresTfulUtils.addFFmpegSource(streamInfo.getRtsp(), dstUrl, "1000000"); | |
| 145 | + String srcUrl = String.format("rtsp://%s:%s/rtp/%s", "127.0.0.1", mediaInfo.getRtspPort(), streamId); | |
| 146 | + JSONObject jsonObject = zlmresTfulUtils.addFFmpegSource(srcUrl, dstUrl, "1000000"); | |
| 145 | 147 | System.out.println(jsonObject); |
| 146 | 148 | JSONObject result = new JSONObject(); |
| 147 | 149 | if (jsonObject != null && jsonObject.getInteger("code") == 0) { | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/playback/PlaybackController.java
| ... | ... | @@ -62,6 +62,7 @@ public class PlaybackController { |
| 62 | 62 | DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(); |
| 63 | 63 | // 超时处理 |
| 64 | 64 | result.onTimeout(()->{ |
| 65 | + logger.warn(String.format("设备回放超时,deviceId:%s ,channelId:%s", deviceId, channelId)); | |
| 65 | 66 | RequestMessage msg = new RequestMessage(); |
| 66 | 67 | msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); |
| 67 | 68 | msg.setData("Timeout"); | ... | ... |