This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM-Q1: Encoding performance of hardware

Part Number: TDA4VM-Q1
Other Parts Discussed in Thread: TDA4VM

Tool/software:

Hello!

SDK:0901

My requirement is to be able to meet the encoding needs of 4-5 channels with a resolution of 1280 * 960 and FPS>=20. After consulting the platform manual, I found that the performance can meet the requirements. But when I use Gstreame encoding on the TDA4VM platform, with only 4 encoding channels with a resolution of 1280 * 960, the frame rate of the entire Graph is only 18. The frame rate captured by the camera is 25.

Question:How can I solve this problem or How can I improve my encoding performance?

  • Hi,

    Our expert assigned to this E2E thread is currently out of office until Dec 19. 

    Please expect a delay in response.

    Thanks,

    Neehar

  • Hi,

    May I ask when can I get a reply ?

    Thanks

  • Hi, 

    I am currently out of office and will address as soon as I can. I'll replicate a 4 channel encode with our own stream to try to replicate. Could you share the Gstreamer pipeline you are using?

  • Here is our code.

    void CFrameDataConverter::CreateCompressH264Pipeline(int iWidth, int iHeight)
    {
        if(nullptr != m_pCompressPipeline){
            CloseCompressPipline();
        }

        std::string strName = (std::string("pipeline_") + m_strChannel);
        m_pCompressPipeline = gst_pipeline_new(strName.c_str());

        strName = (std::string("appsrc_") + m_strChannel);
        m_pCompressSource = gst_element_factory_make("appsrc", strName.c_str());

        strName = (std::string("queue_") + m_strChannel);
        GstElement *queue = gst_element_factory_make("queue", strName.c_str());

        strName = (std::string("capsfilter_") + m_strChannel);
        GstElement *pFilter1 = gst_element_factory_make("capsfilter", strName.c_str());

        strName = (std::string("h264enc_") + m_strChannel);
        GstElement *pEncoder = gst_element_factory_make("v4l2h264enc", strName.c_str());

        strName = (std::string("appsink_") + m_strChannel);
        GstElement* pSink = gst_element_factory_make("appsink", strName.c_str());


        g_object_set(m_pCompressSource, "format", GST_FORMAT_TIME, "is-live", TRUE, NULL);

        g_object_set(queue, "leaky", 0, NULL);

        GstCaps *caps1 = gst_caps_new_simple("video/x-raw",
                                    "format", G_TYPE_STRING, m_strFromFormat.c_str(),
                                        "width", G_TYPE_INT, iWidth,
                                        "height", G_TYPE_INT, iHeight,
                                        "framerate", GST_TYPE_FRACTION, 25, 1,
                                        "colorimetry", G_TYPE_STRING, "bt601",
                                        NULL);

        g_object_set(pFilter1, "caps", caps1, NULL);
        gst_caps_unref(caps1);

        /*Enum "GstV4l2IOMode" Default: 0, "auto"
            (0): auto             - GST_V4L2_IO_AUTO
            (1): rw               - GST_V4L2_IO_RW
            (2): mmap             - GST_V4L2_IO_MMAP
            (3): userptr          - GST_V4L2_IO_USERPTR
            (4): dmabuf           - GST_V4L2_IO_DMABUF
            (5): dmabuf-import    - GST_V4L2_IO_DMABUF_IMPORT
        */
        g_object_set(G_OBJECT(pEncoder), "output-io-mode", 0, NULL);

        GstStructure *extra_controls =
            gst_structure_new("extra-controls",
                "video_bitrate", G_TYPE_INT, 10000000,
                // "h264_i_frame_period",G_TYPE_INT, 12,
                NULL
            );

        GValue value = G_VALUE_INIT;
        g_value_init(&value, GST_TYPE_STRUCTURE);
        g_value_take_boxed(&value, extra_controls);
        g_object_set_property(G_OBJECT(pEncoder), "extra-controls", &value);
        g_value_unset(&value);

        gst_bin_add_many(GST_BIN(m_pCompressPipeline), m_pCompressSource, queue, pFilter1, pEncoder, pSink, NULL);

        gst_element_link_many(m_pCompressSource, queue, pFilter1, pEncoder, pSink, NULL);

        GstAppSinkCallbacks callbacks = { NULL, NULL, new_sample_Compress};
        gst_app_sink_set_callbacks(GST_APP_SINK(pSink), &callbacks, this, NULL);
        return;
    }