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

前提:在腾讯云上使用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个回答

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

你好,请问你的问题解决了吗?我也遇到了相同的问题,谢谢

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