AM62A7: Can encoding and decoding be performed simultaneously?

Part Number: AM62A7

Tool/software:

Dear  TI expert:

We are using the AM62A7 SoC. Can encoding and decoding be performed simultaneously? Additionally, we would like to inquire about how to transfer decoded data to GStreamer, as we aim to develop a video playback feature.

Thank you for your assistance!

Best regards,
Kangbai Li

  • Hi Kangbai,

    Yes, the encoder and decoder works simultaneously. Example pipeline is below

    gst-launch-1.0 -v udpsrc port=6001 ! 'application/x-rtp, media=(string)video, clock-
    rate=(int)90000, encoding-name=(string)H264, payload=(int)96' ! \
    rtph264depay ! h264parse ! v4l2h264dec capture-io-mode=4 ! tiovxmultiscaler name=msc \
    msc. ! queue ! video/x-raw, width=640, height=480, format=NV12 ! kmssink driver-name=tidss \
    msc. ! queue ! video/x-raw, format=NV12, width=1920, height=1080 ! v4l2h264enc output-
    io-mode=5 extra-controls="controls,h264_i_frame_period=60,video_gop_size=60" ! rtph264pay !
    udpsink host=128.247.75.190 port=6001 &
    gst-launch-1.0 -v udpsrc port=6002 ! 'application/x-rtp, media=(string)video, clock-
    rate=(int)90000, encoding-name=(string)H264, payload=(int)96' ! \
    rtph264depay ! h264parse ! v4l2h264dec capture-io-mode=4 ! queue ! v4l2h264enc output-
    io-mode=dmabuf-import extra-controls="controls,h264_i_frame_period=60,video_gop_size=60" !
    rtph264pay ! udpsink host=128.247.75.190 port=6002 &
    gst-launch-1.0 -v udpsrc port=6003 ! 'application/x-rtp, media=(string)video, clock-
    rate=(int)90000, encoding-name=(string)H264, payload=(int)96' ! \
    rtph264depay ! h264parse ! v4l2h264dec capture-io-mode=4 ! queue ! v4l2h264enc output-
    io-mode=dmabuf-import extra-controls="controls,h264_i_frame_period=60,video_gop_size=60" !
    rtph264pay ! udpsink host=128.247.75.190 port=6003 &
    gst-launch-1.0 -v udpsrc port=6004 ! 'application/x-rtp, media=(string)video, clock-
    rate=(int)90000, encoding-name=(string)H264, payload=(int)96' ! \
    rtph264depay ! h264parse ! v4l2h264dec capture-io-mode=4 ! queue ! v4l2h264enc output-
    io-mode=dmabuf-import extra-controls="controls,h264_i_frame_period=60,video_gop_size=60" !
    rtph264pay ! udpsink host=128.247.75.190 port=6004 &

    For More details please refer the below LInk:-

    www.ti.com/lit/an/sprade7/sprade7.pdf?ts=1754540341041&ref_url=https%253A%252F%252Fwww.google.com%252F

    Regards,

    Dilna K

  • Hi Dilna K,

    Thank you for your reply,I have the following questions:

    1、 I have a video file in AVI format and I want to send it to the decoder for decoding, and then send the decoded data to the monitor for display. How can I build a pipeline.

    2、We want to disconnect the data stream that was originally sent to the monitor, and then send the decoded AVI video file data to the monitor. We use the function gst_cd_unlink (src_pad, sink_pad) to disconnect the data stream that was originally sent to the monitor,The specific code is as follows

        auto tiovxmultiscaler2 = std::make_shared<tiovxmultiscalerModule>("tiovxmultiscaler2");
        tiovxmultiscaler2->set_property("target", 1);
        src_element = tiovxmultiscaler2->element();
        dest_element = capsFilterMsc2_disp->element();
        gst_cd_unlink(src_element, dest_element);
    

    but I found that the values of src_element and dest_element are NULL. Why is this happening? Alternatively, is there a better approach to achieve this functionality?

    The originally constructed pipeline is as follows

     


    Thank you for your assistance!

    Best regards,
    Kangbai Li


  • Hi Kangbai,

    Could you please resend the pipeline image again so that we get an understanding of your pipeline flow. we cannot able to zoom it after downloading. 

  • Hi Dilna K,

    The pipeline image is as follow

    To supplement the previous context: We want to develop video playback functionality. Currently, we can correctly demux AVI files, and the demuxed H.264 streams are sent to GStreamer. How should we construct the pipeline?

    Best regards,

    Kangbai Li

  • Hi Kangbai,

    Sorry we cannot able to view each gstreamer plugin details in this image. when we zoom it image get pixalated and not able to view. can you sent it as a file?

    Regards,

    Dilna

  • Hi Dilna,

    I just sent the image to you thru Webex. Could you please take a look? Thanks

  • Hi Kangbai,

    Now i can able to view your pipeline. 

    1. You can build pipeline as below to send the decoded data to the monitor for display.

    gst-launch-1.0 filesrc location=/<path_to_file> ! qtdemux ! h264parse ! v4l2h264dec ! video/x-raw,format=NV12 ! kmssink
    

    2.   You can use gstreamer input-selector element to switch between videosrc and filesrc for dynamic switching selector is another one better approach to achieve this functionality