<div dir="ltr"><span style="font-size:13px">I'm having a very hard time getting libva to honor my bitrate settings, and it appears that the test program at </span><div style="font-size:13px"><br></div><div style="font-size:13px"><a href="http://cgit.freedesktop.org/libva/tree/test/encode/h264encode.c" target="_blank">http://cgit.freedesktop.org/libva/tree/test/encode/h264encode.c</a> </div><div class="gmail_extra" style="font-size:13px"><br></div><div class="gmail_extra" style="font-size:13px">also isn't working. The only modification I made to h264encode.c was getting it to get it's VADisplay from the drm device (vaGetDisplayDRM(fd)).</div><div class="gmail_extra" style="font-size:13px"><br></div><div class="gmail_extra" style="font-size:13px">I am using the built in image as the YUV source in my testing. Here is how I am running it:</div><div class="gmail_extra" style="font-size:13px"><br></div><div class="gmail_extra" style="font-size:13px">sudo ./h264encode -n 300 --bitrate 500000 -rcmode VBR</div><div class="gmail_extra" style="font-size:13px"><br></div><div class="gmail_extra" style="font-size:13px">For all of the rate control modes (except for CBR) I see an error like the following:</div><div class="gmail_extra" style="font-size:13px"><br></div><div class="gmail_extra" style="font-size:13px"><div class="gmail_extra"><font face="monospace, monospace">Support rate control mode (0x12):CBR CQP </font></div><div class="gmail_extra"><font face="monospace, monospace">Warning: Don't support the specified RateControl mode: VBR!!!, switch to RateControl mode: CQP</font></div><div class="gmail_extra"><br></div><div class="gmail_extra">And the file is always the same size (regardless of the bitrate I pass in).</div><div class="gmail_extra"><br></div><div class="gmail_extra">If I use CBR the output is slightly different:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><font face="monospace, monospace">Support rate control mode (0x12):CBR CQP</font><br></div></div><div class="gmail_extra" style="font-size:13px"><br></div><div class="gmail_extra" style="font-size:13px">Similar to the above, except it doesn't have the Warning. The other problem is that the file created has 0 length.</div><div class="gmail_extra" style="font-size:13px"><br></div><div class="gmail_extra" style="font-size:13px">If I use CQP as the rate control mode I get no warnings, but the file is always the same size regardless of the bitrate I pass in.</div><div class="gmail_extra" style="font-size:13px"><br></div><div class="gmail_extra" style="font-size:13px">Here is the output from vainfo on my machine:</div><div class="gmail_extra" style="font-size:13px"><br></div><div class="gmail_extra" style="font-size:13px"><div class="gmail_extra"><font face="monospace, monospace">[td@localhost enc]$ vainfo</font></div><div class="gmail_extra"><font face="monospace, monospace">libva info: VA-API version 0.36.0</font></div><div class="gmail_extra"><font face="monospace, monospace">libva info: va_getDriverName() returns 0</font></div><div class="gmail_extra"><font face="monospace, monospace">libva info: Trying to open /usr/lib64/dri/i965_drv_video.so</font></div><div class="gmail_extra"><font face="monospace, monospace">libva info: Found init function __vaDriverInit_0_36</font></div><div class="gmail_extra"><font face="monospace, monospace">libva info: va_openDriver() returns 0</font></div><div class="gmail_extra"><font face="monospace, monospace">vainfo: VA-API version: 0.36 (libva 1.4.0)</font></div><div class="gmail_extra"><font face="monospace, monospace">vainfo: Driver version: Intel i965 driver for Intel(R) Sandybridge Mobile - 1.4.0</font></div><div class="gmail_extra"><font face="monospace, monospace">vainfo: Supported profile and entrypoints</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileMPEG2Simple            :<span style="white-space:pre-wrap">       </span>VAEntrypointVLD</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileMPEG2Main              :<span style="white-space:pre-wrap">    </span>VAEntrypointVLD</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileH264ConstrainedBaseline:<span style="white-space:pre-wrap">   </span>VAEntrypointVLD</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileH264ConstrainedBaseline:<span style="white-space:pre-wrap">   </span>VAEntrypointEncSlice</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileH264Main               :<span style="white-space:pre-wrap">       </span>VAEntrypointVLD</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileH264Main               :<span style="white-space:pre-wrap">    </span>VAEntrypointEncSlice</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileH264High               :<span style="white-space:pre-wrap">       </span>VAEntrypointVLD</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileH264High               :<span style="white-space:pre-wrap">    </span>VAEntrypointEncSlice</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileH264StereoHigh         :<span style="white-space:pre-wrap">  </span>VAEntrypointVLD</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileVC1Simple              :<span style="white-space:pre-wrap">    </span>VAEntrypointVLD</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileVC1Main                :<span style="white-space:pre-wrap">   </span>VAEntrypointVLD</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileVC1Advanced            :<span style="white-space:pre-wrap">     </span>VAEntrypointVLD</font></div><div class="gmail_extra"><font face="monospace, monospace">      VAProfileNone                   :<span style="white-space:pre-wrap">  </span>VAEntrypointVideoProc</font></div></div><div class="gmail_extra" style="font-size:13px"><br></div><div class="gmail_extra" style="font-size:13px">Does libva actually support the bitrate setting?</div></div>