views:

78

answers:

2

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!

+2  A: 

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/

Mondain
Thank you! Checking the servers list one by one)
zxcat
If all else fails, make sure that your handshake is correct. It is my assumption that there are bytes in the handshake which are used by the player to decide whether or not things should work. For instance h.264 will not work if the handshake is not exactly as expected by the player.
Mondain
Yeah, you are absolutely right with H264! Looks like flash player can accept only FLV1 video in case of old handshake done. I've implemented new version and now it works fine. Thank you!
zxcat
I am glad to hear that its working!! that was a real headache for us.
Mondain
+1  A: 

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.

Peter Thomas
Thank you for your answer! Now trying to pass through rtmpd client (thanks to Eugen-Andrei Gavriloaie). I'll check Flazr too, if this will not give the solution.
zxcat
heh, can't find the answer with the Flazr too :)
zxcat