Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RTMP Streaming Server implementation: connect/createStream/play message sequence passed, but no video/audio in flashplayer

Hi!

Writing RTMP Streaming Server for streaming AVC+AAC video. And it works fine with rtmpdump. But I can't force it to work in flowplayer and other flash video players.

The message sequence after handshake is similar to FMS / RED5 / erlyvideo / haxevideo servers: I've tried a lot of variations.

From Chrome debug console I can see, what all negotiating messages passed to the flowplayer. The last one is onMetaData. And after this the working sample (rtmp://flash.tvwmedia.net/LiveVideo//Live300) gets NetStream.Buffer.Full. And streaming from my server don't get it.

I'm starting with AVC Header message, containing sps/pps. After it first AVC picture passed. After - AAC header and AAC sample. And then AVC/AAC samples. This dumped OK by rtmpdump - I have working flv on exit. But flowplayer and others does not work.

  1. What can be the problem?
  2. Is there any additional requirements for streams?
  3. Is it possible that broken h264 stream cause flashplayer to stop playing? Is it possible to obtain system messages from flash player, which say about it?

Hope, You can help me :) I'm fighting with this problem over 2 weeks, and now just don't know any variants I can try.

Here is debug log + flv from rtmpdump. It contains negotiating messages and some first samples of media.


Update:

I've fixed one bug: wrong chunk stram ID used for "system" messages (e.g. SetChunkSize). But it's still don't playing. Here is another log, almost the same as wowza produces. And wowza/red5 logs too (to compare).

I've checked the following things, which different in RTMP servers:

  1. Different ChunkStreamIDs (for non-system streams)
  2. Different StreamIDs (on createStream)
  3. 128b ank 4Kb chunk sizes
  4. Unpacked/Packed chunk headers (in prev. log there are unpacked, in new - packed)
  5. Different answers on connect call (from many servers)
  6. Using 57 00, 57 01 video packets (video info/command frame)
  7. Adding 09 (Access Unit Delimiter) NALU before each picture
  8. Different order of audio/video DCR/packets
  9. Audio only/video only

But tuning all that didn't let my server to work anyway :)

Any ideas how to solve this?


Update:

I've made a log through Flazr proxy as Peter suggested. Results are the same. And I can't find the solution: both logs looks good. Maybe I just don't see something easy...


Thank you!

like image 860
zxcat Avatar asked Oct 27 '25 19:10

zxcat


2 Answers

I am not sure what the issue is, but you want to make sure that you are doing the following:

1. Sending pings
2. Handling bytes read/written reports

From the rtmpdump log your flow looks good, I didn't notice anything obvious. There are two more project which may help you depending upon your experience with either C++ or Ruby. The Izumi server is fairly simple and may be easier to follow if you are a Ruby dev.
http://code.google.com/p/rubyizumi/

If you are a C++ guy then look at RTMPd, Andrei knows more about the server side flash process than anyone else that I know of.
http://www.rtmpd.com/

Lastly, if you want another opensource Java Player/Server implementation for learning you can look at Flazr http://flazr.com/

like image 76
Paul Gregoire Avatar answered Oct 29 '25 16:10

Paul Gregoire


I'm the author of Flazr which Mondain referred to (thx Mondain!).

I want to point you to the "proxy server" feature of Flazr. You can connect your flash player (or rtmpdump) to the proxy server and point the proxy server to your server. If you set the log to DEBUG mode, you will get a very detailed log trace of all the RTMP messages in both directions. This has been helpful to me in the past to compare Flazr with other implementations such as Red5. Hope this helps.

like image 24
Peter Thomas Avatar answered Oct 29 '25 16:10

Peter Thomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!