<div>Thanks, I will try your way.</div><div> </div><div>27.03.2014, 21:32, "Yuan, Shengquan" <shengquan.yuan@intel.com>:</div><blockquote type="cite"><div><font color="#1F497D">“Frame Rate: 0.06 fps (1 frames, 16500 ms (16500.00 ms per frame))” in your test is calculated by “(total time of app execution)/(total frame)”. “(total time of app execution)” includes app setup, source YUV uploading, frame encoding, coded bitstream saving, app stop, etc. If you only encode 1 frame, the majority time will be “source YUV uploading”.</font></div><div><font color="#1F497D" face="Times New Roman" size="3"><span style="font-size:12pt;"> </span></font></div><div><font color="#1F497D">There is detailed break-down of the time in the output, but since the application runs with two threads (one is source YUV uploading, another thread is frame encoding), you are not able to get the absolute time of a frame encoding.</font></div><div><font color="#1F497D"> </font></div><div><font color="#1F497D">Tips:</font></div><ul><li>If you want to know the accurate time of one frame encoding, use option “-syncmode”, and check the time of “vaBegin/vaRender/vaEnd/vaSyncSurface”</li><li>If you want to get the end-to-end encoding fps number, try to encoding thousand of frames with auto-generated YUV source (without –srcyuv), e.g. “h264encode –n 7000”</li></ul><div><font color="#1F497D" face="Times New Roman" size="3"><span style="font-size:12pt;"> </span></font></div><div align="left" style="text-align:justify;"><font color="#1F497D">Thanks</font></div><div align="left" style="text-align:justify;"><font color="#1F497D">-Austin</font></div><div><font color="#1F497D" face="Times New Roman" size="3"><span style="font-size:12pt;"> </span></font></div><div><font face="Tahoma" size="2"><span style="font-size:10pt;"><b>From:</b> Libva [<a href="mailto:libva-bounces@lists.freedesktop.org">mailto:libva-bounces@lists.freedesktop.org</a>] <b>On Behalf Of </b>Matt Pekar<br /> <b>Sent:</b> Thursday, March 27, 2014 9:11 AM<br /> <b>To:</b> Nik Orlov<br /> <b>Cc:</b> <a href="mailto:libva@lists.freedesktop.org">libva@lists.freedesktop.org</a><br /> <b>Subject:</b> Re: [Libva] linux vaapi h.264 encoding haswell hd graphics 4600</span></font></div><div><font face="Times New Roman" size="3"><span style="font-size:12pt;"> </span></font></div><div><font face="Times New Roman" size="3"><span style="font-size:12pt;">For that size of frame, 20ms is a pretty darn good time IMO.  We see 10ms (ish) on things in the 1280x720 range.</span></font></div><div><font face="Times New Roman" size="3"><span style="font-size:12pt;"> </span></font></div><div><font face="Times New Roman" size="3"><span style="font-size:12pt;">Since your input stream is only 25fps, the encoder will be able to provide near real-time output, with just a 20ms delay before writing each frame.</span></font></div><div><font face="Times New Roman" size="3"><span style="font-size:12pt;"> </span></font></div><div><font face="Times New Roman" size="3"><span style="font-size:12pt;">If you were trying to do 60fps then you wouldn't be able to do "real time" at all since you'd be falling behind 5ms every frame.</span></font></div><div style="margin-bottom:12pt;"><font face="Times New Roman" size="3"><span style="font-size:12pt;"> </span></font></div><div><font face="Times New Roman" size="3"><span style="font-size:12pt;">On Thu, Mar 27, 2014 at 5:57 AM, Nik Orlov <<a href="mailto:nikitos1550@yandex.ru"><font color="blue"><u>nikitos1550@yandex.ru</u></font></a>> wrote:</span></font></div><div><font face="Times New Roman" size="3"><span style="font-size:12pt;">Hello!<br /> <br /> I have ubuntu-desktop 13.10 amd64 on core i7 4770 (Haswell, HD graphics 4600).<br /> I have installed vaapi (libva from sources 1.3.0).<br /> <br /> There is h264encode test. I have started it:<br /> <br /> <a href="mailto:user@video-ubuntu:~/VAAPI/libva-1.3.0/test/encode$"><font color="blue"><u>user@video-ubuntu:~/VAAPI/libva-1.3.0/test/encode$</u></font></a> ./h264encode -w 3840 -h 1080 -framecount 1 -f 25<br /> Source frame is 3840x1080 and will code clip to 3840x1088 with crop<br /> <br /> <br /> INPUT:Try to encode H264...<br /> INPUT: RateControl  : VBR<br /> INPUT: Resolution   : 3840x1080, 1 frames<br /> INPUT: FrameRate    : 25<br /> INPUT: Bitrate      : <span>24883200</span><br /> INPUT: Slieces      : 1<br /> INPUT: IntraPeriod  : 30<br /> INPUT: IDRPeriod    : 60<br /> INPUT: IpPeriod     : 1<br /> INPUT: Initial QP   : 26<br /> INPUT: Min QP       : 0<br /> INPUT: Source YUV   : AUTO generated<br /> INPUT: Coded Clip   : /tmp/test.264<br /> INPUT: Rec   Clip   : Not save reconstructed frame<br /> <br /> <br /> libva info: VA-API version 0.35.0<br /> libva info: va_getDriverName() returns 0<br /> libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so<br /> libva info: Found init function __vaDriverInit_0_35<br /> libva info: va_openDriver() returns 0<br /> Use profile VAProfileH264High<br /> Support rate control mode (0x12):CBR CQP<br /> Support VAConfigAttribEncPackedHeaders<br /> Support packed sequence headers<br /> Support packed picture headers<br /> Support packed misc headers<br /> Support 1 RefPicList0 and 1 RefPicList1<br /> Loading data into surface 15.....Complete surface loading<br />       |<span>00000000</span>(485835 bytes coded)<br /> <br /> PERFORMANCE:   Frame Rate           : 0.06 fps (1 frames, 16500 ms (16500.00 ms per frame))<br /> PERFORMANCE:   Compression ratio    : 12:1<br /> PERFORMANCE:     UploadPicture      : 16444 ms (16444.00, 99.66% percent)<br /> PERFORMANCE:     vaBeginPicture     : 0 ms (0.00, 0.00% percent)<br /> PERFORMANCE:     vaRenderHeader     : 0 ms (0.00, 0.00% percent)<br /> PERFORMANCE:     vaEndPicture       : 3 ms (3.00, 0.02% percent)<br /> PERFORMANCE:     vaSyncSurface      : 32 ms (32.00, 0.19% percent)<br /> PERFORMANCE:     SavePicture        : 0 ms (0.00, 0.00% percent)<br /> PERFORMANCE:     Others             : 21 ms (21.00, 0.13% percent)<br /> (Multithread enabled, the timing is only for reference)<br /> <br /> <br /> And other way<br /> <br /> <a href="mailto:user@video-ubuntu:~/VAAPI/libva-1.3.0/test/encode$"><font color="blue"><u>user@video-ubuntu:~/VAAPI/libva-1.3.0/test/encode$</u></font></a> ./h264encode -w 3840 -h 1080 -framecount 2500 -f 25<br /> Source frame is 3840x1080 and will code clip to 3840x1088 with crop<br /> <br /> <br /> INPUT:Try to encode H264...<br /> INPUT: RateControl  : VBR<br /> INPUT: Resolution   : 3840x1080, 2500 frames<br /> INPUT: FrameRate    : 25<br /> INPUT: Bitrate      : <span>24883200</span><br /> INPUT: Slieces      : 1<br /> INPUT: IntraPeriod  : 30<br /> INPUT: IDRPeriod    : 60<br /> INPUT: IpPeriod     : 1<br /> INPUT: Initial QP   : 26<br /> INPUT: Min QP       : 0<br /> INPUT: Source YUV   : AUTO generated<br /> INPUT: Coded Clip   : /tmp/test.264<br /> INPUT: Rec   Clip   : Not save reconstructed frame<br /> <br /> <br /> libva info: VA-API version 0.35.0<br /> libva info: va_getDriverName() returns 0<br /> libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so<br /> libva info: Found init function __vaDriverInit_0_35<br /> libva info: va_openDriver() returns 0<br /> Use profile VAProfileH264High<br /> Support rate control mode (0x12):CBR CQP<br /> Support VAConfigAttribEncPackedHeaders<br /> Support packed sequence headers<br /> Support packed picture headers<br /> Support packed misc headers<br /> Support 1 RefPicList0 and 1 RefPicList1<br /> Loading data into surface 15.....Complete surface loading<br />       \<span>00002499</span>(719089 bytes coded)<br /> <br /> PERFORMANCE:   Frame Rate           : 53.70 fps (2500 frames, 46555 ms (18.62 ms per frame))<br /> PERFORMANCE:   Compression ratio    : 11:1<br /> PERFORMANCE:     UploadPicture      : 16364 ms (6.55, 35.15% percent)<br /> PERFORMANCE:     vaBeginPicture     : 2 ms (0.00, 0.00% percent)<br /> PERFORMANCE:     vaRenderHeader     : 18 ms (0.01, 0.04% percent)<br /> PERFORMANCE:     vaEndPicture       : 1098 ms (0.44, 2.36% percent)<br /> PERFORMANCE:     vaSyncSurface      : 21385 ms (8.55, 45.93% percent)<br /> PERFORMANCE:     SavePicture        : 8759 ms (3.50, 18.81% percent)<br /> PERFORMANCE:     Others             : -1071 ms (1717986.49, <span>9225574</span>.54% percent)<br /> (Multithread enabled, the timing is only for reference)<br /> <br /> <br /> So, when test encodes more frames time for encoding 1 frame is about 20ms.<br /> Why it is so?<br /> <br /> My primary question, if I want to encode video in real time (It means camera sends me frame each 40ms), what time for encoding 1 frame I will get?<br /> As I understand programm sends some data to GPU, GPU encodes video and then send me encoded data back.<br /> How much time takes sending data to GPU and back?<br /> <br /> Maybe it will possible to encode each frame in real time, or maybe it isn`t possible, but It is possible to keep some buffer (for example for 25 frames - 1 sec of video) and than encode ot very fast.<br /> <br /> <font color="#888888">--<br /> </font><font color="#888888" face="Times New Roman Cyr">Ник Орлов mailto:</font><a href="mailto:nikitos1550@yandex.ru"><font color="blue"><u>nikitos1550@yandex.ru</u></font></a><br /> <font color="#888888">_______________________________________________<br /> </font><font color="#888888">Libva mailing list<br /> </font><a href="mailto:Libva@lists.freedesktop.org"><font color="blue"><u>Libva@lists.freedesktop.org</u></font></a><br /> <a href="http://lists.freedesktop.org/mailman/listinfo/libva"><font color="blue"><u>http://lists.freedesktop.org/mailman/listinfo/libva</u></font></a></span></font></div><div><font face="Times New Roman" size="3"><span style="font-size:12pt;"> </span></font></div><div><font face="Times New Roman" size="3"><span style="font-size:12pt;"> </span></font></div></blockquote><div> </div><div> </div><div>-- <br />Ник Орлов<br />mailto:nikitos1550@yandex.ru</div><div> </div>