2017-09-12 69 views
0

能否请你告诉我会是我,如果我使用下面的代码在nginx.conf会有什么RTMP网址为nginx的

rtmp { 
    server { 
     listen 1935; # Listen on standard RTMP port 
     chunk_size 4000; 

     application show { 
      live on; 
      pull rtmp://THIS_IS_SOME_STREAM live=1; 

      hls on; 
      hls_path /mnt/hls/; 
      hls_fragment 3; 
      hls_playlist_length 60; 
     } 
    } 
} 

我试过,但它没有工作流网址是什么: rtmp://My_Server_Ip/show

编辑

rtmp { 
     server { 
       listen 1935; 
       chunk_size 4000; 
       application live2 { 
         live on; 
         pull rtmp://Stream_IP app=vod/demo.mp4 name=okstr live=1; 
       } 
     } 
} 

rtmp { 
     server { 
       listen 1935; 
       chunk_size 4000; 
       application live2 { 
         live on; 
         pull rtmp://Stream_IP/vod/demo.mp4 name=okstr live=1; 
       } 
     } 
} 

然后我在VLC中尝试了下面的URL,但它没有任何显示视频也没有任何错误。

http://My_IP/live2/okstr

回答

1

的一般格式是:[rtmp://]host[:port][/app[/playpath]]

pull的情况下,如果playpath是空的,它使用当前流名称。

您或者没有设置播放路径,拉不起作用或防火墙阻止RTMP。检查日志。

+0

你对我没有定义的“玩”路径是正确的。我尝试了一些设置,但流不播放。它不会在VLC中显示任何错误,它只是不会播放。我觉得我很接近解决这个问题,所以请看看它。 我已更新上面的新代码。 –