SRS3.0 流叠图 RuntimeError: dictionary changed size during iteration

参考SRS wiki:https://github.com/ossrs/srs/wiki/v3_CN_Snapshot


在使用最新srs3.0版本流叠图功能时,经过长时间的测试,出现如下报错:

[23/Jun/2017:23:15:56] ENGINE Error in 'main' listener <bound method SrsWorker.main of <__main__.SrsWorker object at 0x26df690>>
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/CherryPy-3.2.4-py2.6.egg/cherrypy/process/wspbus.py", line 197, in publish
    output.append(listener(*args, **kwargs))
  File "research/api-server/server.py", line 930, in main
    for url in self.__snapshots:
RuntimeError: dictionary changed size during iteration

Traceback (most recent call last):
  File "research/api-server/server.py", line 1048, in <module>
    cherrypy.quickstart(root, '/', conf)
  File "/usr/lib/python2.6/site-packages/CherryPy-3.2.4-py2.6.egg/cherrypy/__init__.py", line 174, in quickstart
    engine.block()
  File "/usr/lib/python2.6/site-packages/CherryPy-3.2.4-py2.6.egg/cherrypy/process/wspbus.py", line 302, in block
    self.wait(states.EXITING, interval=interval, channel='main')
  File "/usr/lib/python2.6/site-packages/CherryPy-3.2.4-py2.6.egg/cherrypy/process/wspbus.py", line 357, in wait
    _wait()
  File "/usr/lib/python2.6/site-packages/CherryPy-3.2.4-py2.6.egg/cherrypy/process/wspbus.py", line 344, in _wait
    self.publish(channel)
  File "/usr/lib/python2.6/site-packages/CherryPy-3.2.4-py2.6.egg/cherrypy/process/wspbus.py", line 215, in publish
    raise exc
cherrypy.process.wspbus.ChannelFailures: RuntimeError('dictionary changed size during iteration',)

报警提示:在SRS目录research/api-server/server.py  930行,

来到server.py文件

class SrsWorker(cherrypy.process.plugins.SimplePlugin):
    def __init__(self, bus):
        cherrypy.process.plugins.SimplePlugin.__init__(self, bus);
        self.__snapshots = {}

    def start(self):
        print "srs worker thread started"

    def stop(self):
        print "srs worker thread stopped"

    def main(self):
        for url in self.__snapshots:  //930行
            snapshot = self.__snapshots[url]
            
            diff = time.time() - snapshot['timestamp']
            process = snapshot['process']
            
            # aborted.
            if process is not None and snapshot['abort']:
                process.kill()
                process.poll()
                del self.__snapshots[url]
                print 'abort snapshot %s'%snapshot['cmd']
                break

将其修改为 for url in self.__snapshots.keys():

重新运行 :

python research/api-server/server.py 8085

ok了!!



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SRS SRS/3.0,OuXuli,是一个流媒体集群,支持RTMP/HLS/WebRTC/SRT/GB28181,高效、稳定、易用,简单而快乐。 SRS is a RTMP/HLS/WebRTC/SRT/GB28181 streaming cluster, high efficiency, stable and simple. Remark: Although SRS is licenced under MIT, but there are some depended libraries which are distributed using their own licenses, please read License Mixing. Usage >>> Step 1: Get SRS. git clone https://gitee.com/winlinvip/srs.oschina.git srs && cd srs/trunk && git remote set-url origin https://github.com/ossrs/srs.git && git pull Note: We use mirrors(gitee) here, but it's also ok to directly clone by git clone https://github.com/ossrs/srs.git && cd srs/trunk >>> Step 2: Build SRS. ./configure && make Remark: Recommend to use Centos7 64bits, please read wiki(CN,EN). Note: You can also build SRS in docker, please read docker. Step 3: Run SRS ./objs/srs -c conf/srs.conf >>> Whatever, you can also directly run SRS in docker: docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 \ registry.cn-hangzhou.aliyuncs.com/ossrs/srs:3 Note: Again, we use ACR here, you can directly run in docker hub by docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 ossrs/srs:3 >>> From here, strongly recommend to read bellow wikis: Usage: How to delivery RTMP?(CN, EN) Usage: How to delivery RTMP Edge Cluster?(CN, EN) Usage: How to create a RTMP Origin Cluster?(CN, EN) Usage: How to delivery HTTP FLV Live Streaming?(CN, EN) Usage: How to delivery HTTP FLV Live Streaming Cluster?(CN, EN) Usage: How to delivery HLS?(CN, EN) Usage: How to delivery HLS for other codec?(CN, EN) Usage: How to transode RTMP stream by FFMPEG?(CN, EN) Usage: How to forward stream to other servers?(CN, EN) Usage: How to deploy in low lantency mode?(CN, EN) Usage: How to ingest file/stream/device to RTMP?(CN, EN) Usage: How to delivery HLS by SRS HTTP server?(CN, EN) Usage: How to publish h.264 raw stream as RTMP? (CN, EN) Usage: How to improve edge performance by multiple CPUs? (CN, EN) Usage: Why choose SRS? About the milestone and product

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值