[rtmpdump] Crude fix rtmpdump repeats, "jumps" timestamps backwards

Gunnar gunnar.holm at surfnet.fi
Mon Apr 16 05:02:11 CEST 2012


For some rtmp-servers I get downloaded files which
- are much larger than expected
- when played in mplayer, the video "jumps backwards" every now and then

2 solutions,
- fix the jump-backwards file
- butcher rtmpdump

Added some code to YAMD to check that every timestamp is larger than the 
earlier in the packet-header.
Yes, that was the problem.
Added some more code
- detect timestampnew < teimestampold, and set timestamp search = 
timestampold
- in in this search-mode I "delete" the FLV-tags until the stream 
continues from where it "jumped backwards"

THis worked, the fixed file almost "normal". plays almost perfectly, but 
seems I missed some frames sometimes, some "coder artifacts"

OK, wireshark and finding "how and why". it was easy. I could see slight 
"pauses" in the stream of packets.
Normally the client, rtmpdump just acks the streampackets with a 54 bit 
packet.
But, sometimes a 84 bit "pause" packet!

Looking more closely, the
- rtmp-server send an onstatus and NetStream.Pause.Notify packet (after 
the slight "pause" in packets)
- rtmpdump replies with "rtmp-pause-command" (but at what timestamp??)
- server replies with an NetStream.Unpause.Notify, stream continues 
(from "older timestamp??)

OK,OK, quick butcher-test, made a rtmpdump2.3 version with 
RTMP_SendPause disable

int RTMP_SendPause(RTMP *r, int DoPause, int iTime){
RTMP_LogPrintf("SENDING PAUSE\n") ;
  return 0;
}

WORKED!!

butbut, seems to happen only once, twice during beginning of stream, not 
what I excpected
(without further debugging)

Additionally the stream is now streamed "much slower", clear 
"do-nothings" every now and then, but correctly.

G





More information about the rtmpdump mailing list