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: Video frame display issue

Part Number: AM5728

Hello,

          Actually, i have using opencv to read and display video file from directory or RTSP stream.But i got lagging when display that video frame.

When i play it by gstreamer using command as " gst-launch-1.0 playbin uri="rtsp://admin:jenex#2018@192.168.1.108:554" video-sink=waylandsink", its working fine.

When i try to read video frame from USB cameraa attached with AM5728 board and display that video frame using opencv, its working fine.

So, i am confused here that what should be wrong to play video frame and got lagging.

I have also used multi-threading process. What should i do to play video without any lagging.

Thanks and Regards,

Kishan Patel.

  • Hello,

    Per my understanding you are using custom opencv demo for receiving from network video stream which you are decode->display correct?
    When you are using gstreamer there is no issue same if you you read the file from usb.

    You could try tcp/udp instead of rtsp.

    Here is the link to opencv forum also answers.opencv.org/.../

    BR
    Margarita
  • Hello Margarita,
    Thanks for forum link of opencv.
    I have used opencv for both rtsp-camera and usb-camera.
    Regards,
    Kishan Patel.
  • Hello,

    Please try the suggestion above about tcp for start.
    Second thing since gstreamer is working without an issue I guess is something related with your opencv demo.
    We are not supporting custom opencv demos you could use opencv forum.

    BR
    Margarita
  • Hello Margarita,
    As per i understand gstreamer play in behind. Because if any wrong with my input-camera, it gives gstreamer error.
    So, may be video play by gstreamer when i have used opencv.

    I am thinking to use tcp. But i think it will be risk to use.Because, it is connection-oriented.
    Means if any frame skipped, processor may be ask for previous frame which is not possible in live streaming.

    Regards,
    Kishan Patel.
  • Hello,

    But this is working right:
    gst-launch-1.0 playbin uri="rtsp://admin:jenex#2018@192.168.1.108:554 video-sink=waylandsink

    Are you opening a gstreamer pipeline from opencv in your demo?

    BR
    Margarita

  • Hello Margarita,
    Yes, you are right that (gst-launch-1.0 playbin uri="rtsp://admin:jenex#2018@192.168.1.108:554 video-sink=waylandsink") working fine.
    I have also test opencv with USB camera. It is also working fine.

    And all things are working fine on my system.


    Please, consider all thing and if any other way to read and display video file of IP-camera in code, it may be useful for me.

    Regards,
    Kishan Patel.

  • Hello Margarita,
    There are some encoder/decoder multimedia demo is available on the board.
    Can you tell me the path of that source code.

    Regards,
    Kishan Patel.
  • Hello Kishan,

    If you are asking about omapdrm tests you could find them here:
    git.ti.com/.../
    but I would recommend you to use this command: MACHINE=am57xx-evm bitbake omapdrmtests

    BR
    Margarita
  • Hello Margarita,
    Please, guide me exactly what i have asked.If you can.
    My last querry is that on matrix-launcher we can see "Multimedia" and when we select "Multimedia" number of demos available.
    Now,when we run "IVAHD H.264 Encode" demo,one video will be play.
    Now,simply i want to check source code of this demo.
    If source code is available, tell me the path of it.
    If not available, just tell me steps what would be happen when run "IVAHD H.264 Encode" demo.

    Regards,
    Kishan Patel.
  • Hello,

    First, in your previous answer you did not point for which demo you are asking..
    The demos under "multimedia" are running gstreamer pipelines via script:
    The gst pipelines for encode/decode etc you could find in this guide:
    processors.wiki.ti.com/.../Processor_Training:_Multimedia

    Check my answer in here for more information regarding  .sh:
    e2e.ti.com/.../2150089

    In additional if you wanna write a gstreamer application visit the official gstreamer page with tutorials:
    gstreamer.freedesktop.org

    kishan patel14 said:
    There are some encoder/decoder multimedia demo is available on the board.
    Can you tell me the path of that source code.


    Next time I would recommend you to provide more details in your questions!


    BR
    Margarita

  • Hello Margarita,
    Thanks for reply. I had to clarify querry in details. Its my mistake.
    Okay. So, when we run that demo, there is only one script has been playing. Right?
    Can I check that script?

    Regards,
    Kishan Patel.
  • Sure, you could check it. Please check the e2e link in my previous answer there is explanation where you could find the scripts in the filesystem.

    BR
    Margarita
  • Hello Margarita,
    Okay. I have also found that script.
    Now, when i try to execute same command, i got some error as below:

    command:
    ----------------
    root@am57xx-evm:~# gst-launch-1.0 playbin uri=file://"/usr/share/ti/video/TearOfSteel-Short-1920x800.mov" audio-sink="alsasink" video-sink="kmssink scale=true"

    Output:
    ------------

    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    Redistribute latency...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstAudioSinkClock
    ERROR: from element /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstKMSSink:kmssink0: GStreamer encountered a general resource error.
    Additional debug info:
    ../../../gst-plugins-bad-1.8.3/sys/kms/gstkmssink.c(364): gst_kms_sink_show_frame (): /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstKMSSink:kmssink0:
    drmModeSetPlane failed: Permission denied (13)
    Execution ended after 0:00:00.260140192
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...

    Regards,
    Kishan Patel
  • Hello,

    You must stop weston first.
    /etc/init.d/weston stop

    BR
    Margarita
  • Hello Margarita,
    Now, its working fine.

    And whats wrong with video file which i have tried to play same this from location /home/root. Please, check the below log:
    root@am57xx-evm:~# gst-launch-1.0 playbin uri=file://"people-walking-in-nyc-3_-jlkz7dgh__D_4.mp4" audio-sink="alsasink" video-sink="kmssink scale=true"
    Setting pipeline to PAUSED ...
    ERROR: Pipeline doesn't want to pause.
    ERROR: from element /GstGioSrc:source: Could not open resource for reading.
    Additional debug info:
    ../../../gst-plugins-base-1.8.3/gst/gio/gstgiosrc.c(332): gst_gio_src_get_stream (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstGioSrc:source:
    Could not open location file://people-walking-in-nyc-3_-jlkz7dgh__D_4.mp4 for reading: Operation not supported
    Setting pipeline to NULL ...
    Freeing pipeline ...

    Regards,
    Kishan Patel.
  • Hello,

    Please check the wiki page:
    processors.wiki.ti.com/.../Processor_Training:_Multimedia

    or try
    gst-launch-1.0 playbin uri=file:///home/root/people-walking-in-nyc-3_-jlkz7dgh__D_4.mp4 video-sink=kmssink

    BR
    Margarita
  • Hello Margarita,
    I have tried by giving path from /home....but its still generate error.
    I have also one querry about vlc library means how can i install libVLC on this board.
    I have tried it by execute command "opkg install libVLC", but it could not.
    Regards,
    Kishan Patel.
  • Hello,

    kishan patel14 said:
    I have also one querry about vlc library means how can i install libVLC on this board.
    I have tried it by execute command "opkg install libVLC", but it could not.

    When you have a new question open a new topic!

    kishan patel14 said:
    I have tried by giving path from /home....but its still generate error.

    Share the pipeline with the error. Add debug for more prints also.

    BR
    Margarita

  • Hello Margarita,

    Please,check the below log:

    root@am57xx-evm:~# gst-launch-1.0 playbin uri="file:///home/root/people-walking-in-nyc-3_-jlkz7dgh__D_4.mp4" video-sink=kmssink
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstKMSSink:kmssink0: GStreamer encountered a general resource error.
    Additional debug info:
    ../../../gst-plugins-bad-1.8.3/sys/kms/gstkmssink.c(364): gst_kms_sink_show_frame (): /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstKMSSink:kmssink0:
    drmModeSetPlane failed: Permission denied (13)
    Execution ended after 0:00:00.272531527
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...



    And i think its small querry.So, is it required to generate new topic for all querry?

    Regards,
    Kishan Patel.
  • Hello,

    In this thread there is the  same error that we already discussed. You must stop weston. Refer the previous answer for the command that stops weston.

    kishan patel14 said:
    And i think its small querry.So, is it required to generate new topic for all querry?

    It is related with building psdk and installing package on board. Not related with gstreamer.

    BR
    Margarita

  • Hello,

    In additional when you open a topic for package installation will be nice if you share the error that you are observing and the steps that you executing.

    BR
    Margarita
  • Hello Margarita,
    Okay, i will post it on new topic.
    Can you tell me that gst-api-command which we have execute to play video,is it possible to use in opencv?.
    Means how can use that api with opencv?.

    Regards,
    Kishan Patel.
  • Hello,

    kishan patel14 said:
    Can you tell me that gst-api-command which we have execute to play video,is it possible to use in opencv?.

    kishan patel14 said:
    Means how can use that api with opencv?.

    Since I know we do not have such an example where gstreamer pipeline with TI hardware accelerated codecs are implemented in openCV demo.

    I would recommend you to search over the network.

    Please check this guide regarding gstreamer:

    http://processors.wiki.ti.com/index.php/Processor_Training:_Multimedia

    I see that your coworker asked same question here and it is answered:

    https://e2e.ti.com/support/arm/sitara_arm/f/791/p/714138/2637000#2637000

    Best Regards,

    Margarita

  • Hello Margarita,

             Yes you are right. We are working together.

             Actually, when we are try to use USB-camera with opencv. Its working fine.

             However, when we use rtsp stream, it generate lag.

             So, we are thinking to use hardware codec and pass that stream to opencv.

             If you have any suggestion or best direction,please guide us. So, we can easily implement hardware codec with opencv.

    Regards,

    Kishan Patel.

  • Hello Margarita,
    I have also install latest version of SDK and test with it.But still i got lag issue with opencv.
    In this version, we can see demo of "Deep Learning".
    Can i know the path of that demo-source code?.

    Regards,
    Kishan Patel.
  • Hello,

    You could find more information in here:
    software-dl.ti.com/.../Foundational_Components_TIDL.html

    Please when you have new question open a new thread. This is not related with your gstreamer's question.
    I am closing this thread.

    BR
    Margarita
  • Part Number: AM5728

    Hello,

              I have used latest SDK version and there are some new features we can see like as deep-learning.

    Now, i have tested demo of ti-deep-learning using default camera module.

    I have checked that source and its path may be "/usr/share/ti/tidl/examples/imagenet".

    How can i configure here rtsp stream instead of default-camera.

    I have also changed in main.cpp file by VideoCapture("rtsp://..........") instead of VideoCapture(1) then make it.

    Now when try to run application, still it runs by default-camera module.

    So, how can i use rtsp-camera here?

    Regards,

    Kishan Patel

  • Hello,
    Finally, i have found the exactly source code for demo of TI-Deep-Learning > J11v2 Camera at "/usr/share/ti/tidl/examples/classification".

    Regards,
    Kishan Patel.
  • Hello,

    Okay, but I would recommend you to take a look into this guide as well:
    downloads.ti.com/.../intro.html

    BR
    Margarita
  • Hello Margarita,
    As i told i found source code of deep-learning demo for live-view.
    I have make some changes and use "rtsp-stream" as input-camera.
    I have get lagging here too.
    I thought it could be reduce as used opencl and hardware-codec. But still i got lagging.
    Can you guide me to make it reduce?

    Regards,
    Kishan Patel.
  • Hello Kishan,

    Please open a new thread about TIDL(TI deep learning) but this time I would recommend you to change the topic name to include TIDL not the name to be like this one. So this way will be not merged to this one again.
    Thank you and sorry for the inconvenience.

    BR
    Margarita
  • Hello Margarita,
    Thanks for reply.
    Can you tell me that any configuration to use "kmssink" with gstreamer command.
    Because, whenever i have tried to use kmssink, its not working. And in all examples of gstreamer, i can see "kmsssink" has been used.

    Regards,
    Kishan Patel.
  • Hello Kishan Patel,

    When you are using kmssink you must stop weston. If still not working probably there is an other issue(you could open a new thread, topic: kmssink not working and provide information about what you are running on board).
    When you are using waylandsink, weston must running.

    BR
    Margarita