Live stream stopped working

2,513 views
Skip to first unread message

SyRenity

unread,
Oct 18, 2011, 2:29:24 PM10/18/11
to c-rtmp...@googlegroups.com
Hi.

After successfully trying out crtmp last week, it stopped working for me.

Streaming content via following command:
ffmpeg -i file.mp4 -vcodec libx264 -f flv "rtmp://test.local/live/testnow1 buffer=1000"

shows black screen in JWPlayer.

RTMPDUMP complains that:
RTMPDump 2.2.xuggle
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
WARNING: HandShake: client signature does not match!
INFO: Connected...
Caught signal: 13, cleaning up, just a second...
ERROR: WriteN, RTMP send error 32 (42 bytes)
ERROR: RTMP_ReadPacket, failed to read RTMP packet header

And logs show following error:
http://pastie.org/private/s1zipa1yy26dda2ogervoa

Seems as crmtpserver unable to find the live stream being pushed.

Any idea what happened, and how to get it working again?

Regards.

C++ RTMP Server

unread,
Oct 18, 2011, 2:53:14 PM10/18/11
to c-rtmp...@googlegroups.com
Please post the entire crtmpserver log output, not only the part where client wants to connect. I'm particularly interested in the part containing the logs with the publish attempt.
Best thing to do, just copy everything

Cheers,
Andrei

> You received this message because you are subscribed to "C++ RTMP Server" mailing list.
> To post to this group, send email to c-rtmp...@googlegroups.com
> To unsubscribe from this group, send email to
> c-rtmp-serve...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/c-rtmp-server?hl=en

SyRenity

unread,
Oct 18, 2011, 5:03:52 PM10/18/11
to c-rtmp...@googlegroups.com

Please post the entire crtmpserver log output, not only the part where client wants to connect. I'm particularly interested in the part containing the logs with the publish attempt.
Best thing to do, just copy everything

C++ RTMP Server

unread,
Oct 18, 2011, 5:29:49 PM10/18/11
to c-rtmp...@googlegroups.com
Hi,

Here is the problem:
"Play request for stream name `testnow1`. Start: 0; length: -1"

The player **specifically** requested the VOD stream, not the live stream. crtmpserver just tries to comply with the request which, obviously, fails

More details here:
http://livedocs.adobe.com/flashmediaserver/3.0/hpdocs/help.html?content=00000185.html

Pay very close attention to NetStream.Play function especially to start and len parameters

Cheers,
Andrei

SyRenity

unread,
Oct 18, 2011, 6:07:39 PM10/18/11
to c-rtmp...@googlegroups.com
Hi.


Here is the problem:
"Play request for stream name `testnow1`. Start: 0; length: -1"

The player **specifically** requested the VOD stream, not the live stream. crtmpserver just tries to comply with the request which, obviously, fails

More details here:
http://livedocs.adobe.com/flashmediaserver/3.0/hpdocs/help.html?content=00000185.html

Pay very close attention to NetStream.Play function especially to start and len parameters


You right, I missed the parameter --live for rtmpdump and it does work now.

But the Flash player (which is the target player) shows black screen. The strangest thing, is that I do hear the audio - but not video.
Moreover, when streaming only video, I see packets coming.

Here are the logs again if they can help:
http://pastie.org/private/hcpr4qtcj7ahxuqhonkgg

Thanks again.

SyRenity

unread,
Oct 18, 2011, 6:34:30 PM10/18/11
to c-rtmp...@googlegroups.com
Ok, it seems the Flash player doesn't send a lot more of requests, compared to rtmpdump:

1318977128:3:/dev/crtmpserver/sources/thelib/src/netio/epoll/tcpacceptor.cpp:154:Accept:Client connected: 192.168.253.32:33368 -> 0.0.0.0:1935
1318977128:2:/dev/crtmpserver/sources/thelib/src/protocols/rtmp/inboundrtmpprotocol.cpp:123:ValidateClient:This version of player doesn't support validation
1318977128:2:/dev/crtmpserver/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:506:ProcessUsrCtrl:User control message type: RM_USRCTRL_TYPE_STREAM_SET_BUFFER_LENGTH
1318977128:3:/dev/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:227:SignalStreamRegistered:Stream NR(55) with name `` registered to application `flvplayback` from protocol IR(44)
1318977128:2:/dev/crtmpserver/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:1239:ProcessInvokeGeneric:Default implementation of ProcessInvokeGeneric: Request: FCSubscribe
1318977128:2:/dev/crtmpserver/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:1239:ProcessInvokeGeneric:Default implementation of ProcessInvokeGeneric: Request: _checkbw
1318977128:3:/dev/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:238:SignalStreamUnRegistered:Stream NR(55) with name `` unregistered from application `flvplayback` from protocol IR(44)
1318977128:3:/dev/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:227:SignalStreamRegistered:Stream NR(56) with name `` registered to application `flvplayback` from protocol IR(44)
1318977128:3:/dev/crtmpserver/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:900:ProcessInvokePlay:Play request for stream name `testbox`. Start: -2; length: -1
1318977128:3:/dev/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:238:SignalStreamUnRegistered:Stream NR(56) with name `` unregistered from application `flvplayback` from protocol IR(44)
1318977128:3:/dev/crtmpserver/sources/thelib/src/application/baseclientapplication.cpp:227:SignalStreamRegistered:Stream ONR4R(57) with name `testbox` registered to application `flvplayback` from protocol IR(44)
1318977128:2:/dev/crtmpserver/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp:506:ProcessUsrCtrl:User control message type: RM_USRCTRL_TYPE_STREAM_SET_BUFFER_LENGTH


