2
votes

I'm recording an H.264 single nalu packet stream over RTP from a grandstream terminal and the playing it back.

The thing is that when I play it back and send it over to the terminal with the RTP module I'm developing, the video skips and I get blurry parts in between frames. I don't know what it's going or might be happening. Here is some data :

The video is recorded and played back at 15 fps The rtp timestamp increment between frames is 6000 (90000khz/15fps) Time intervals between rtp packets are around 66.66 mili secs (1000milis/15fps) and 2 milis if the timestamp is not increased (for picture param sets and other non time related packets).

All this data was gathered sniffing with wireshark.

So, to me the stream looks pretty healthy, but for some reason the playback is bad. Here is a link to a video that shows the playback.

http://youtu.be/TGE14y76lc0

Maybe watching the video someone can recognize what is going on.

Thanks for the help!

1
Could you be losing frames i.e. have you checked that there are no gaps in the RTP sequence numbers? If you're sending over UDP, it often helps to increase the OS's UDP socket buffer sizes (SO_RCVBUF).Ralf
@Ralf thanks for your quick answer, packet drops don't seem to be the issue, but I think I'm having trouble with the jittering buffers and clock skew. According to the wireshark stream analysis : Max delta = 67.19 ms at packet no. 179 Max jitter = 2981129.32 ms. Mean jitter = 90532.21 ms. Max skew = 47698223.33 ms. Total RTP packets = 908 (expected 908) Lost RTP packets = 0 (0.00%) Sequence errors = 0 Duration 23.87 s (961328 ms clock drift, corresponding to 3714017 Hz (+4026.69%)Nicolas Emiliani
@Ralf well, finally I cracked it. There where two issues. The first one with the terminal resetting the rtp timestamp when I was recording, that made my counter overflow and messed up my time stamps when playing back. The other one had to do with what Ralf pointed out, packets where not dropped, but due to a buffer bug RTP packets got truncated and thus h.264 bitstream info got lost. Now video is playing back smoothly :DNicolas Emiliani
I am trying to do similar stuff. Stuck now. Can you provide this step by step. It will be really helpful.Austin

1 Answers

2
votes

Finally I cracked it. There where two issues.

The first one with the terminal resetting the rtp timestamp when I was recording, that made my counter variable overflow and messed up my time stamps when playing back.

The other one had to do with what Ralf pointed out, packets where not dropped, but due to a buffer bug RTP packets got truncated while recording and thus the h.264 bitstream info got lost.

Now video is playing back smoothly :D –