<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Just wanted to follow up on this issue.  It seems that aligning to 32 bytes with av_image_fill_arrays will work-around/resolve the problem.  That said, I couldn’t find any documentation in either VideoToolbox or Core Graphics that would explain this.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 17, 2017, at 6:44 PM, Richard Kern <<a href="mailto:kernrj@gmail.com" class="">kernrj@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div id="bloop_sign_1487375007367335168" class="bloop_sign" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><p class="airmail_on" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On February 17, 2017 at 5:18:09 PM, Steve Green (<a href="mailto:steve.green@flosports.tv" class="">steve.green@flosports.tv</a>) wrote:</p><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class=""><div class="" style="word-wrap: break-word;"><div class=""></div><div class=""><div class="">I assume you want to see screenshots?  These are produced after the long journey to a Wowza server and back out the other side in jwplayer.  I could capture the raw YUV and a key frame of H264 if that would help.</div></div></div></span></blockquote></div><p style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">No need, I see the issue.</p><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class=""><div class="" style="word-wrap: break-word;"><div class=""><div class=""><br class="Apple-interchange-newline"><br class=""></div><div class="">Attached is the original picture, and the results of supplying 1-byte aligned and 16-byte aligned YUV to avcodec_encode_video2().</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 17, 2017, at 5:02 PM, Richard Kern <<a href="mailto:kernrj@gmail.com" class="">kernrj@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="bloop_customfont" class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; margin: 0px;">On February 17, 2017 at 4:53:03 PM, Steve Green (<a href="mailto:steve.green@flosports.tv" class="">steve.green@flosports.tv</a>) wrote:</div><div class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class=""><div class=""></div><div class=""><span class="">This is the basic pipeline that I have:<br class=""><br class="">BGRA frames -> sws_scale() -> YUV frames -> avcodec_encode_video2() -> av_interleaved_write_frame()<br class=""><br class="">.. and this works perfectly with x264 and most of the time with h264_videotoolbox. The issue with h264_videotoolbox happens when I try to stream at 854x480. From looking at the output, it appears that someone along the way is not happy with width not being a multiple of 16. There is a very clear shift/wrapping of pixels.<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span><br class=""><br class="">As an experiment, I changed my use of av_image_fill_arrays() to align on 16 bytes (with a sufficiently larger buffer) and the resulting image is improved but still not correct. The basic shift is gone and the image is legible but the colors are off and I can see an artifact over the image.</span></div></div></blockquote></div><p class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Can you post a frame grab of the unaligned and 16-byte aligned output?</p><div class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class=""><div class=""><span class=""><br class=""><br class="">Given that x264 works and h264_videotoolbox doesn't, I’m tempted to point fingers at either VTCompressionSession or CVPixelBuffers + YUV, which would explain why I want to try AV_PIX_FMT_VIDEOTOOLBOX. I’ve read pretty much everything I can find on this but I cant find a single mention of 16-byte-multiple widths or strides.</span></div></div></blockquote></div><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class=""><div class=""><span class=""><br class=""><br class="">Any idea how to go about debugging this?<br class="">_______________________________________________<br class="">Libav-user mailing list<br class=""><a href="mailto:Libav-user@ffmpeg.org" class="">Libav-user@ffmpeg.org</a><br class=""><a href="http://ffmpeg.org/mailman/listinfo/libav-user" class="">http://ffmpeg.org/mailman/listinfo/libav-user</a></span></div></div></blockquote></div></div></div></blockquote></div></div></div></span></blockquote></div></div></blockquote></div><br class=""></div></body></html>