L
L
lohmag2015-06-26 18:05:17
linux
lohmag, 2015-06-26 18:05:17

RTMP broadcast ffmpeg+crtmpserver?

It is necessary to organize broadcasting to RTMP from an RTP stream, for a start I decided to broadcast from a file.
I start crtmpserver
+-------------------------------------------------------- ------------------------------+
| Services |
+---+-------+-----+----------------------- --+---------------------------------+
| c | ip | port | protocol stack name | application name |
+---+-------+-----+----------------------- --+-------------------------+
|tcp| 0.0.0.0| 1112| inboundJsonCli| admin |
+---+-------+-----+----------------------- --+------------------------+
|tcp| 0.0.0.0| 1935| inboundRtmp| appselector|
+---+-------+-----+----------------------- --+-------------------------+
|tcp| 0.0.0.0| 8081| inboundRtmps| appselector|
+---+-------+-----+----------------------- --+-------------------------+
|tcp| 0.0.0.0| 8080| inboundRtmpt| appselector|
+---+-------+-----+----------------------- --+-------------------------+
|tcp| 0.0.0.0| 6666| inboundLiveFlv| flvplayback|
+---+-------+-----+----------------------- --+------------------------+
|udp| 0.0.0.0|10000| inboundUdpTs| flvplayback|
+---+-------+-----+----------------------- --+-------------------------+
|tcp| 0.0.0.0| 9999| inboundTcpTs| flvplayback|
+---+-------+-----+----------------------- --+-------------------------+
|tcp| 0.0.0.0| 6665| inboundLiveFlv| proxypublish|
+---+-------+-----+----------------------- --+-------------------------+
|tcp| 0.0.0.0| 8989| httpEchoProtocol| samplefactory|
+---+-------+-----+----------------------- --+-------------------------+
|tcp| 0.0.0.0| 8988| echoProtocol| samplefactory|
+---+-------+-----+----------------------- --+------------------------+
|tcp| 0.0.0.0| 1111| inboundHttpXmlVariant| vptests|
+---+-------+-----+----------------------- --+------------------------+
Then ffmpeg
ffmpeg -re -i /home/nmass/better.call.saul.108.hdtv -lol.mp4 -acodec copy -vcodec copy -f flv -metadata streamName=gigi "tcp://127.0.0.1:6666"
Something starts pouring. I try to open a stream and errors are thrown in crtmpserver

/home/nmass/crtmpserver/sources/thelib/src/protocols/liveflv/inboundliveflvprotocol.cpp:51 _waitForMetadata: 1
/home/nmass/crtmpserver/sources/thelib/src/netio/epoll/iohandlermanager.cpp:100 Handlers count changed: 11->12 IOHT_TCP_CARRIER
/home/nmass/crtmpserver/sources/thelib/src/protocols/liveflv/baseliveflvappprotocolhandler.cpp:45 protocol CTCP(9) <-> TCP(10) <-> [ILFL(11)] registered to app flvplayback
/home/nmass/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:227 Stream INLFLV(10) with name `gigi` registered to application `flvplayback` from protocol ILFL(11)
/home/nmass/crtmpserver/sources/thelib/src/protocols/liveflv/inboundliveflvprotocol.cpp:184 Stream metadata:
<MAP name="" isArray="true">
    <MAP name="__index__value__0" isArray="true">
        <DOUBLE name="audiocodecid">10.000</DOUBLE>
        <DOUBLE name="audiodatarate">101.794</DOUBLE>
        <DOUBLE name="audiosamplerate">48000.000</DOUBLE>
        <DOUBLE name="audiosamplesize">16.000</DOUBLE>
        <STR name="compatible_brands">isom</STR>
        <STR name="creation_time">2015-03-24 01:59:44</STR>
        <DOUBLE name="duration">0.000</DOUBLE>
        <STR name="encoder">Lavf53.21.1</STR>
        <DOUBLE name="filesize">0.000</DOUBLE>
        <DOUBLE name="framerate">23.976</DOUBLE>
        <DOUBLE name="height">406.000</DOUBLE>
        <STR name="major_brand">isom</STR>
        <STR name="minor_version">1</STR>
        <BOOL name="stereo">true</BOOL>
        <STR name="streamName">gigi</STR>
        <DOUBLE name="videocodecid">7.000</DOUBLE>
        <DOUBLE name="videodatarate">589.096</DOUBLE>
        <DOUBLE name="width">720.000</DOUBLE>
    </MAP>
</MAP>
/home/nmass/crtmpserver/sources/thelib/src/protocols/liveflv/innetliveflvstream.cpp:246 Cached the h264 video codec initialization: 47
/home/nmass/crtmpserver/sources/thelib/src/protocols/liveflv/innetliveflvstream.cpp:225 Cached the AAC audio codec initialization: 7
/home/nmass/crtmpserver/sources/thelib/src/netio/epoll/tcpacceptor.cpp:154 Client connected: 192.168.77.170:53727 -> 0.0.0.0:1935
/home/nmass/crtmpserver/sources/thelib/src/netio/epoll/iohandlermanager.cpp:100 Handlers count changed: 12->13 IOHT_TCP_CARRIER
/home/nmass/crtmpserver/sources/applications/appselector/src/rtmpappprotocolhandler.cpp:83 Selected application: flvplayback (live)
/home/nmass/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:216 Protocol CTCP(16) <-> TCP(12) <-> [IR(13)] unregistered from application: appselector
/home/nmass/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:227 Stream NR(11) with name `` registered to application `flvplayback` from protocol IR(13)
/home/nmass/crtmpserver/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:1238 Default implementation of ProcessInvokeGeneric: Request: _checkbw
/home/nmass/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:238 Stream NR(11) with name `` unregistered from application `flvplayback` from protocol IR(13)
/home/nmass/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:227 Stream NR(12) with name `` registered to application `flvplayback` from protocol IR(13)
/home/nmass/crtmpserver/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:892 Play request for stream name `gigi`. Start: -2; length: -1
/home/nmass/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:238 Stream NR(12) with name `` unregistered from application `flvplayback` from protocol IR(13)
/home/nmass/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:227 Stream ONR4R(13) with name `gigi` registered to application `flvplayback` from protocol IR(13)
/home/nmass/crtmpserver/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:507 User control message type: RM_USRCTRL_TYPE_STREAM_SET_BUFFER_LENGTH
/home/nmass/crtmpserver/sources/thelib/src/netio/epoll/tcpcarrier.cpp:78 Unable to read data. 192.168.77.170:53727 -> 192.168.93.246:1935
/home/nmass/crtmpserver/sources/thelib/src/netio/epoll/iohandlermanager.cpp:109 Handlers count changed: 13->12 IOHT_TCP_CARRIER
/home/nmass/crtmpserver/sources/thelib/src/protocols/protocolmanager.cpp:44 Enqueue for delete for protocol [IR(13)]
/home/nmass/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:238 Stream ONR4R(13) with name `gigi` unregistered from application `flvplayback` from protocol IR(13)
/home/nmass/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:216 Protocol [IR(13)] unregistered from application: flvplayback

Tried to pour on different ceptors in flv, mpegts formats via tcp and udp.
I've been trying to get it to work for several days, can anyone advise what?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
thedraik, 2015-06-26
@thedraik

I would suggest using nginx + rtmp module.
I understand that it's like shooting sparrows from a cannon, but it helped me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question