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-AM62A-LP: Running A USB Camera To RTSP Stream Pipeline On The AM62A Dev Kit

Part Number: SK-AM62A-LP
I want to run a usb camera to rtsp sink gstreamer pipeline on the am62a devkit that creates a stream at <device ip>/stream and uses jpeg encoding. 
Here's the pipeline I'm running:
gst-launch-1.0 v4l2src device=/dev/video3 ! image/jpeg, framerate=30/1, width=1280, height=720 ! jpegdec ! tiovxdlcolorconvert ! video/x-raw, width=1280, height=720, format=NV12 ! v4l2jpegenc output-io-mode=dmabuf-import extra-controls=c,compression_quality=70 ! jpegparse ! image/jpeg, mapping=/stream, framerate=30/1 ! rtspsink
This produces an internal data stream error:
APP: Init ... !!!
MEM: Init ... !!!
MEM: Initialized DMA HEAP (fd=6) !!!
MEM: Init ... Done !!!
IPC: Init ... !!!
IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
  2100.032828 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
  2100.032933 s:  VX_ZONE_INIT:Enabled
  2100.032945 s:  VX_ZONE_ERROR:Enabled
  2100.032954 s:  VX_ZONE_WARNING:Enabled
  2100.034010 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
  2100.034544 s:  VX_ZONE_INIT:[tivxHostInitLocal:96] Initialization Done for HOST !!!
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../gstreamer/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Execution ended after 0:00:00.000640870
Setting pipeline to NULL ...
Freeing pipeline ...
  2100.071553 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:110] De-Initialization Done for HOST !!!
  2100.076195 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