Namely the RM_USRCTRL_TYPE_STREAM_SET_BUFFER_LENGTH message is nowhere to be seen.

I will check the copy of JWPLAYER I'm using, but are there any Flash based testing tools I can use?

Thanks.

C++ RTMP Server

unread,
Oct 18, 2011, 8:56:56 PM10/18/11
to c-rtmp...@googlegroups.com
After fixing crtmpserver, you should get meaningful error message now. And here is an interesting comment from ffmpeg sources:

/* hack for Wowza Media Server, it does not send result for
* releaseStream and FCPublish calls */

crtmpserver now sends responses to all of them, including releaseStream. Before, it wasn't sending response releaseStream because the stream was not there. But, obviously, ffmpeg crashes because it is not expecting _error message. On the other hand, why are they NOT expecting _error message?
They send releaseStream before doing publish. So the stream may not be there.

Finally, here is the error message spit out by ffmpeg:

[rtmp @ 0x7fc191c19620] Server error: Specified stream not found in call to releaseStream

You guessed, crtmpserver is sending that message and it makes perfect sense.

Bottom line, ffmpeg should fix rtmp module *properly* and not with hacks for "some" servers

Cheers,
Andrei

Josh Allmann

unread,
Oct 18, 2011, 9:20:59 PM10/18/11
to c-rtmp...@googlegroups.com
Here is a patch that I wrote last week to fix ffmpeg's rtmp for rtmpd.
It's been tested with rtmpd rev 671; not sure about current trunk.

https://gist.github.com/1297236

Josh

SyRenity

unread,
Oct 18, 2011, 10:33:05 PM10/18/11
to c-rtmp...@googlegroups.com
I found it. The problem was in Flash player buffer which I set on 0, following a reply I read here in mailing list:

Everybody thinks it has something to do with the server.

The server does what it is supposed to do: takes bytes from the "inbound pipe" and shoves them on the "outbound pipe". It does NOT caches/buffers them in any way. The faulty piece is the flash player itself. Modify your flash application and setup the buffer time to be 0 (not 0.1, not 1, not anything else). This basically disables any buffering made on the flash side. The overall latency will drop below 100 ms basically becoming the TCP latency


It seems that buffer of 0 causes unstable behaviour on Flash player side. Have you experienced the same? What values are recommended for lowest buffer while still being stable?

SyRenity

unread,
Oct 18, 2011, 10:34:53 PM10/18/11
to c-rtmp...@googlegroups.com
Hi Josh.



Here is a patch that I wrote last week to fix ffmpeg's rtmp for rtmpd.
It's been tested with rtmpd rev 671; not sure about current trunk.

https://gist.github.com/1297236

 What this patch does? As FFMPEG works out of box for me now (after the buffer value was fixed).
s it compatible with rtmpdump librtmp library?

Regards.

Josh Allmann

unread,
Oct 18, 2011, 11:21:47 PM10/18/11
to c-rtmp...@googlegroups.com

It's a fix for ffmpeg's native rtmp, not librtmp. It does 2 things:

-Disables the releaseStream and FCPublish calls for outbound streams

-Fixes invokes to use a counter instead of hardcoded values

The patch might not be needed after Andrei's latest commits (r686 and
r687). I just posted it for the benefit of those who might be trying
to get ffmpeg publishing to work with a slightly older rtmpd.

Josh

SyRenity

unread,
Oct 20, 2011, 10:16:14 AM10/20/11
to c-rtmp...@googlegroups.com
I see, any idea if rtmplib has these fixes already inside?

I'm asking this because I want to move from FFMPEG built-in to librtmp, which seems to be much more stable implementation.

Regards.
Reply all
Reply to author
Forward
0 new messages