glaciall / jtt1078-video-server

基于JT/T 1078标准实现的视频转播服务器
Other
291 stars 137 forks source link

Connection to tcp://localhost:1935 failed #9

Closed fizzxue closed 4 years ago

fizzxue commented 5 years ago

java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcherImpl.write0(Native Method) at sun.nio.ch.FileDispatcherImpl.write(FileDispatcherImpl.java:60) at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) at sun.nio.ch.IOUtil.write(IOUtil.java:65) at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:211) at cn.org.hentai.jtt1078.video.PublisherManager$Publisher.publish(PublisherManager.java:194) at cn.org.hentai.jtt1078.video.PublisherManager.publish(PublisherManager.java:82) at cn.org.hentai.jtt1078.server.Jtt1078Handler.channelRead0(Jtt1078Handler.java:60) at cn.org.hentai.jtt1078.server.Jtt1078Handler.channelRead0(Jtt1078Handler.java:19) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1414) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:945) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:146) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) ideo: h264 (Main), yuv420p, 352x288, 25 fps, 25 tbr, 1200k tbn, 50 tbc [tcp @ 0x24f38c0] Connection to tcp://localhost:1935 failed (Connection refused), trying next address rtmp://localhost/ccav/013800138000-1: Input/output error [hentai] 2019-06-25 15:14:10,684 [DEBUG] [video-server] - PublisherManager - publisher-1 timeout and close automatically

glaciall commented 5 years ago

你的本机安装了nginx以及配置好了rtmp了吗? 从报错上来看,你应该是没有弄上。你可以参考下面这个网址配置一个再试试看看: https://blog.csdn.net/heng615975867/article/details/80519274

只要按照这篇文章,直到第四步就OK了。。。 另外,项目文件的/src/main/resources/nginx_rtmp.conf就是一个在nginx上配置rtmp的一个配置文件样例,好了,祝你成功。。。

fizzxue commented 5 years ago

首先感觉楼主不吝赐教,我本机装过了nginx, image

glaciall commented 5 years ago

这就很奇怪了,是直接就没法连接,还是连接了一段时间后才无法连接的?

fizzxue commented 5 years ago

直接就无法连接,楼主有没有网页播放h264视频的解决方案

glaciall commented 5 years ago

那你这个RTMP服务器安装配置得有问题啊,你使用telnet localhost 1935先确保服务正常了再测试吧。 另外,你说的是网页播放RTMP视频的吧?我现在使用的是aliplayer播放rtmp视频的。 https://help.aliyun.com/document_detail/51991.html