<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>We use a similar set up for our software (LIVE555 -> FFMPEG decode) and it is working well. The first obvious difference I can see is that normally the SPS and PPS precede the IDR frame (type 5) rather than the non-IDR frame (type 1), so we have 7, 8, 5, 1, 1, 1 …, 7, 8, 5, 1, 1, 1, …. For a quick test, I generated a NAL sequence similar to what you are generating and FFMPEG gave me many similar errors.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>So I would ask, how are you generating the NAL sequence on the encoder side? Is there a reason for generating 7, 8, 1, 1, 1 … 5?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Chris Richardson<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>WTI<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> live-devel-bounces@ns.live555.com [mailto:live-devel-bounces@ns.live555.com] <b>On Behalf Of </b>Jesse Hemingway<br><b>Sent:</b> Friday, February 08, 2013 3:06 PM<br><b>To:</b> LIVE555 Streaming Media - development & use<br><b>Subject:</b> [Live-devel] H.264 via RTP - ugly artifacts<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hello,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I apologize if this is noise - my question may well have nothing to do with Live555, but I thought I'd post here in case anyone can help me rule it out. It appears I'm successfully consuming H.264 via RTSP and acquiring frames in my mediasink.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Next, I set up ffmpeg's decoder with the SPS and PPS, and then proceed to pass all the raw NAL units from Live555 to avcodec_decode_video2(...), adding the bytestream start code prefix and trailing zero byte (I add 0x00000001 before the raw NAL, and 0x00 after). I've enabled debug output in ffmpeg, and it appears to be happily decoding without errors, other than the frequent, and perhaps expected log of the form: <b>concealing 900 DC, 900 AC, 900 MV errors in P frame</b>. However, when I turn this into a displayable RGBA buffer using swscale() and display the result -- there are lots of ugly artifacts.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>At certain resolutions, the I frames result in a pretty clear picture. In-between, only part of the image is even reasonably decoded, and with half to 3/4 of the image being an interpolated blur. Even the healthier parts exhibit a regular grid of dots and major glitches in regions where the source video has motion.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I wanted to rule out Live555 as a potential source of such trouble - does this sound familiar to anyone? Advice where to focus? A relevant log follows...<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks!<o:p></o:p></p><div><p class=MsoNormal>Jesse<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>LOG:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>Received 24 bytes NAL type [ 7 ]<o:p></o:p></p></div><div><p class=MsoNormal>Priming buffer started<o:p></o:p></p></div><div><p class=MsoNormal>Received 4 bytes NAL type [ 8 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 14 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 3112 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 3444 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 16 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 14 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 2143 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 1498 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 16 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 14 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 2395 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 3512 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 16 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 14 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 3808 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 2966 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 16 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 14 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 1909 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 1774 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 16 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 14 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 3915 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 3859 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 16 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 14 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 3219 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 3355 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 16 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>Received 2304 bytes NAL type [ 5 ]<o:p></o:p></p></div><div><p class=MsoNormal>Priming buffer complete<o:p></o:p></p></div><div><p class=MsoNormal>[h264 @ 0x90a2400] concealing 900 DC, 900 AC, 900 MV errors in I frame<o:p></o:p></p></div><div><p class=MsoNormal>Picture decoded<o:p></o:p></p></div><div><p class=MsoNormal>Initializing decoder frame of size: 640x480<o:p></o:p></p></div><div><p class=MsoNormal>[swscaler @ 0x8898600] No accelerated colorspace conversion found from yuv420p to rgba.<o:p></o:p></p></div><div><p class=MsoNormal>Received 6900 bytes NAL type [ 5 ]<o:p></o:p></p></div><div><p class=MsoNormal>[h264 @ 0x90a2400] concealing 900 DC, 900 AC, 900 MV errors in I frame<o:p></o:p></p></div><div><p class=MsoNormal>Picture decoded<o:p></o:p></p></div><div><p class=MsoNormal>Received 6945 bytes NAL type [ 5 ]<o:p></o:p></p></div><div><p class=MsoNormal>[h264 @ 0x90a2400] concealing 900 DC, 900 AC, 900 MV errors in I frame<o:p></o:p></p></div><div><p class=MsoNormal>Picture decoded<o:p></o:p></p></div><div><p class=MsoNormal>Received 73 bytes NAL type [ 5 ]<o:p></o:p></p></div><div><p class=MsoNormal>[h264 @ 0x90a2400] concealing 900 DC, 900 AC, 900 MV errors in I frame<o:p></o:p></p></div><div><p class=MsoNormal>Picture decoded<o:p></o:p></p></div><div><p class=MsoNormal>Received 40 bytes NAL type [ 1 ]<o:p></o:p></p></div><div><p class=MsoNormal>[h264 @ 0x90a2400] concealing 900 DC, 900 AC, 900 MV errors in P frame<o:p></o:p></p></div><div><p class=MsoNormal>Picture decoded<o:p></o:p></p></div></div><div><p class=MsoNormal>...<o:p></o:p></p></div></div></body></html>