hardman / AWLive

最简单的iOS 推流代码,视频捕获,软编码(faac,x264),硬编码(aac,h264),横屏直播,美颜,flv编码,rtmp协议,blog内陆续更新代码解析,你想学的知识这里都有,愿意懂直播技术的同学快来看!!
Apache License 2.0
696 stars 194 forks source link

无法连接到rtmp,请帮忙看下。谢谢! #5

Closed yhq-iOS closed 6 years ago

yhq-iOS commented 7 years ago

2017-03-06 16:00:52.669313 BroadCast[5955:319877] [OC] rtmp state changed from(aw_rtmp_state_idle), to(aw_rtmp_state_connecting) 2017-03-06 16:00:52.669682 BroadCast[5955:319838] 连接中 ERROR: RTMP_Connect0, failed to connect socket. 65 (No route to host) aw rtmp closing.......

aw rtmp closed.......

2017-03-06 16:00:52.671246 BroadCast[5955:319877] [OC] rtmp state changed from(aw_rtmp_state_connecting), to(aw_rtmp_state_closed) 2017-03-06 16:00:52.671383 BroadCast[5955:319838] 已关闭 2017-03-06 16:00:52.671538 BroadCast[5955:319877] [OC] rtmp state changed from(aw_rtmp_state_closed), to(aw_rtmp_state_idle) aw rtmp closing.......

[d] closed rtmp context 2017-03-06 16:00:52.671630 BroadCast[5955:319838] 未连接 2017-03-06 16:00:52.671664 BroadCast[5955:319877] [OC] rtmp state changed from(aw_rtmp_state_idle), to(aw_rtmp_state_error_open) 2017-03-06 16:00:52.671749 BroadCast[5955:319877] [OC] rtmp state changed from(aw_rtmp_state_error_open), to(aw_rtmp_state_idle) 2017-03-06 16:00:52.671768 BroadCast[5955:319838] 连接错误 2017-03-06 16:00:52.671816 BroadCast[5955:319877] [OC] rtmp state changed from(aw_rtmp_state_idle), to(aw_rtmp_state_error_net) 2017-03-06 16:00:52.671875 BroadCast[5955:319838] 未连接 2017-03-06 16:00:52.671906 BroadCast[5955:319877] [OC] rtmp state changed from(aw_rtmp_state_error_net), to(aw_rtmp_state_idle) 2017-03-06 16:00:52.671959 BroadCast[5955:319877] startCapture rtmpOpen error!!! retcode=0 2017-03-06 16:00:52.671997 BroadCast[5955:319838] 网络不给力 aw rtmp closing.......

[d] closed rtmp context 2017-03-06 16:00:52.672059 BroadCast[5955:319838] 未连接

hardman commented 7 years ago

是否忘记在info.plist中设置ATS?

X32 commented 6 years ago

请问ios11下需要怎么设置ATS?我也出现这个问题,ios8可以,ios9以上都出现以上错误

X32 commented 6 years ago

 设置了ATS依然连不上

NSAppTransportSecurity
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
AppHock commented 4 years ago

你需要出发一个网络请求 NSURL *url = [NSURL URLWithString:@"***"]; NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *dataTask = [session dataTaskWithURL:url]; [dataTask resume];