<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="">Hi guys,<div class=""><br class=""></div><div class="">Users of our software reported that certain H.264 files show green lines in the middle of the image.</div><div class="">Here’s the output of av_dump_format:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">Metadata:</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    major_brand     : qt  </b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    minor_version   : 537199360</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    compatible_brands: qt  </b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    creation_time   : 2017-05-23T06:14:36.000000Z</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    timecode        : 00:59:52:00</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">  Duration: 00:43:19.64, start: 0.000000, bitrate: 1838 kb/s</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 250 kb/s (default)</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    Metadata:</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">      creation_time   : 2017-05-23T06:14:37.000000Z</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">      handler_name    : Apple Alias Data Handler</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 720x405, 1578 kb/s, 23.98 fps, 23.98 tbr, 23976 tbn, 47.95 tbc (default)</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    Metadata:</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">      creation_time   : 2017-05-23T06:14:37.000000Z</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">      handler_name    : Apple Alias Data Handler</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">      encoder         : H.264</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">    Metadata:</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">      creation_time   : 2017-05-23T06:48:54.000000Z</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">      handler_name    : Apple Alias Data Handler</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">      timecode        : 00:59:52:00</b></span></div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class=""><br class=""></b></span></div><div class="">I uploaded a screenshot of how the bug looks here:</div><div class=""><br class=""></div><div class=""><a href="https://www.dropbox.com/s/49ri0traypnyhzd/Decoding_ShiftedPlanes.png?dl=0" class="">https://www.dropbox.com/s/49ri0traypnyhzd/Decoding_ShiftedPlanes.png?dl=0</a></div><div class=""><br class=""></div><div class="">The same files work fine in QuickTime and VLC (and also in an older version of our software using swscale instead of our own GPU pixel format converter).</div><div class=""><br class=""></div><div class="">By further evaluating the issue it turns out that the V plane contained in the AVFrame’s->data[2] field apparently doesn’t contain straight V values but something different.</div><div class="">We’re decoding the frames using <span style="color: rgb(62, 30, 129); font-family: Menlo; font-size: 11px;" class="">avcodec_decode_video2. </span>If the output is converted using swscale, everything looks good.</div><div class="">If we only use av_picture_layout, the issue looks like in the screenshot.</div><div class=""><br class=""></div><div class="">The only difference I can spot to other H.264 files looking correct is the “smpte170m/smpte170m/bt709” color space tags where others have only one (bt709).</div><div class="">Does anyone have an explanation for that or can give me some more insight on where to look at?</div><div class=""><br class=""></div><div class="">Any hints are greatly appreciated!</div><div class="">Thanks and best,</div><div class=""><br class=""></div><div class="">Flo</div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div></div><div class=""><br class=""></div></body></html>