1

我发现自己处于一个奇怪的境地。我正在尝试使用教程配置流服务器,但不幸的是没有成功。目前我有最新版本的 rtmpd 服务器(内部版本号:784),可以在这里找到找到。我按照教程上的说明安装了它。到目前为止一切顺利,问题是我无法使用 flowplayer 示例测试服务器。

配置文件:

configuration=
{
  daemon=false,
  pathSeparator="/",
  logAppenders=
  {
      {
          name="console appender",
          type="coloredConsole",
          level=6
      },
      {
          name="file appender",
          type="file",
          level=6,
          fileName="/opt/crtmpserver/logs/crtmpserver.log",
      }
  },

  applications=
  {
      rootDirectory="applications",
      {
          description="FLV Playback",
          name="flvplayback",
          protocol="dynamiclinklibrary",
          default=true,
          aliases=
          {
              "simpleLive",
              "vod",
              "live",
              "WeeklyQuest",
              "SOSample",
              "oflaDemo",
          },
          acceptors =
          {
              {
                  ip="0.0.0.0",
                  port=1935,
                  protocol="inboundRtmp"
              },
              {
                  ip="0.0.0.0",
                  port=6666,
                  protocol="inboundLiveFlv",
                  waitForMetadata=true,
              },
              {
                  ip="0.0.0.0",
                  port=9999,
                  protocol="inboundTcpTs"
              },
          },

          externalStreams =
          {
              {
                  uri="rtsp://user:pass@link-to-stream",
                  localStreamName="pidg",
                  forceTcp=true,
              },
          },
          validateHandshake=true,
          keyframeSeek=true,
          seekGranularity=1.5, --in seconds, between 0.1 and 600
          clientSideBuffer=12, --in seconds, between 5 and 30
          --generateMetaFiles=true, --this will generate seek/meta files on application startup
          --renameBadFiles=false,
      mediaFolder="/opt/crtmpserver/media"
      },
  }
}

rtsp 流的链接有效,并且已经使用 ffplay 和 vlc 进行了测试。

错误

我得到,在尝试连接到流时是:

/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 3->4 IOHT_TCP_CARRIER
/thelib/src/netio/epoll/tcpacceptor.cpp:185 Client connected: 127.0.0.1:50947 -> 127.0.0.1:1935
/thelib/src/application/baseclientapplication.cpp:257 Stream NR(1) with name `` registered to application `flvplayback` from protocol IR(4)
/thelib/src/application/baseclientapplication.cpp:268 Stream NR(1) with name `` unregistered from application `flvplayback` from protocol IR(4)
/thelib/src/application/baseclientapplication.cpp:257 Stream NR(2) with name `` registered to application `flvplayback` from protocol IR(4)
/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:1043 Play request for stream name `pidg`. Start: -2; length: -1
/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:2164 No live streams found: `pidg` or `pidg`
/thelib/src/mediaformats/readers/streammetadataresolver.cpp:207 Stream name pidg not found in any storage
/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:1075 We are going to wait for the live stream `pidg`
/thelib/src/application/baseclientapplication.cpp:268 Stream NR(2) with name `` unregistered from application `flvplayback` from protocol IR(4)
/thelib/src/application/baseclientapplication.cpp:257 Stream ONR4R(3) with name `pidg` registered to application `flvplayback` from protocol IR(4)

流量播放器

代码是:

<script>
$f("rtmp_player", "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", {
        clip: {
               url : 'pidg',
               live : true,
               provider: 'rtmp',
              },

        plugins: {
               rtmp: {
               url: 'flowplayer.rtmp-3.2.13.swf',
               netConnectionUrl: 'rtmp://127.0.0.1/flvplayback' ,
                       subscribe:true,

                }
              }
            });
</script>

我试图使它与教程相似,因为此时我无法共享流。

我已经失去了很多时间试图自己解决它,你能帮我吗?

编辑:

经过一些测试,我发现问题在于服务器没有流式传输外部流!

4

1 回答 1

0

我对纯 rtmpd 解决方案很感兴趣,但不幸的是我没有时间提供一个,所以我决定切换到 libav 进行编码并将其流式传输到 127.0.0.1:6666。我使用的命令是:

avconv -options -i rtsp_link -options -f flv metadata -title='cam' -streamName='cam' 'tcp://127.0.0.1:6666'

我设法从链接 rtmp://127.0.0.1/live/cam 播放它

如果有人设法提供纯 rtmpd 解决方案,我会很乐意接受它而不是我的答案,但现在,我会接受我的,以防其他人遇到同样的问题。

于 2014-07-12T10:58:38.403 回答