Marksunshine 2018-03-30 07:33 采纳率: 0%
浏览 4401
已结题

在腾讯云搭建了一个RTMP服务不能进行推流

前提:在腾讯云上使用Linux系统 (CentOS 7.0 64位),用nginx搭建了一个rtmp服务

问题:能够正常访问,如图1,图2,图3
图1:图1
图2:图2
图3:图3

但是使用推流软件OBS进行推流的时候却不能推流成功,不知道是什么情况?
以下是使用推流软件OBS的相关截图:图4,图5
图4:图4
图5:图5
图5中URL我尝试过用
rtmp://xxx.xxx.xxx.xxx:1953/mylive/test01
rtmp://xxx.xxx.xxx.xxx/mylive/test01
rtmp://xxx.xxx.xxx.xxx/mylive
rtmp://xxx.xxx.xxx.xxx:1953/hls/test01
rtmp://xxx.xxx.xxx.xxx/hls/test01
rtmp://xxx.xxx.xxx.xxx/hls
都没有用

在nginx.conf配置过以下信息:
第一种:

 #user  nobody;
worker_processes  1;

error_log  logs/error.log;
error_log  logs/error.log  notice;
error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}

rtmp {

    server {

        listen 1935;

        chunk_size 4000;

        # TV mode: one publisher, many subscribers
        application mylive {

            # enable live streaming
            live on;

            # record first 200M of stream
            record all;
            record_path /home/live_record;
            record_max_size 200M;

            hls on;
            hls_path /home/hls;
            hls_fragment 1s;
            hls_playlist_length 5;

            allow play all;

            #on_publish 'http://when start publish live call this url';
            #on_done 'http://when live stop call this url';
        }
    }
}

http {
    server {
        listen       8080;

        # This URL provides RTMP statistics in XML
        location /stat {
            rtmp_stat all;

            # Use this stylesheet to view XML as web page
            # in browser
            rtmp_stat_stylesheet stat.xsl;
        }

        location /stat.xsl {
            # XML stylesheet to view RTMP stats.
            # Copy stat.xsl wherever you want
            # and put the full directory path here
            root /usr/local/nginx/html/;
        }

        location /hls {
            # Serve HLS fragments
            types {
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }
            root /home;
            add_header Cache-Control no-cache;
        }
   }

}

第二种:

 server {
  listen 8080;

  location /stat {
    rtmp_stat all;
    rtmp_stat_stylesheet stat.xsl;
    }

  location /stat.xsl {
    root /usr/local/rtmp/nginx-rtmp-module.1.1.4/; #在nginx-rtmp-module源码根目录
    }
  }


    #rtmp点播配置
  rtmp {
    server {
    listen 1935;
    chunk_size 4000;
    application vod {
      play /usr/local/nginx/vod/flvs; #点播媒体文件存放目录
      }
    }
  }

第三种:

 work_processes 4;
events{
    work_connections 1024;
}

http{
    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;
    server{
        listen 80;
        server_name localhost;
        location /{
            root html;
            insex index.html index.htm;
            }
        location /hls{
            alias /tmp/app;
            }
        error_page 500 502 503 504 /50x.html;
        location = /50x.html{
            root html;
            }
        }
    }

rtmp{
    server{
        listen 1935;
        chunk_size 4000;
        application liaortmp{
            live on;
            }
        application liaohls{
            live on;
            hls on;
            hls_path /tmp/app;
            hls_fragment 15s;
            }
        }
    }

以上等等。。。,最终都是以下面这种情况(图6)告败,不知道问题出在哪里,请各位大佬帮助小弟解惑,在此无限感激!

图6:图6

  • 写回答

2条回答

  • fengye2two 2018-12-20 06:42
    关注

    你那nginx架设在本机服务器上看看;如果不是防火墙的原因,看看是不是局域网的原因,有可能局域网做了限制,网管人员为了网络质量限制了
    端口1935

    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划