<?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>topic Re: Title: i.MX8MP V4L2 H.264 Encoder Fails on Dynamic Runtime Update (Bitrate Mode / Resolution) — in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Title-i-MX8MP-V4L2-H-264-Encoder-Fails-on-Dynamic-Runtime-Update/m-p/2334434#M244538</link>
    <description>&lt;P&gt;I've already mailed to you for enabling VBR, then you can control it dynamically, pls check my mail&lt;/P&gt;</description>
    <pubDate>Wed, 18 Mar 2026 05:22:37 GMT</pubDate>
    <dc:creator>joanxie</dc:creator>
    <dc:date>2026-03-18T05:22:37Z</dc:date>
    <item>
      <title>Title: i.MX8MP V4L2 H.264 Encoder Fails on Dynamic Runtime Update (Bitrate Mode / Resolution) — poll</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Title-i-MX8MP-V4L2-H-264-Encoder-Fails-on-Dynamic-Runtime-Update/m-p/2333932#M244524</link>
      <description>&lt;P&gt;&lt;LI-PRODUCT title="IMX8MPLUS" id="IMX8MPLUS"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Platform Details:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;SoC: i.MX8MP&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;BSP: (Linux imx8mpevk 6.12.20-lts-next-gdfaf2136deb2)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;GStreamer: 1.26.0 (NXP plugins)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Encoder: v4l2h264enc&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Source: v4l2src (camera)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;OS: Linux (Yocto-based)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Use Case:&lt;/STRONG&gt;&lt;BR /&gt;We are building a &lt;STRONG&gt;dynamic multi-stream video pipeline&lt;/STRONG&gt; using GStreamer with the following architecture:&lt;/P&gt;&lt;PRE&gt;v4l2src → capsfilter → imxvideoconvert_g2d → tee
                                         ├── RTSP branch (v4l2h264enc)

&lt;/PRE&gt;&lt;P&gt;We dynamically create/remove encoder branches from a tee (using request pads) and support runtime configuration updates via API.&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Problem Description:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;We are attempting to &lt;STRONG&gt;dynamically update encoder parameters at runtime&lt;/STRONG&gt; (pipeline in PLAYING state), specifically:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Bitrate mode (CBR / VBR)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Bitrate&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Resolution (caps change)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is done using:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;g_object_set() on encoder (extra-controls)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Updating caps on downstream capsfilter&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Updating videorate (max-rate)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Relevant Code (Simplified):&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;enc_el.set_property("extra-controls", Gst.Structure.new_from_string(
    "controls,video_bitrate_mode=1,video_gop_size=25"))

rate_el.set_property("max-rate", fps)

res_el.set_property("caps", Gst.Caps.from_string(
    f"video/x-raw,width={w},height={h},format=BGRx"))&lt;/PRE&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Observed Behavior:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Immediately after applying dynamic update (especially bitrate mode change), pipeline fails with:&lt;/P&gt;&lt;PRE&gt;gstvideoencoder.c:2506:
Can't copy metadata because input frame disappeared

v4l2object.c:6524: gst_v4l2_object_poll:
poll error 1: Invalid argument (22)

GST_ERROR:
Could not read from resource.

gstbasesrc.c:3187:
Internal data stream error.
streaming stopped, reason error (-5)&lt;/PRE&gt;&lt;P&gt;This results in:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Encoder failure (v4l2h264enc)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Queue failure&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Source (v4l2src) stopping&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Entire pipeline going to error state&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Full Error Logs (Excerpt):&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;gst_v4l2_object_poll:&amp;lt;v4l2h264enc&amp;gt; error: poll error 1: Invalid argument (22)
gst_element_message_full_with_details: Could not read from resource
gst_base_src_loop:&amp;lt;v4l2src&amp;gt; error: Internal data stream error
streaming stopped, reason error (-5)&lt;/PRE&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Key Observations:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Issue is reproducible when changing:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;video_bitrate_mode (CBR ↔ VBR)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;bitrate&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Sometimes encoder accepts property but:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;no visible effect OR&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;fails shortly after&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;FPS changes using videorate work fine&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Resolution changes sometimes work but are unstable&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Is runtime update of v4l2h264enc controls supported?&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Specifically:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;video_bitrate_mode&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;video_bitrate&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;video_gop_size&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Are these controls required to be set only in:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;NULL / READY state?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Does the i.MX8MP VPU driver support:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;dynamic bitrate adjustment in PLAYING state?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;For resolution change:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Is dynamic caps renegotiation supported with imxvideoconvert_g2d + encoder?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Or is pipeline restart required?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;What is the &lt;STRONG&gt;recommended approach&lt;/STRONG&gt; for:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;changing bitrate mode (CBR/VBR)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;changing resolution&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;in a live streaming pipeline?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Additional Context:&lt;/STRONG&gt;&lt;BR /&gt;In commercial IP cameras, bitrate appears to change dynamically without stream interruption.&lt;BR /&gt;We would like to understand whether:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;This is supported at driver level, or&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Requires encoder restart / pipeline rebuild.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Expected Guidance:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Official recommendation from NXP for runtime encoder reconfiguration&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Supported vs unsupported controls in PLAYING state&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Best practice for dynamic streaming pipelines&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Summary:&lt;/STRONG&gt;&lt;BR /&gt;Dynamic updates to v4l2h264enc (especially bitrate mode) result in:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;V4L2 poll errors (EINVAL)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Encoder failure&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Pipeline crash&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;We want to confirm whether this is expected behavior and how to correctly implement dynamic reconfiguration.&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 09:00:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Title-i-MX8MP-V4L2-H-264-Encoder-Fails-on-Dynamic-Runtime-Update/m-p/2333932#M244524</guid>
      <dc:creator>VishnuSidda</dc:creator>
      <dc:date>2026-03-17T09:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Title: i.MX8MP V4L2 H.264 Encoder Fails on Dynamic Runtime Update (Bitrate Mode / Resolution) —</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Title-i-MX8MP-V4L2-H-264-Encoder-Fails-on-Dynamic-Runtime-Update/m-p/2334434#M244538</link>
      <description>&lt;P&gt;I've already mailed to you for enabling VBR, then you can control it dynamically, pls check my mail&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 05:22:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Title-i-MX8MP-V4L2-H-264-Encoder-Fails-on-Dynamic-Runtime-Update/m-p/2334434#M244538</guid>
      <dc:creator>joanxie</dc:creator>
      <dc:date>2026-03-18T05:22:37Z</dc:date>
    </item>
  </channel>
</rss>

