<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">From your attachment implementation.c, found<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:21.0pt;text-indent:21.0pt"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">vaapiencoder = gst_element_factory_make ("x264enc", NULL);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Maybe typo. Suppose you want “vaapiencode_h264”. Anyway, I just tried<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">$ gst-launch-1.0 videotestsrc ! video/x-raw,format=NV12,width=320,height=240,framerate=30/1 ! vaapipostproc ! queue
! vaapiencode_h264 ! fakesink <o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Failed in latest master branch. This issue caused by gstvaapiencoder need strict format check but vaapipostproc with
format ‘Encoded’(VASurface). After adding a specific ‘format’ for vaapipostproc, encoder works. You can take a try .<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">$ gst-launch-1.0 videotestsrc ! video/x-raw,format=NV12,width=320,height=240,framerate=30/1 ! vaapipostproc format=nv12
! queue ! vaapiencode_h264 ! fakesink<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></a></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Wind<o:p></o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Libva [mailto:libva-bounces@lists.freedesktop.org]
<b>On Behalf Of </b>Engin Firat<br>
<b>Sent:</b> Friday, December 12, 2014 11:48 PM<br>
<b>To:</b> libva@lists.freedesktop.org<br>
<b>Subject:</b> [Libva] Problem with vaapipostproc element<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I have a problem related to element called vaapipostproc. The problem is as follows:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I have a pipeline and for specified time intervals I attempt to change pipeline dynamically in order to change write location of the filesink. I have implemented this functionality and everything works well in case I
do not use vaapipostproc element. If I use vaapipostproc element, the pipeline crashes unexpectedly. An error message is thrown from the element vaapipostproc: "failed to create output video buffer" at the immediate point the pipeline is changed dynamically. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">My pipeline change strategy is as follows:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">0. Create a bin and place mux and filesink elements inside it. Moreover create a queue element before this bin.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">1. For specified intervals, fire a clock event and catch it in a handler<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">2. In clock handler place a blocking probe to queue's source pad and register a blocking data handler<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">3. In blocking data handler unlink queue and bin and send an EOS event to bin's sink pad. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">4. Handle EOS event on bin element. In this handler, destroy bin, create a new bin with an updated filesink location connect bin with queue. And remove the blocking probe. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">This strategy for dynamic pipeline changing works well when I do not use vaapipostproc element. But I want to do encoding process on GPU and using vaapipostproc is a mandatory. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I have inspected the source code gstvaapipostproc.c for element vaapipostproc and It seem the problem is related to function named as
<b><i>GstBuffer * create_output_buffer(GstVaapiPostproc*)</i></b>. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">You can find output messages when GST_DEBUG environment variable is set to 4. In addition to this, you can also find my implementation to change the pipeline dynamically. The implementation won't compile, I just want
to share a pseudo-code for your well understanding of the implementation. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I want to share the most interesting part of the out.log file:<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">0:00:11.075920072 [334m11325 [00m 0x1dcc720 [36mINFO [00m
<b><i>[00m vaapipostproc gstvaapipluginbase.c:532:gst_vaapi_plugin_base_decide_allocation:<GPUPostProcessing> [00m no pool or doesn't support GstVaapiVideoMeta, making new pool</i></b><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">0:00:11.076231088 [334m11325 [00m 0x1dcc720 [36mINFO [00m [00m vaapivideomemory gstvaapivideomemory.c:627:gst_vaapi_video_allocator_new: [00m has direct-rendering for NV12 surfaces: no<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><i><span lang="EN-US">0:00:11.076568949 [334m11325 [00m 0x1dcc720 [31;01mERROR [00m [00m vaapipostproc gstvaapipostproc.c:412:create_output_buffer: [00m failed to create output video buffer</span></i></b><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">0:00:11.076723161 [334m11325 [00m 0x1dcc720 [33;01mWARN [00m [00m basetransform gstbasetransform.c:2130:gst_base_transform_handle_buffer:<GPUPostProcessing> [00m could not get buffer from pool: error<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">0:00:11.076773273 [334m11325 [00m 0x1dcc720 [36mINFO [00m
<b><i>[00m task gsttask.c:300:gst_task_func:<queue0:src> [00m Task going to paused</i></b><o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">How can I solve this problem? Any help will be appreciated. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Regards.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><br>
Engin FIRAT<o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>