[Live-devel] Jerks when playing h264 stream

Andrey Shvyrkin ashvyrkin at gosniias.ru
Mon Aug 5 00:36:37 PDT 2013


Hi, Ross. When developing a client application to display the rtsp 
stream, I ran into a problem when decoding h264 stream. As I am using 
ffmpeg decoder. I get a SDP description, parses on the SPS and PPS nal 
units, adding start codes and direct input to the decoder. Each received 
nal unit I also add a start code. Stream is decoded without any 
problems, and I get the appropriate shots, but on some h264 streams 
arise judder. When decoding jpeg and mpeg4 streams such jerks not. 
First, I have sinned in the decoder, but it turned out that this decoder 
packages sometimes come with a noticeable delay. The delay occurs when 
receiving IDR frames (nal unit type 5). Although no presentation time 
delay. Since SPS and PPS nal units are not useful frames, the difference 
in time between the IDR frame and the frame normally reaches almost 
two-fold increase on the match against the usual interval. This presents 
a judder. It is worth noting that the VLC player plays the stream 
without jerks.

Here is my log output in the first column of the type of unit, the 
second real time between two packets in milliseconds, in the third - the 
difference between the presentation times in microseconds:

[URL:"rtsp://192.168.33.77/yard(road).264/"]: Got a SDP description:
v=0
o=- 1375685540786756 1 IN IP4 192.168.33.77
s=H.264 Video, streamed by the LIVE555 Media Server
i=yard(road).264
t=0 0
a=tool:LIVE555 Streaming Media v2013.03.31
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:H.264 Video, streamed by the LIVE555 Media Server
a=x-qt-text-inf:yard(road).264
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96 
packetization-mode=1;profile-level-id=42C01E;sprop-parameter-sets=Z0LA
HqtAWAk2AiAAAAMAIAAABlHixdQ=,aM4yyA==
a=control:track1

[URL:"rtsp://192.168.33.77/yard(road).264/"]: Initiated the "video/H264" 
subsess
ion (client ports 52996-52997)
[URL:"rtsp://192.168.33.77/yard(road).264/"]: Set up the "video/H264" 
subsession
  (client ports 52996-52997)
[URL:"rtsp://192.168.33.77/yard(road).264/"]: Created a data sink for 
the "video
/H264" subsession
[URL:"rtsp://192.168.33.77/yard(road).264/"]: Started playing session...

nal type 6         real time 0         presentation time 0
nal type 7         real time 1         presentation time 0
nal type 8         real time 0         presentation time 0
nal type 5         real time 42         presentation time 0
nal type 1         real time 1         presentation time 40000
nal type 1         real time 37         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 79         presentation time 40000
nal type 1         real time 2         presentation time 40000
nal type 7         real time 38         presentation time 40000
nal type 8         real time 1         presentation time 0
nal type 5         real time 44         presentation time 0
nal type 1         real time 1         presentation time 40000
nal type 1         real time 34         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 80         presentation time 40000
nal type 1         real time 1         presentation time 40000
nal type 7         real time 40         presentation time 40000
nal type 8         real time 1         presentation time 0
nal type 5         real time 45         presentation time 0
nal type 1         real time 1         presentation time 40000
nal type 1         real time 33         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 7         real time 40         presentation time 39988
nal type 8         real time 1         presentation time 0
nal type 5         real time 44         presentation time 0
nal type 1         real time 1         presentation time 40000
nal type 1         real time 33         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 7         real time 40         presentation time 40000
nal type 8         real time 2         presentation time 0
nal type 5         real time 44         presentation time 0
nal type 1         real time 0         presentation time 40000
nal type 1         real time 34         presentation time 40000
nal type 1         real time 41         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 39         presentation time 40000
nal type 7         real time 40         presentation time 40000
nal type 8         real time 2         presentation time 0
nal type 5         real time 41         presentation time 0
nal type 1         real time 0         presentation time 40000
nal type 1         real time 37         presentation time 40000
nal type 1         real time 41         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 37334
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 39         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 7         real time 40         presentation time 40000
nal type 8         real time 1         presentation time 0
nal type 5         real time 45         presentation time 0
nal type 1         real time 0         presentation time 40000
nal type 1         real time 34         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 41         presentation time 40000
nal type 7         real time 40         presentation time 40000
nal type 8         real time 1         presentation time 0
nal type 5         real time 45         presentation time 0
nal type 1         real time 1         presentation time 40000
nal type 1         real time 33         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 7         real time 40         presentation time 40000
nal type 8         real time 1         presentation time 0
nal type 5         real time 43         presentation time 0
nal type 1         real time 1         presentation time 40000
nal type 1         real time 34         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 39988
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 7         real time 40         presentation time 40000
nal type 8         real time 1         presentation time 0
nal type 5         real time 44         presentation time 0
nal type 1         real time 1         presentation time 40000
nal type 1         real time 35         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000
nal type 1         real time 40         presentation time 40000


More information about the live-devel mailing list