<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX Processors中的主题 Re: Open vpu encoder via vpu_wrapper problems</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Open-vpu-encoder-via-vpu-wrapper-problems/m-p/1519893#M194976</link>
    <description>&lt;P&gt;How did you deal with it，thank you！！&lt;/P&gt;</description>
    <pubDate>Fri, 09 Sep 2022 09:12:36 GMT</pubDate>
    <dc:creator>a6664120</dc:creator>
    <dc:date>2022-09-09T09:12:36Z</dc:date>
    <item>
      <title>Open vpu encoder via vpu_wrapper problems</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Open-vpu-encoder-via-vpu-wrapper-problems/m-p/1096294#M160568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 weeks ago I've started learning embedded systems devlopment. Last summer I did some research on H264 and RTSP/RTP/UDP protocols and now I'm hoping to write a C app for encoding raw YCbCr420 frames to H264 by utilizing the hardware VPU encoder. I feel I am on a right track : so far I have learned Yocto, successfully built an SDK for the imx 8m mini board (full image), successfully compiled a C app against vpu_wrapper.h (libfslvpuwrap) and managed to load/unload the VPU via C code.&lt;/P&gt;&lt;P&gt;Problem arises when the&amp;nbsp;VPU_EncOpenSimp function needs to be called (as per VPU API reference manual Encoding Calling Sequence) with&amp;nbsp;VpuEncOpenParamSimp parameters. As a return code from the function call I always get -&amp;nbsp;VPU_ENC_RET_INVALID_PARAM. I would really appreciate your help. What am I doing wrong? Also, the meaning of a some of the parameters from the&amp;nbsp;&lt;SPAN&gt;VpuEncOpenParamSimp&amp;nbsp;struct&lt;/SPAN&gt;&amp;nbsp;is not documented at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;Matija&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
VpuEncHandle handle&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Open vpu&lt;/SPAN&gt;
enc_open_param_simp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;VpuEncOpenParamSimp&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;malloc&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;sizeof&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;VpuEncOpenParamSimp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;eFormat &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; VPU_V_AVC&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nPicWidth &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1280&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nPicHeight &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;720&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nOrigWidth &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1280&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nOrigHeight &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;720&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nRotAngle &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nFrameRate &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;60&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nBitRate &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2475&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nGOPSize &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nIntraRefresh &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nIntraQP &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nChromaInterleave &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;sMirror &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; VPU_ENC_MIRDIR_HOR&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nMapType &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nLinear2TiledEnable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;eColorFormat &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; VPU_COLOR_420&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
enc_open_param_simp&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;nIsAvcc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;printf&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Opening VPU encoder simp... "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
ret_code &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;VPU_EncOpenSimp&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;handle&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mem_info&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; enc_open_param_simp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;printf&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%d\n"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;ret_code&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 11:39:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Open-vpu-encoder-via-vpu-wrapper-problems/m-p/1096294#M160568</guid>
      <dc:creator>matija_bacic</dc:creator>
      <dc:date>2020-07-28T11:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Open vpu encoder via vpu_wrapper problems</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Open-vpu-encoder-via-vpu-wrapper-problems/m-p/1096295#M160569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Found a solution to the problem! Turns out api call sequence&amp;nbsp;VPU_EncQueryMem =&amp;gt;&amp;nbsp;VPU_EncGetMem does not automatically inform the VPU about the allocated memory. Rather, physical and virtual address members of&amp;nbsp;VpuMemInfo struct need to be configured manualy (that is, copied from&amp;nbsp;VpuMemDesc).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2020 10:30:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Open-vpu-encoder-via-vpu-wrapper-problems/m-p/1096295#M160569</guid>
      <dc:creator>matija_bacic</dc:creator>
      <dc:date>2020-08-05T10:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Open vpu encoder via vpu_wrapper problems</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Open-vpu-encoder-via-vpu-wrapper-problems/m-p/1519893#M194976</link>
      <description>&lt;P&gt;How did you deal with it，thank you！！&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 09:12:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Open-vpu-encoder-via-vpu-wrapper-problems/m-p/1519893#M194976</guid>
      <dc:creator>a6664120</dc:creator>
      <dc:date>2022-09-09T09:12:36Z</dc:date>
    </item>
  </channel>
</rss>

