修改转码接口以使用127.0.0.1, 作为源IP

pull/10/head
648540858 2020-12-14 10:47:26 +08:00
parent f75b3e6cda
commit e625520bc8
2 changed files with 4 additions and 1 deletions

View File

@ -64,6 +64,7 @@ public class PlayController {
DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(); DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>();
// 超时处理 // 超时处理
result.onTimeout(()->{ result.onTimeout(()->{
logger.warn(String.format("设备点播超时deviceId%s channelId%s", deviceId, channelId));
RequestMessage msg = new RequestMessage(); RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setData("Timeout"); msg.setData("Timeout");
@ -141,7 +142,8 @@ public class PlayController {
MediaServerConfig mediaInfo = storager.getMediaInfo(); MediaServerConfig mediaInfo = storager.getMediaInfo();
String dstUrl = String.format("rtmp://%s:%s/convert/%s", "127.0.0.1", mediaInfo.getRtmpPort(), String dstUrl = String.format("rtmp://%s:%s/convert/%s", "127.0.0.1", mediaInfo.getRtmpPort(),
streamId ); streamId );
JSONObject jsonObject = zlmresTfulUtils.addFFmpegSource(streamInfo.getRtsp(), dstUrl, "1000000"); String srcUrl = String.format("rtsp://%s:%s/rtp/%s", "127.0.0.1", mediaInfo.getRtspPort(), streamId);
JSONObject jsonObject = zlmresTfulUtils.addFFmpegSource(srcUrl, dstUrl, "1000000");
System.out.println(jsonObject); System.out.println(jsonObject);
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
if (jsonObject != null && jsonObject.getInteger("code") == 0) { if (jsonObject != null && jsonObject.getInteger("code") == 0) {

View File

@ -62,6 +62,7 @@ public class PlaybackController {
DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(); DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>();
// 超时处理 // 超时处理
result.onTimeout(()->{ result.onTimeout(()->{
logger.warn(String.format("设备回放超时deviceId%s channelId%s", deviceId, channelId));
RequestMessage msg = new RequestMessage(); RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setData("Timeout"); msg.setData("Timeout");