tcp 推流调整

This commit is contained in:
shikong 2023-10-06 14:05:07 +08:00
parent 67ccc748e7
commit 2ea45c9754
2 changed files with 6 additions and 4 deletions

View File

@ -209,7 +209,8 @@ public class InviteRequestProcessor implements MessageProcessor {
add(timeDescription);
}});
String[] mediaTypeCodes = new String[]{"98","96"};
MediaDescription respMediaDescription = SdpFactory.getInstance().createMediaDescription("video", port, 0, SdpConstants.RTP_AVP, mediaTypeCodes);
String protocol = ((MediaDescription) gb28181Description.getMediaDescriptions(true).get(0)).getMedia().getProtocol();
MediaDescription respMediaDescription = SdpFactory.getInstance().createMediaDescription("video", port, 0, StringUtils.isBlank(protocol)?SdpConstants.RTP_AVP:protocol, mediaTypeCodes);
Arrays.stream(mediaTypeCodes).forEach((k)->{
String v = MediaSdpHelper.RTPMAP.get(k);
respMediaDescription.addAttribute((AttributeField) SdpFactory.getInstance().createAttribute(SdpConstants.RTPMAP, StringUtils.joinWith(Separators.SP,k,v)));

View File

@ -58,10 +58,11 @@ gb28181:
ip: 10.10.10.20
# ip: 192.168.10.32
# ip: 192.168.3.12
# port: 5060
port: 5060
port: 5063
# port: 5061
password: 123456
domain: 4405010000
# id: 44050100002000000002
id: 44050100002000000003
media:
@ -89,7 +90,7 @@ ffmpeg-support:
# input: -re -i
output: -tune zerolatency -vcodec libx264 -acodec aac -preset ultrafast -vf scale=640:-1 -f flv #rtp_mpegts
# output: -vcodec h264 -acodec aac -vf scale=640:-1 -f rtp_mpegts # -rtsp_transport tcp
download: -i http://10.10.10.200:5081/live/test.live.flv
download: -i E:\Repository\other\happytime-gb28181-device-x64\666.mp4 -filter:v "setpts=4.0*PTS"
debug:
download: true
input: true