<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">On February 17, 2017 at 4:53:03 PM, Steve Green (<a href="mailto:steve.green@flosports.tv">steve.green@flosports.tv</a>) wrote:</div> <div><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><div><div></div><div>This is the basic pipeline that I have:<br><br>BGRA frames -> sws_scale() -> YUV frames -> avcodec_encode_video2() -> av_interleaved_write_frame()<br><br>.. 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><br>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.</div></div></span></blockquote></div><p>Can you post a frame grab of the unaligned and 16-byte aligned output?</p><div><div><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><div><div><br><br>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.</div></div></span></blockquote></div><div><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><div><div><br><br>Any idea how to go about debugging this?<br>_______________________________________________<br>Libav-user mailing list<br><a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br><a href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a><br></div></div></span></blockquote></div></div></body></html>