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.

SK-TDA4VM:May I ask about the programming and use of the RPi 40-pin connector on the SK-TDA4VM?

Part Number: SK-TDA4VM

Hello
I operate according to the official file provided by TI, and the path is https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-sk-tda4vm/08_01_00_02/exports/docs/pi_hdr_programming.html  .

First, in this path /run/media/mmcblk0p1/uenv.txt, change the content to name_overlays=k3-j721e-edgeai-apps.dtbo k3-j721e-sk-rpi-exp-header.dtbo, and reboot after saving .

Later the CPP library path provided in my download file is https://github.com/TexasInstruments/ti-gpio-cpp , and install it in sequence according to the github content, and I execute the sample here, but the LED does not work, which step is wrong?

Also, can SK-TDA4VM play video? Does it support SMPlayer?
If I want to install SMPLAYER, what command do you use to install it?

Thanks

  • Hi Yi-Fong,

    For debugging what is wrong with GPIO, could you post any build logs when you were building the CPP library? Also, which pin number are you connecting the LED to? 

    For SMPlayer, the SDK does not include this package by default, so we have not tested this. You will either have to install it through a Yocto build to cross compile the packages for SMPlayer that you can install with opkg, or setting up a Docker container for Ubuntu so that you can install packages using the apt package manager.

    Yocto: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-sk-tda4vm/latest/exports/docs/development_flow.html#building-the-linux-sdk-from-source

    Docker: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-sk-tda4vm/latest/exports/docs/docker_environment.html

    As an alternative, the SDK does support GStreamer, which can also be used to display video. The out of box demos included with the Edge AI SDK use GStreamer, and these can be used as reference when developing application.

    Regards,

    Takuma

  • Hi Takuma,

    The following is the log generated when building the CPP library.

    root@j7-evm:~/gpio/gpio_c# mkdir build
    root@j7-evm:~/gpio/gpio_c# cd build
    root@j7-evm:~/gpio/gpio_c/build# cmake ..
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    Build type: Release
    -- CMAKE_BUILD_TYPE = Release PROJECT_NAME = ti_gpio
    INCLUDE_INSTALL_DIR = lib64/include
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/root/gpio/gpio_c/build
    root@j7-evm:~/gpio/gpio_c/build# make
    make[1]: Entering directory '/home/root/gpio/gpio_c/build'
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    Scanning dependencies of target ti_gpio
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    [ 4%] Building CXX object CMakeFiles/ti_gpio.dir/src/gpio.cpp.o
    [ 9%] Building CXX object CMakeFiles/ti_gpio.dir/src/gpio_event.cpp.o
    [ 13%] Building CXX object CMakeFiles/ti_gpio.dir/src/gpio_pin_data.cpp.o
    [ 18%] Building CXX object CMakeFiles/ti_gpio.dir/src/gpio_common.cpp.o
    [ 22%] Building CXX object CMakeFiles/ti_gpio.dir/src/gpio_sw_pwm.cpp.o
    [ 27%] Building CXX object CMakeFiles/ti_gpio.dir/src/gpio_hw_pwm.cpp.o
    [ 31%] Building CXX object CMakeFiles/ti_gpio.dir/src/python_functions.cpp.o
    [ 36%] Linking CXX static library ../lib/Release/libti_gpio.a
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 36%] Built target ti_gpio
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    Scanning dependencies of target simple_pwm
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    [ 40%] Building CXX object CMakeFiles/simple_pwm.dir/samples/simple_pwm.cpp.o
    [ 45%] Linking CXX executable ../bin/Release/simple_pwm
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 45%] Built target simple_pwm
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    Scanning dependencies of target button_interrupt
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    [ 50%] Building CXX object CMakeFiles/button_interrupt.dir/samples/button_interrupt.cpp.o
    [ 54%] Linking CXX executable ../bin/Release/button_interrupt
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 54%] Built target button_interrupt
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    Scanning dependencies of target test_all_pins_pwm
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    [ 59%] Building CXX object CMakeFiles/test_all_pins_pwm.dir/samples/test_all_pins_pwm.cpp.o
    [ 63%] Linking CXX executable ../bin/Release/test_all_pins_pwm
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 63%] Built target test_all_pins_pwm
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    Scanning dependencies of target button_event
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    [ 68%] Building CXX object CMakeFiles/button_event.dir/samples/button_event.cpp.o
    [ 72%] Linking CXX executable ../bin/Release/button_event
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 72%] Built target button_event
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    Scanning dependencies of target ti_gpio_test
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    [ 77%] Building CXX object CMakeFiles/ti_gpio_test.dir/samples/ti_gpio_test.cpp.o
    [ 81%] Linking CXX executable ../bin/Release/ti_gpio_test
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 81%] Built target ti_gpio_test
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    Scanning dependencies of target test_all_pins_input
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    [ 86%] Building CXX object CMakeFiles/test_all_pins_input.dir/samples/test_all_pins_input.cpp.o
    [ 90%] Linking CXX executable ../bin/Release/test_all_pins_input
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 90%] Built target test_all_pins_input
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    Scanning dependencies of target simple_out
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    [ 95%] Building CXX object CMakeFiles/simple_out.dir/samples/simple_out.cpp.o
    [100%] Linking CXX executable ../bin/Release/simple_out
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [100%] Built target simple_out
    make[1]: Leaving directory '/home/root/gpio/gpio_c/build'
    root@j7-evm:~/gpio/gpio_c/build# make install
    make[1]: Entering directory '/home/root/gpio/gpio_c/build'
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 36%] Built target ti_gpio
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 45%] Built target simple_pwm
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 54%] Built target button_interrupt
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 63%] Built target test_all_pins_pwm
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 72%] Built target button_event
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 81%] Built target ti_gpio_test
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [ 90%] Built target test_all_pins_input
    make[2]: Entering directory '/home/root/gpio/gpio_c/build'
    make[2]: Leaving directory '/home/root/gpio/gpio_c/build'
    [100%] Built target simple_out
    make[1]: Leaving directory '/home/root/gpio/gpio_c/build'
    Install the project...
    -- Install configuration: "Release"
    -- Installing: /usr/local/lib64/libti_gpio.a
    -- Up-to-date: /usr/local/lib64/include/GPIO.h
    -- Installing: /usr/local/lib64/cmake/ti_gpio/ti_gpioTargets.cmake
    -- Installing: /usr/local/lib64/cmake/ti_gpio/ti_gpioTargets-release.cmake
    -- Installing: /usr/local/lib64/cmake/ti_gpio/ti_gpioConfig.cmake
    -- Installing: /usr/local/lib64/cmake/ti_gpio/ti_gpioConfigVersion.cmake

    I used the file simple_out.cpp in the CPP library to test, the pin is 18, but the test result is that the LED does not have any action.

    And I have also tested by myself, connect the LED to pin 31 and pin 39, output the state of HIGH, but the LED did not light up.

    Is there a built-in player that can play AVI video files?

    Thanks

  • Hi Yi-Fong,

    Could you make sure you are connecting to the BOARD pin number 12 when using simple_out.cpp? simple_out.cpp outputs on BOARD pin number 12, which corresponds to BCM pin number 18.

    For playing AVI files, you could try using the command: gst-launch-1.0 playbin uri=file:</path/to/file>

    Please note that playbin does a lot of abstraction, so there are probably more efficient pipelines that can be made by specifying each element in the pipeline. My recommendation is to read up on GStreamer: https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html?gi-language=chttps://gstreamer.freedesktop.org/documentation/playback/playbin.html?gi-language=c 

    Additionally, TI provides a few GStreamer element examples that use hardware acceleration: https://github.com/TexasInstruments/edgeai-gst-plugins/wiki

    Regards,

    Takuma

  • Hi Takuma,

    I have confirmed that one of the LED pins is connected to PIN12, but the LED will not light up.
    It is found that there is a header file include <GPIO.h> in the simple_out.cpp program, and an error occurs during compilation, which is simple_out.cpp:36:10: fatal error: GPIO.h: No such file or directory, but I have put the GPIO The .h file is placed in the same folder as simple_out.cpp, and the error is still the same.
    And I have tried other methods, changing the header file include <GPIO.h> to include "GPIO.h", the compilation is normal, but the LED does not light up after the file is executed

    I have used the command you provided gst-launch-1.0 playbin uri=file:</path/to/file>, but the message is -sh: syntax error near unexpected token `newline'

    thanks

  • Hi Takuma,

    From the file you provided, there is an example in the content of gst-launch-1.0 -v playbin uri=file:///path/to/somefile.mp4, and the command I entered is gst-launch-1.0 -v playbin uri=file:///AHB/12-15.avi, the information obtained is as follows

    root@j7-evm:~# gst-launch-1.0 -v playbin uri=file:///AHB/12-15.avi
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-size = -1
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-duration = -1
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: use-buffering = false
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: download = false
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: uri = file:///AHB/12-15.avi
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: connection-speed = 0
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: source = "\(GstFileSrc\)\ source"
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = video/x-msvideo
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = NULL
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:src_0: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, framerate=(fraction)30/1, width=(int)720, height=(int)540
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMpeg4VParse:mpeg4vparse0.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, framerate=(fraction)30/1, width=(int)720, height=(int)540
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-buffers = 5
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-time = 0
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-bytes = 2097152
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstMultiQueuePad:sink_0: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, framerate=(fraction)30/1, width=(int)720, height=(int)540
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-buffers = 5
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-time = 0
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-bytes = 2097152
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-buffers = 5
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-time = 0
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-bytes = 2097152
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-buffers = 5
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-time = 0
    /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0: max-size-bytes = 2097152
    Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayEGL\)\ gldisplayegl0";
    Caught SIGSEGV
    #0 0x0000ffff8c4a233c in poll () from /lib/libc.so.6
    #1 0x0000ffff8c63f7e0 in ?? () from /usr/lib/libglib-2.0.so.0
    #2 0x0000ffff8c63fc38 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
    #3 0x0000ffff8c780634 in gst_bus_poll () from /usr/lib/libgstreamer-1.0.so.0
    #4 0x0000000000404988 in _start ()
    Spinning. Please run 'gdb gst-launch-1.0 1398' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

    May I ask if I am missing something?

    thanks

  • Hi Yi-Fong,

    Could you move to the latest 8.2 version of the SDK: https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-SK-TDA4VM

    Additionally, for GPIO could you try the Python version: https://github.com/TexasInstruments/ti-gpio-py

    For the error with gst-launch-1.0, it looks like playbin is automatically using OpenGL sink, so could you try specifying the sink like so:

    gst-launch-1.0 -v playbin uri=file:///AHB/12-15.avi video-sink=kmssink

    and post logs?

    Regards,

    Takuma

  • Hi Takuma,

    I'm currently using version 8.2 of the SDK.
    The following operations are in SDK version 8.2.
    There is also GPIO, I am using the python version and it can be used normally.
    But C++ still doesn't work, the log is as follows.

    simple_out.cpp:36:10: fatal error: GPIO.h: No such file or directory
    36 | #include <GPIO.h>
    | ^~~~~~~~
    compilation terminated.
    And I execute gst-launch-1.0 -v playbin uri=file:///AHB/12-15.avi video-sink=kmssink, the log is as follows.

    root@tda4vm-sk:~# gst-launch-1.0 -v playbin uri=file:///AHB/12-15.avi video-sink=kmssink
    Setting pipeline to PAUSED ...
    ERROR: Pipeline doesn't want to pause.
    ERROR: from element /GstKMSSink:kmssink0: Could not get allowed GstCaps of device
    Additional debug info:
    ../gst-plugins-bad-1.16.3/sys/kms/gstkmssink.c(892): gst_kms_sink_start (): /GstKMSSink:kmssink0:
    driver does not provide mode settings configuration
    Setting pipeline to NULL ...
    Freeing pipeline ...

    Thanks
  • Hi Yi-Fong,

    It is great that the python GPIO examples are working. For now, could you use python GPIO for development as we check why the C++ headers are not being detected.

    For GStreamer, it is strange that playbin is not working. Could you run this GStreamer pipeline to verify that we can display something to the screen: gst-launch-1.0 videotestsrc ! autovideosink

  • Hi Takuma,

    Could you please let me know when C++ GPIO is available, thanks.
    I use python to write and play the video screen and use the opencv-python package, but it produces errors, and I can run it normally under windows. 
    Does it currently support using python opencv to play video?
    I am running gst-launch-1.0 videotestsrc ! autovideosink and the log is below.

    root@tda4vm-sk:~# gst-launch-1.0 videotestsrc ! autovideosink
    Setting pipeline to PAUSED ...
    Caught SIGSEGV
    #0 0x0000ffff9b4b2834 in waitpid () from /lib/libpthread.so.0
    #1 0x0000ffff9b562188 in g_on_error_stack_trace ()
    #2 0x0000000000403fc8 in _start ()
    Spinning. Please run 'gdb gst-launch-1.0 2273' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

    Thanks

  • Hi Takuma,

    I've solved that I can play the movie with gst-launch-1.0 playbin on SK-TDA4VM.
    I use C++ to run the program to play the video, but an error occurs during compilation. The reason for the error is the imshow command in the opencv package.
    Does it currently support using the commands in the opencv package to display video? Or can I only use gstreamer for video display?

  • Hi Yi-Fong,

    Currently, TI develops demo using GStreamer for displaying videos on SK-TDA4VM, so this is our recommendation since we will be able to give customers better support. Other video display methods will rely heavily on the customer-side as TI will only be able to give minimal support.

    For imshow, I have tried on my side as well, but this function is currently not supported in our Edge AI SDK. 

    There are two different issues in this thread so:

    • For CPP GPIO, what is the exact command used to generate the header not found error? Initial cmake build did not show this error, but is simple_out.cpp being built using a different build method? 
    • For displaying video, what is the goal? Is using GStreamer to display video insufficient?

    Regards,

    Takuma

  • Hi Takuma,

    When I build CPP GPIO, the input command is g++ simple_out.cpp -o gpio.out -lpthread -lti_gpio, and I have put the GPIO.h file and simple_out.cpp in the same folder, but an error occurs, the log is as follows

    1. simple_out.cpp:36:10: fatal error: GPIO.h: No such file or directory
    36 | #include <GPIO.h>

    2. For the display video, my main purpose is to use OPENCV for image processing, but I am currently unable to concatenate the gstreamer display video with OPENCV for image processing.

    Thanks

  • Hi Yi-Fong,

    1. We updated the Github repository instructions for building without using cmake, so could you see if you are able to compile with the updated instruction: https://github.com/TexasInstruments/ti-gpio-cpp#1-include-the-libary

    2. OpenCV can get a video stream from GStreamer using OpenCV's VideoCapture class and specifying the API being used as GStreamer. TI currently does not have a demo for this, but examples can be found online on how this can be done.

    Regards,

    Takuma

  • Hi Takuma,

    1.I use g++ simple_out.cpp -o gpio.out -I</gpio/include> -L</gpio/lib> -lpthread -lti_gpio command and still get the same error

    2. I use gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw, framerate=30/1, width=1280, height=720! autovideosink directive works,but I am using OpenCV's VideoCapture in python, adding gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw,framerate=30/1,width=1280,height=720 !autovideosink directive in it But it is wrong, and I have also looked for related cases on the Internet, but the result is not working.

    Can you provide relevant examples?

    Thanks
  • Hi Yi-Fong,

    1. By default, the GPIO libraries are installed under /usr/local/include and /usr/local/lib64. Can you confirm the following does not work: g++ simple_out.cpp -o gpio.out -I/usr/local/include -L/usr/local/lib64 -lpthread -lti_gpio

    2. The keywords to search for are "GStreamer with OpenCV". An example would look something along the lines of: cv2.VideoCapture('videotestsrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! appsink', cv2.CAP_GSTREAMER). Some things to keep in mind is OpenCV expects a certain color format (BGR) which is why videoconvert is being used, and appsink instead of other sinks is used to pass the GStreamer pipeline to OpenCV application.

    Regards,

    Takuma

  • Hi Takuma,

    Really thank you very much, I have solved the problem with GPIO C++.

    I followed the example you provided cv2.VideoCapture('videotestsrc ! video/x-raw, framerate=20/1 ! videoscale ! videoconvert ! appsink', cv2.CAP_GSTREAMER) to test.


    I just went to read webcam video with opencv's gstreamer suite, and python can be executed, but C++ can't.


    Is it because the related packages displayed by opencv do not support this problem? The log is as follows

    Can't receive frame (stream end?). Exiting ...
    terminate called after throwing an instance of 'cv::Exception'
    what(): OpenCV(4.1.0) /usr/src/debug/opencv/4.1.0-r0/git/modules/highgui/src/window.cpp:621: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvDestroyAllWindows'

    Aborted (core dumped)

    Thanks

  • Hi Yi-Fong, 

    It is very likely that the C++ OpenCV library packaged with Edge AI SDK does not have support if the same pipeline can run using Python. 

    As a relatively quick workaround, you could try building a Docker container for Ubuntu using the Dockerfile provided with Edge AI SDK to be able to use the apt package manager to install the packages mentioned in the error message: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-sk-tda4vm/08_02_00/exports/docs/docker_environment.html

    As an alternative to Docker so that you can run the example outside a Docker container, updating the OpenCV packages outside of Docker will require a Yocto build using the Edge AI SDK's underlying PSDK Linux which will take much longer than Docker: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-sk-tda4vm/08_02_00/exports/docs/development_flow.html#building-the-linux-sdk-from-source

    Regards,

    Takuma