<div dir="ltr"><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b>System from vainfo</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b><br></b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b>libva info: VA-API version 0.34.0</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b>libva info: va_getDriverName() returns 0</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b>libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b>libva info: Found init function __vaDriverInit_0_34</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b>libva info: va_openDriver() returns 0</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b>vainfo: VA-API version: 0.34 (libva 1.2.2.pre1)</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b>vainfo: Driver version: Intel i965 driver - 1.2.1</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b>vainfo: Supported profile and entrypoints</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b> VAProfileNone : VAEntrypointVideoProc</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b> VAProfileMPEG2Simple : VAEntrypointVLD</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b> VAProfileMPEG2Simple : VAEntrypointEncSlice</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b> VAProfileMPEG2Main : VAEntrypointVLD</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b> VAProfileMPEG2Main : VAEntrypointEncSlice</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b> VAProfileH264Baseline : VAEntrypointVLD</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b> VAProfileH264Baseline : VAEntrypointEncSlice</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b> VAProfileH264Main : VAEntrypointVLD</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b> VAProfileH264Main : VAEntrypointEncSlice</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b> VAProfileH264High : VAEntrypointVLD</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b> VAProfileH264High : VAEntrypointEncSlice</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b> VAProfileVC1Simple : VAEntrypointVLD</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b> VAProfileVC1Main : VAEntrypointVLD</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b> VAProfileVC1Advanced : VAEntrypointVLD</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b></b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b> VAProfileJPEGBaseline : VAEntrypointVLD</b></p><div style="font-family:arial,sans-serif;font-size:13px"><br></div><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<b><br></b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b>How to produce a video corruption with h264encode<br></b><br><b><i>Background</i></b><br>When encoding two files, there are four significant events:<br>
A. Begin encoding first file<br> B. Finish encoding first file<br> C. Begin encoding second file<br> D. Finish encoding second file<br><br>There are three possible orderings for these four events:</p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<br>ABCD (no overlap - first file is finished before second begins) **No corruption observed<br> A----------B C----------D</p><p class="MsoNormal" style="margin-bottom:12pt;font-family:arial,sans-serif;font-size:13px">
<br>ACDB (complete overlap - the second file begins after and finishes before the first) **No corruption observed<br> A----------------B<br> C----D</p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
ACBD (partial overlap - the second file begins before the first file finishes)<br> A----------B<br> C----------D</p><p class="MsoNormal" style="margin-bottom:12pt;font-family:arial,sans-serif;font-size:13px"><br>
The last case ACBD (partial overlap) always results in video corruption. The video output of second file is correct up to event B. Beyond that point, the video is corrupt.<br><br><b>Procedure To Reproduce<br></b>You will need to start with a yuv formatted input file. If you don’t have one, you can create one with ffmpeg from any source video.</p>
<p class="MsoNormal" style="margin-bottom:12pt;font-family:arial,sans-serif;font-size:13px">1. Determine how long it takes to encode the file<br> # time /root/libva-1.2.1/test/encode/h264encode --srcyuv in.yuv -framecount 0 -f 25 -o out1.mp4 > /dev/null 2> /dev/null<br>
<br> real 0m14.984s<br> user 0m6.690s<br> sys 0m10.115s<br><br>So, in this example, my file takes 15 seconds to encode so I will start the second video encoding about 7 seconds after the first to make<br>sure they overlap in the ACBD order described above.<br>
<br>2. Open two separate terminals. Run these commands, one in each terminal, with the 2<sup>nd</sup> command executed about 7 seconds after the first (this delay is to ensure the right overlap)</p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
# date ; time /root/libva-1.2.1/test/encode/h264encode --srcyuv in.yuv -framecount 0 -f 25 -o out1.mp4 >/dev/null 2>/dev/null ; date<br> # date ; time /root/libva-1.2.1/test/encode/h264encode --srcyuv in.yuv -framecount 0 -f 25 -o out2.mp4 >/dev/null 2>/dev/null ; date<br>
<br>Here is sample output (Note: h264encode output is suppressed):<br><br><b>Terminal 1:<br></b> # date ; time /root/libva-1.2.1/test/encode/h264encode --srcyuv in.yuv -framecount 0 -f 25 -o out1.mp4 >/dev/null 2>/dev/null ; date<br>
Wed Feb 12 16:44:08 CST 2014<br><br> real 0m15.084s<br> user 0m5.698s<br> sys 0m9.601s<br> Wed Feb 12 16:44:23 CST 2014<br><br><b>Terminal 2:<br></b> # date ; time /root/libva-1.2.1/test/encode/h264encode --srcyuv in.yuv -framecount 0 -f 25 -o out2.mp4 >/dev/null 2> /dev/null ; date<br>
Wed Feb 12 16:44:15 CST 2014<br><br> real 0m9.097s<br> user 0m3.431s<br> sys 0m5.660s<br> Wed Feb 12 16:44:24 CST 2014<br><br>Note that the second encoding finishes only one second after the first despite being started 7 seconds later. Testing with different offsets confirms the second encoding always finishes immediately after the first, regardless of start time.</p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"> </p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><b>Verify Corruption Exists</b></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
</p><p style="font-family:arial,sans-serif;font-size:13px">1.<span style="font-size:7pt;font-family:'Times New Roman'"> </span>Use the file compare utility cmp to compare files:</p><p style="font-family:arial,sans-serif;font-size:13px">
#cmp – b out1.mp4 out2.mp4</p><p style="font-family:arial,sans-serif;font-size:13px">2.<span style="font-size:7pt;font-family:'Times New Roman'"> </span>If the files are identical, there will be no output. What I see is the files begin showing differences at a position relatively proportional to my start offset. For example, starting 7.5 seconds after the first video, using 15 second videos, the corruption appears in the middle of the file.</p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">If you were to play the file, you would observe the file plays correctly to the point of corruption. At that point, the video freezes or flickers between 2 frames.</p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"> </p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">Note: We're observing these corruptions in our own code, which is unrelated to h264encode. We used h264encode to eliminate all variables and exonerate our code.</p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><br></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><br></p>
</div>