APP: Deinit ... !!!
REMOTE_SERVICE: Deinit ... !!!
REMOTE_SERVICE: Deinit ... Done !!!
IPC: Deinit ... !!!
IPC: DeInit ... Done !!!
MEM: Deinit ... !!!
DDR_SHARED_MEM: Alloc's: 0 alloc's of 0 bytes 
DDR_SHARED_MEM: Free's : 0 free's  of 0 bytes 
DDR_SHARED_MEM: Open's : 0 allocs  of 0 bytes 
MEM: Deinit ... Done !!!
APP: Deinit ... Done !!!
Any idea what I'm missing/doing wrong?
  • This is closer to what I want to run but produces similar errors:

    gst-launch-1.0 v4l2src device=/dev/video3 ! capsfilter caps="video/x-raw, width=(int)1280, height=(int)720;" ! tiovxdlcolorconvert ! capsfilter caps="video/x-raw, format=(string)NV12;" ! v4l2jpegenc output-io-mode=dmabuf-import extra-controls=c,compression_quality=70 ! jpegparse ! image/jpeg, mapping=/stream, framerate=30/1 ! rtspsink

    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=6) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
      9004.445312 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
      9004.445426 s:  VX_ZONE_INIT:Enabled
      9004.445438 s:  VX_ZONE_ERROR:Enabled
      9004.445447 s:  VX_ZONE_WARNING:Enabled
      9004.446531 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
      9004.447018 s:  VX_ZONE_INIT:[tivxHostInitLocal:96] Initialization Done for HOST !!!
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    ERROR: pipeline doesn't want to preroll.
    Execution ended after 0:00:00.000602880
    Setting pipeline to NULL ...
    Freeing pipeline ...
      9004.481670 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:110] De-Initialization Done for HOST !!!
      9004.486297 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    DDR_SHARED_MEM: Alloc's: 0 alloc's of 0 bytes 
    DDR_SHARED_MEM: Free's : 0 free's  of 0 bytes 
    DDR_SHARED_MEM: Open's : 0 allocs  of 0 bytes 
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!
    

  • Hi Osman,

    Does a simple pipeline using videotestsrc work with rtspsink?

    Can you add the service=5000 (Basically the port address) and see if it works. Default port if not specified might require root permissions and the pipeline might fail.

    Also you can try replacing rtspsink by adding rtpjpegpay !  udpsink host=<ip addresss> port=5000 and see if it helps.

    Best Regards,

    Suren

  • Hi Suran,

    Thanks for the assistance. I can now get the pipeline to play, but only at a resolution of 640x480, and only if I use "videoconvert" instead of "tiovxdlcolorconvert".

    gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-raw,width=640,height=480 ! videoconvert ! video/x-raw,width=640,height=480,format=NV12 ! v4l2jpegenc ! image/jpeg,mapping=/stream,framerate=30/1 ! rtspsink

    Setting pipeline to PAUSED ...
    0:00:00.092543015 30119 0xaaab054f5a10 WARN                    v4l2 gstv4l2object.c:4543:gst_v4l2_object_probe_caps:<v4l2jpegenc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Redistribute latency...
    0:00:00.747675285 30119 0xaaab054eb9e0 WARN                 v4l2src gstv4l2src.c:1123:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:00.565631190
    Redistribute latency...
    0:00:04.9 / 99:99:99.
    

    However, I still can't connect to the stream via VLC even if I explicitly set the port to 5000 as you suggested.

  • Also, using the below command to launch a udp out pipeline doesn't work either.

    gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-raw,width=640,height=480 ! videoconvert ! video/x-raw,width=640,height=480,format=NV12 ! v4l2jpegenc ! image/jpeg,mapping=/stream,service=5000,framerate=30/1 ! rtpjpegpay !  udpsink host=10.0.0.27 port=5000

  • Osman,

    Can you check what the video formats and resolutions your usb camera supports. Our Encoder would expect the format to be NV12, so you would need a videoconvert. I need to check why tiovxcolorconvert based on the input format your camera is sending data in. 

    Best Regards,

    Suren

  • Here are the commands I ran:

    # v4l2-ctl -d /dev/video3 --list-formats
    ioctl: VIDIOC_ENUM_FMT
    	Type: Video Capture
    
    	[0]: 'YUYV' (YUYV 4:2:2)
    

    # v4l2-ctl -d /dev/video3 --list-formats-ext
    ioctl: VIDIOC_ENUM_FMT
    	Type: Video Capture
    
    	[0]: 'YUYV' (YUYV 4:2:2)
    		Size: Discrete 320x180
    			Interval: Discrete 0.033s (30.000 fps)
    			Interval: Discrete 0.067s (15.000 fps)
    		Size: Discrete 320x240
    			Interval: Discrete 0.033s (30.000 fps)
    			Interval: Discrete 0.067s (15.000 fps)
    		Size: Discrete 352x240
    			Interval: Discrete 0.033s (30.000 fps)
    			Interval: Discrete 0.067s (15.000 fps)
    		Size: Discrete 352x288
    			Interval: Discrete 0.033s (30.000 fps)
    			Interval: Discrete 0.067s (15.000 fps)
    		Size: Discrete 424x240
    			Interval: Discrete 0.033s (30.000 fps)
    			Interval: Discrete 0.067s (15.000 fps)
    		Size: Discrete 640x360
    			Interval: Discrete 0.017s (60.000 fps)
    			Interval: Discrete 0.033s (30.000 fps)
    			Interval: Discrete 0.067s (15.000 fps)
    		Size: Discrete 640x480
    			Interval: Discrete 0.033s (30.000 fps)
    			Interval: Discrete 0.067s (15.000 fps)
    		Size: Discrete 704x576
    			Interval: Discrete 0.033s (30.000 fps)
    			Interval: Discrete 0.067s (15.000 fps)
    		Size: Discrete 848x480
    			Interval: Discrete 0.033s (30.000 fps)
    			Interval: Discrete 0.067s (15.000 fps)
    		Size: Discrete 960x540
    			Interval: Discrete 0.033s (30.000 fps)
    			Interval: Discrete 0.067s (15.000 fps)
    

    I'm able to use this same camera to run a USB camera to HDMI out facial recognition pipeline, so I don't think there's a problem w/ the camera. Since neither udp or rtsp are working, could that point to something being off w/ networking?

    BTW, here are the errors I get when I replace "videoconvert" w/ "tiovxdlcolorconvert"

    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=6) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
     10246.214823 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
     10246.214916 s:  VX_ZONE_INIT:Enabled
     10246.214926 s:  VX_ZONE_ERROR:Enabled
     10246.214936 s:  VX_ZONE_WARNING:Enabled
     10246.215883 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
     10246.216343 s:  VX_ZONE_INIT:[tivxHostInitLocal:96] Initialization Done for HOST !!!
    Setting pipeline to PAUSED ...
    0:00:00.134740215 24166 0xaaab0254a830 WARN                    v4l2 gstv4l2object.c:4543:gst_v4l2_object_probe_caps:<v4l2jpegenc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    0:00:00.208337305 24166 0xaaab025429e0 WARN                GST_CAPS gstpad.c:3235:gst_pad_query_accept_caps_default:<v4l2jpegenc0:sink> caps: video/x-raw, width=(int)960, height=(int)540, format=(string)NV12, framerate=(fraction)30/1 were not compatible with: video/x-raw, width=(int)960, height=(int)540, format=(string)NV12, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string){ 1:4:7:1, bt601, smpte240m, bt709, 2:4:5:2, 2:4:5:3, 2:4:7:1, 2:4:12:8, bt2020, 2:0:0:0 }
    0:00:00.208534625 24166 0xaaab025429e0 WARN           basetransform gstbasetransform.c:1370:gst_base_transform_setcaps:<capsfilter1> transform could not transform video/x-raw, format=(string)NV12, width=(int)960, height=(int)540, framerate=(fraction)30/1 in anything we support
    0:00:00.208763995 24166 0xaaab025429e0 WARN                GST_CAPS gstpad.c:3235:gst_pad_query_accept_caps_default:<v4l2jpegenc0:sink> caps: video/x-raw, width=(int)960, height=(int)540, format=(string)NV12, framerate=(fraction)30/1 were not compatible with: video/x-raw, width=(int)960, height=(int)540, format=(string)NV12, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string){ 1:4:7:1, bt601, smpte240m, bt709, 2:4:5:2, 2:4:5:3, 2:4:7:1, 2:4:12:8, bt2020, 2:0:0:0 }
    0:00:00.208855650 24166 0xaaab025429e0 WARN           basetransform gstbasetransform.c:1370:gst_base_transform_setcaps:<capsfilter1> transform could not transform video/x-raw, format=(string)NV12, width=(int)960, height=(int)540, framerate=(fraction)30/1 in anything we support
    0:00:00.208901085 24166 0xaaab025429e0 WARN                GST_PADS gstpad.c:4351:gst_pad_peer_query:<tiovxdlcolorconvert0:src> could not send sticky events
    0:00:00.541570610 24166 0xaaab025429e0 WARN                GST_CAPS gstpad.c:3235:gst_pad_query_accept_caps_default:<v4l2jpegenc0:sink> caps: video/x-raw, width=(int)960, height=(int)540, format=(string)NV12, framerate=(fraction)30/1 were not compatible with: video/x-raw, width=(int)960, height=(int)540, format=(string)NV12, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string){ 1:4:7:1, bt601, smpte240m, bt709, 2:4:5:2, 2:4:5:3, 2:4:7:1, 2:4:12:8, bt2020, 2:0:0:0 }
    0:00:00.541754320 24166 0xaaab025429e0 WARN           basetransform gstbasetransform.c:1370:gst_base_transform_setcaps:<capsfilter1> transform could not transform video/x-raw, format=(string)NV12, width=(int)960, height=(int)540, framerate=(fraction)30/1 in anything we support
    0:00:00.549379475 24166 0xaaab025429e0 WARN                GST_CAPS gstpad.c:3235:gst_pad_query_accept_caps_default:<v4l2jpegenc0:sink> caps: video/x-raw, width=(int)960, height=(int)540, format=(string)NV12, framerate=(fraction)30/1 were not compatible with: video/x-raw, width=(int)960, height=(int)540, format=(string)NV12, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string){ 1:4:7:1, bt601, smpte240m, bt709, 2:4:5:2, 2:4:5:3, 2:4:7:1, 2:4:12:8, bt2020, 2:0:0:0 }
    0:00:00.549531570 24166 0xaaab025429e0 WARN           basetransform gstbasetransform.c:1370:gst_base_transform_setcaps:<capsfilter1> transform could not transform video/x-raw, format=(string)NV12, width=(int)960, height=(int)540, framerate=(fraction)30/1 in anything we support
    0:00:00.549640625 24166 0xaaab025429e0 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
    0:00:00.549684175 24166 0xaaab025429e0 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Execution ended after 0:00:00.413047580
    Setting pipeline to NULL ...
    0:00:00.550920780 24166 0xaaab025429e0 WARN                GST_CAPS gstpad.c:3235:gst_pad_query_accept_caps_default:<v4l2jpegenc0:sink> caps: video/x-raw, width=(int)960, height=(int)540, format=(string)NV12, framerate=(fraction)30/1 were not compatible with: video/x-raw, width=(int)960, height=(int)540, format=(string)NV12, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string){ 1:4:7:1, bt601, smpte240m, bt709, 2:4:5:2, 2:4:5:3, 2:4:7:1, 2:4:12:8, bt2020, 2:0:0:0 }
    0:00:00.551184075 24166 0xaaab025429e0 WARN           basetransform gstbasetransform.c:1370:gst_base_transform_setcaps:<capsfilter1> transform could not transform video/x-raw, format=(string)NV12, width=(int)960, height=(int)540, framerate=(fraction)30/1 in anything we support
    Freeing pipeline ...
     10246.670827 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:110] De-Initialization Done for HOST !!!
     10246.676034 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    DDR_SHARED_MEM: Alloc's: 7 alloc's of 5443272 bytes 
    DDR_SHARED_MEM: Free's : 7 free's  of 5443272 bytes 
    DDR_SHARED_MEM: Open's : 0 allocs  of 0 bytes 
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!
    

  • Osman,

    Give me a day to respond, I will try on my AM62A board tomorrow and see why it is not working? I am assuming you are using the latest 9.1 SDK release to test correct?

    It was working as we have published the pipelines with our SDK offering:

    https://software-dl.ti.com/processor-sdk-linux/esd/AM62AX/09_01_00/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/E5010_JPEG_Encoder.html

    Best Regards,

    Suren

  • I got the pipeline to play and was able to view it via rtsp stream in VLC. The final hurdle was shutting off the iptables daemon that our system runs as it was blocking outbound tcp traffic on port 554.

    I'm currently trying to figure out why I can't use tiovxdlcolorconvert - my pipeline still only works w/ videoconvert which is slow and has problems w/ resolutions larger than 480.