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.

am5728: H.264 encode speed issue

Part Number: AM5728
Other Parts Discussed in Thread: AM5728

Hi,

I have a question about AM5728 ducatih264 enc/dec.

I setup a camera module on am5728 board and it works well. (gstreamer v4l2src displays well)

The matter is frame rate.

When I use below command

gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=600 ! 'video/x-raw, format=(string)NV12, width=1920, height=1080, framerate=30/1' ! queue ! ducatih264enc ! h264parse ! queue ! ducatih264dec ! fpsdisplaysink text-overlay=false -v

it gives about 1~2 fps.

So I tested above command with videotestsrc

gst-launch-1.0 videotestsrc num-buffers=600 ! 'video/x-raw, format=(string)NV12, width=1920, height=1080, framerate=30/1' ! queue ! ducatih264enc ! h264parse ! queue ! ducatih264dec ! fpsdisplaysink text-overlay=false -v

and it gives 30fps.

I think am5728 could encode video stream data upto 1080p60.

What should I do to have 1080p30 real time encoding v4l2src data?

Please advise me.

Thank you.

  • Thank you for reply.

    I saw that link before.

    It said "H.264 encoding of AM57x IVA-HD the limit is 1080p30."

    I cannot get 1080p30 encoded data from v4l2src.

    The whole system I want to do is ..

    1. One am5728 board encodes 1080p30 data from v4l2src.

    2. Now, this encoded data can be used by appsink.

    3. By using appsink, encoded data sent to other am5728 board .

    4. By using appsrc, am5728 board receives encoded data.

    5. Finally, it can decode and stream the encoded data.

    When I executes the above system, decoding and streaming of real-time video data is shown well ,but terrible fps ( about 10 fps).

    So I tracked to know what is problem and I discovered that the fps of encoded data is terrible.

    When I did some experiments with gst-launch-1.0, I found that encoding of 1080p30 v4l2src data badly operates.(because encoding of 1080p30 videotestsrc data operates well).

    Please help me to get 1080p30 real time encoded data from v4l2src.

    Thank you in advance.
  • Problem is with the camera board on GP EVM. While VIP interface can receive video at 1080p60, sensor used in the baord isn't capable of streaming 1080p30 video. It can only stream1080p@10 fps.
  • Manisha, thank you for your reply.

    I don't get 'camera board on GP evm'  and  'sensor used in the board' .

    We use our camera board and this gives 1080p30 NV12 format video data through VIP interface of am5728 board.

    Do you mean am5728 cannot accept 1080p30 video data even though camera board gives 1080p30 video data??

    I checked 1080p30 raw video data streamed using gstreamer command. So I think am5728 board can accept 1080p30 data from our camera board.

    But when I try to encode this video data , fps problem come up.

    Please help me.

  • Hello.

    Manisha,

    I got 1080p30 streaming by using below gstreamer command

    gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, format=(string)NV12 ,width=1920, height=1080, framerate=30/1' ! queue ! fpsdisplaysink text-overlay=false -v

    And, I used below gstreamer command to get a encoded data

    gst-launch-1.0 v4l2src device=/dev/video1 io-mode=2 ! 'video/x-raw, formate=(string)NV12, width=1920, height=1080, framerate=30/1' ! queue ! ducatih264enc ! h264parse ! queue ! filesink location=enc.h264


    I decoded and streamed 'enc.h264' with below command

    gst-launch-1.0 filesrc location=enc.h264 num-buffers=2000 ! queue ! 'video/x-h264, format=(string)NV12, width=1920, height=1080, framerate=30/1' ! h264parse ! ducatih264dec ! queue ! kmssink

    But, the streamed video was faster than I expected.
    So I streamed 'enc.h264' with 15 fps.(below command)

    gst-launch-1.0 filesrc location=enc.h264 num-buffers=2000 ! queue ! 'video/x-h264, format=(string)NV12, width=1920, height=1080, framerate=15/1' ! h264parse ! ducatih264dec ! queue ! kmssink

    Now I got correct fps.
    So, I thought video is encoded with 15 fps, but I want 30fps...

    How can I get 1080p30 encoded video data?
    Did I do something wrong with gstreamer command or other things?

    Please help me.
  • Hi Kyon Jung,

    We will look into it and get back.

    Regards,
    Manisha
  • Thank you for your consideration.

    I want to tell you what I found.

    When I tried to stream a raw video data, I used "io-mode=4". It was capable of 30fps streaming.

    When I used "io-mode=5", a frame rate was 22. (other io-mode option shows worse performance)

    So I thought I should use "io-mode=4" to get 1080p30 encoded data.

    But, "io-mode=4" used with "ducatih264enc" showed me a "rpmsg_rpc rpmsg-dce" error (same situation with this link e2e.ti.com/.../575038)

    Gstreamer command I used is below one.

    gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1' ! queue ! ducatih264enc ! h264parse ! filesink location=enc.h264



    Hope this is useful information for finding the way to get 1080p30 encoded data.

    Regards,
    Kyou Jung Son
  • Thanks Kyou Jung Son for further investigation. This is being investigated now. I shall update you here once we have root caused and have some solution to share.