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: Error in generating the bin file for 4k resolution and running a simple gstreamer pipeline

Part Number: SK-AM62A-LP

Tool/software:

Hello Expert,
I am trying to get 4k resolution video output from using IMX219 cam connected to am62a via arducam v3 link adapter board.
When I try to check the 4k bin files in /opt/imaging/imx219/linear/ seems it is not there. So tried to create bin file using: https://git.ti.com/cgit/processor-sdk/imaging/tree/tools/default_DCC_profile_gen?h=main&id=51cbaf49d1102de1a7a9980258f66c958aad8c7e .By changing the config file width and height. Generated a folder named IMX219  output. There seems a shell script and after its run. Got 3 files dcc_2a.bin,  dcc_ldc.bin,  dcc_viss.bin and it will copied to the evm. Below is the terminal print of generate_dcc.sh shell script (seems some errors).

$ ./generate_dcc.sh 
Parsing:	[imx219_rgb2rgb_dcc.xml]                                  [OK!]
Generating CRC: [18F10844]                                                [OK!]
Generating BIN file...                                                    [OK!]
Parsing:	[imx219_h3a_aewb_dcc.xml]                                 [OK!]
Generating CRC: [D0295AD2]                                                [OK!]
Generating BIN file...                                                    [OK!]
Parsing:	[imx219_viss_nsf4.xml]                                    [OK!]
Generating CRC: [41DA95E1]                                                [OK!]
Generating BIN file...                                                    [OK!]
Parsing:	[imx219_viss_blc.xml]                                     [OK!]
Generating CRC: [3C7EA53F]                                                [OK!]
Generating BIN file...                                                    [OK!]
Parsing:	[imx219_cfa_dcc.xml]                                      [OK!]
Generating CRC: [31358E23]                                                [OK!]
Generating BIN file...                                                    [OK!]
Parsing:	[imx219_viss_gamma_dcc.xml]                               [OK!]
Generating CRC: [AC9866FF]                                                [OK!]
Generating BIN file...                                                    [OK!]
Parsing:	[imx219_linear_decompand_dcc.xml]                         [OK!]
Generating CRC: [DC5E70D]                                                 [OK!]
Generating BIN file...                                                    [OK!]
Parsing:	[imx219_h3a_mux_luts_dcc.xml]                             [OK!]
Generating CRC: [C5BE9ED1]                                                [OK!]
Generating BIN file...                                                    [OK!]
../../dcc_bins/dcc_viss.bin ../../../../include/dcc_viss_imx219.h dcc_viss_imx219

 Converting binary file [../../dcc_bins/dcc_viss.bin] to C array 
 ERROR: Output file [../../../../include/dcc_viss_imx219.h] ./generate_dcc.sh: line 34: 740060 Segmentation fault      (core dumped) $DCC_TOOL_PATH/dcc_bin2c ../../dcc_bins/dcc_viss.bin $OUT_PATH/dcc_viss_imx219.h dcc_viss_imx219


Parsing:	[imx219_awb_alg_ti3_tuning.xml]                           [OK!]
Generating CRC: [184E603C]                                                [OK!]
Generating BIN file...                                                    [OK!]
Parsing:	[imx219_h3a_aewb_dcc.xml]                                 [OK!]
Generating CRC: [D0295AD2]                                                [OK!]
Generating BIN file...                                                    [OK!]
../../dcc_bins/dcc_2a.bin ../../../../include/dcc_2a_imx219.h dcc_2a_imx219

 Converting binary file [../../dcc_bins/dcc_2a.bin] to C array 
 ERROR: Output file [../../../../include/dcc_2a_imx219.h] ./generate_dcc.sh: line 42: 740068 Segmentation fault      (core dumped) $DCC_TOOL_PATH/dcc_bin2c ../../dcc_bins/dcc_2a.bin $OUT_PATH/dcc_2a_imx219.h dcc_2a_imx219


Parsing:	[imx219_mesh_ldc_dcc.xml]                                 [OK!]
Generating CRC: [C5D5EAA1]                                                [OK!]
Generating BIN file...                                                    [OK!]
../../dcc_bins/dcc_ldc.bin ../../../../include/dcc_ldc_imx219.h dcc_ldc_imx219

 Converting binary file [../../dcc_bins/dcc_ldc.bin] to C array 
 ERROR: Output file [../../../../include/dcc_ldc_imx219.h] ./generate_dcc.sh: line 49: 740075 Segmentation fault      (core dumped) $DCC_TOOL_PATH/dcc_bin2c ../../dcc_bins/dcc_ldc.bin $OUT_PATH/dcc_ldc_imx219.h dcc_ldc_imx219

I checked if it works through running a simple gstreamer pipeline. Seems some error associated with memory allocation.

APP: Init ... !!!
 34954.344946 s: MEM: Init ... !!!
 34954.345002 s: MEM: Initialized DMA HEAP (fd=8) !!!
 34954.345138 s: MEM: Init ... Done !!!
 34954.345150 s: IPC: Init ... !!!
 34954.362748 s: IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
 34954.366878 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
 34954.366992 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_ERROR
 34954.367005 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_WARNING
 34954.367016 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_INFO
 34954.367827 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-0 
 34954.368120 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-1 
 34954.368372 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-2 
 34954.368599 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-3 
 34954.368634 s:  VX_ZONE_INFO: [tivxInitLocal:126] Initialization Done !!!
 34954.368646 s:  VX_ZONE_INFO: Globally Disabled VX_ZONE_INFO
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
/usr/src/debug/gstreamer1.0-plugins-good/1.22.12/sys/v4l2/gstv4l2src.c(950): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.012682770
Setting pipeline to NULL ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
/usr/src/debug/gstreamer1.0/1.22.12/libs/gst/base/gstbasesrc.c(3134): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)

(gst-launch-1.0:1732): GStreamer-Video-CRITICAL **: 00:34:41.032: gst_video_info_from_caps: assertion 'caps != NULL' failed
ERROR: from element /GstPipeline:pipeline0/GstTIOVXISP:tiovxisp0: Unable to init TIOVX module
Additional debug info:
/usr/src/debug/edgeai-gst-plugins/1.0.0/gst-libs/gst/tiovx/gsttiovxmiso.c(1512): gst_tiovx_miso_negotiated_src_caps (): /GstPipeline:pipeline0/GstTIOVXISP:tiovxisp0
Freeing pipeline ...
 34954.420453 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffffaf987cf0 of type 00000817 at external count 1, internal count 0, releasing it
 34954.420485 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=raw_image_81) now as a part of garbage collection
 34954.420509 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffffafa2ac10 of type 00000813 at external count 1, internal count 0, releasing it
 34954.420522 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_82) now as a part of garbage collection
 34954.421280 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffffafa2adc0 of type 00000813 at external count 1, internal count 0, releasing it
 34954.421295 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_84) now as a part of garbage collection
 34954.422009 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffffafa2af70 of type 00000813 at external count 1, internal count 0, releasing it
 34954.422024 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_86) now as a part of garbage collection
 34954.422738 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffffafa2b120 of type 00000813 at external count 1, internal count 0, releasing it
 34954.422754 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_88) now as a part of garbage collection
 34954.423429 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffffafa2b2d0 of type 00000813 at external count 1, internal count 0, releasing it
 34954.423445 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_90) now as a part of garbage collection
 34954.424124 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffffafa2b480 of type 00000813 at external count 1, internal count 0, releasing it
 34954.424139 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_92) now as a part of garbage collection
APP: Deinit ... !!!
REMOTE_SERVICE: Deinit ... !!!
REMOTE_SERVICE: Deinit ... Done !!!
 34954.429794 s: IPC: Deinit ... !!!
 34954.431167 s: IPC: DeInit ... Done !!!
 34954.431215 s: MEM: Deinit ... !!!
 34954.431225 s: DDR_SHARED_MEM: Alloc's: 6 alloc's of 49766400 bytes 
 34954.431236 s: DDR_SHARED_MEM: Free's : 6 free's  of 49766400 bytes 
 34954.431246 s: DDR_SHARED_MEM: Open's : 0 allocs  of 0 bytes 
 34954.431261 s: MEM: Deinit ... Done !!!
APP: Deinit ... Done !!!


Please help me to fix the issue.

Warm Regards,
Sajan

  • Hi Sajan,

    I am trying to get 4k resolution video output from using IMX219 cam connected to am62a via arducam v3 link adapter board.

    Have you been able to get 1080p video from the existing DCC bin files?

    Below is the terminal print of generate_dcc.sh shell script (seems some errors).

    The segmentation fault is probably caused by wrong path for "PRJ_DIR" in the config file.This folder must be under imaging/sensor_srv/src, for example, ../../../sensor_drv/src/imx219_output. Please refer to the AM6xA ISP Tuning Guide:

    I checked if it works through running a simple gstreamer pipeline. Seems some error associated with memory allocation.

    Please regenerate the bin files after fixing the seg fault. You'll also need to configure all elements in the media device topology to be 4k resolution. Please refer to this FAQ: What are the common reasons V4L2 based applications fail to capture images from a probed CSI sensor?

    Regards,

    Jianzhong

  • Hi Jianzhong,

    Have you been able to get 1080p video from the existing DCC bin files?

    Yes.

    The segmentation fault is probably caused by wrong path for "PRJ_DIR" in the config file.This folder must be under imaging/sensor_srv/src, for example, ../../../sensor_drv/src/imx219_output.

    I successfully generated the bin file without any errors.

    $ ./generate_dcc.sh 
    Parsing:	[imx219_rgb2rgb_dcc.xml]                                  [OK!]
    Generating CRC: [18F10844]                                                [OK!]
    Generating BIN file...                                                    [OK!]
    Parsing:	[imx219_h3a_aewb_dcc.xml]                                 [OK!]
    Generating CRC: [D0295AD2]                                                [OK!]
    Generating BIN file...                                                    [OK!]
    Parsing:	[imx219_viss_nsf4.xml]                                    [OK!]
    Generating CRC: [41DA95E1]                                                [OK!]
    Generating BIN file...                                                    [OK!]
    Parsing:	[imx219_viss_blc.xml]                                     [OK!]
    Generating CRC: [3C7EA53F]                                                [OK!]
    Generating BIN file...                                                    [OK!]
    Parsing:	[imx219_cfa_dcc.xml]                                      [OK!]
    Generating CRC: [31358E23]                                                [OK!]
    Generating BIN file...                                                    [OK!]
    Parsing:	[imx219_viss_gamma_dcc.xml]                               [OK!]
    Generating CRC: [AC9866FF]                                                [OK!]
    Generating BIN file...                                                    [OK!]
    Parsing:	[imx219_linear_decompand_dcc.xml]                         [OK!]
    Generating CRC: [DC5E70D]                                                 [OK!]
    Generating BIN file...                                                    [OK!]
    Parsing:	[imx219_h3a_mux_luts_dcc.xml]                             [OK!]
    Generating CRC: [C5BE9ED1]                                                [OK!]
    Generating BIN file...                                                    [OK!]
    ../../dcc_bins/dcc_viss.bin ../../../../include/dcc_viss_imx219.h dcc_viss_imx219
    
     Converting binary file [../../dcc_bins/dcc_viss.bin] to C array .. Done. (19085 bytes)
    
    Parsing:	[imx219_awb_alg_ti3_tuning.xml]                           [OK!]
    Generating CRC: [184E603C]                                                [OK!]
    Generating BIN file...                                                    [OK!]
    Parsing:	[imx219_h3a_aewb_dcc.xml]                                 [OK!]
    Generating CRC: [D0295AD2]                                                [OK!]
    Generating BIN file...                                                    [OK!]
    ../../dcc_bins/dcc_2a.bin ../../../../include/dcc_2a_imx219.h dcc_2a_imx219
    
     Converting binary file [../../dcc_bins/dcc_2a.bin] to C array .. Done. (5826 bytes)
    
    Parsing:	[imx219_mesh_ldc_dcc.xml]                                 [OK!]
    Generating CRC: [C5D5EAA1]                                                [OK!]
    Generating BIN file...                                                    [OK!]
    ../../dcc_bins/dcc_ldc.bin ../../../../include/dcc_ldc_imx219.h dcc_ldc_imx219
    
     Converting binary file [../../dcc_bins/dcc_ldc.bin] to C array .. Done. (2326 bytes)
    
    


    Now I only changed the SENSOR_WIDTH, SENSOR_HEIGHT to 3840 and 2160 respectively. Is it fine. I mean the camera is perfectly working in 1080.


    Please regenerate the bin files after fixing the seg fault. You'll also need to configure all elements in the media device topology to be 4k resolution. Please refer to this FAQ: What are the common reasons V4L2 based applications fail to capture images from a probed CSI sensor?

    Will try to achieve it !

    Warm Regards,
    Sajan

  • Hello Jianzhong,

    Is it possible to run a 1080p video after setting up with 4k resolution. I can't do it. 
    Also can you please mention about the vertical and horizontal value ( After looking into the IMX219 maximum supported resolution in am62a, I setted it as 3264x2464 ) and created bin file.

    Then changed the code in script/setup_cameras_v3link.sh and sourced.

    IMX219_CAM_FMT="${IMX219_CAM_FMT:-[fmt:SRGGB10_1X10/3264x2464 field: none]}"

    terminal print after sourced is 

    root@am62axx-evm:/opt/edgeai-gst-apps# source scripts/setup_cameras_v3link.sh 
    IMX219 Camera 0 detected
        device = /dev/video-imx219-cam0
        name = imx219
        format = [fmt:SRGGB10_1X10/3264x2464 field: none]
        subdev_id = /dev/v4l-imx219-subdev0
        isp_required = yes
        ldc_required = yes
    IMX219 Camera 1 detected
        device = /dev/video-imx219-cam1
        name = imx219
        format = [fmt:SRGGB10_1X10/3264x2464 field: none]
        subdev_id = /dev/v4l-imx219-subdev1
        isp_required = yes
        ldc_required = yes
    

    Error log when streaming is below. 

    root@am62axx-evm:/opt/edgeai-gst-apps# gst-launch-1.0 \
    > v4l2src device=/dev/video-imx219-cam0 io-mode=5 ! queue max-size-buffers=1 leaky=2 ! video/x-bayer,width=3264,height=2464,framerate=20/1,format=rggb ! \
    > tiovxisp sink_0::device=/dev/v4l-imx219-subdev0 sensor-name=SENSOR_SONY_IMX219_RPI dcc-isp-file=/opt/imaging/imx219/linear/dcc_viss_3264x2464.bin \
    > sink_0::dcc-2a-file=/opt/imaging/imx219/linear/dcc_2a_3264x2464.bin format-msb=8 ! \
    > video/x-raw,format=NV12, width=3264,height=2464 ! queue ! mosaic.sink_0 \
    > tiovxmosaic name=mosaic \
    > sink_0::startx="<0>" sink_0::starty="<0>" sink_0::widths="<640>" sink_0::heights="<480>" ! \
    > queue ! video/x-raw, width=1920, height=1080 ! queue ! kmssink driver-name=tidss sync=false force-modesetting=true
    APP: Init ... !!!
     26385.142192 s: MEM: Init ... !!!
     26385.142268 s: MEM: Initialized DMA HEAP (fd=8) !!!
     26385.142440 s: MEM: Init ... Done !!!
     26385.142456 s: IPC: Init ... !!!
     26385.159872 s: IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
     26385.164639 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
     26385.164774 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_ERROR
     26385.164794 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_WARNING
     26385.164803 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_INFO
     26385.166076 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-0 
     26385.166978 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-1 
     26385.167341 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-2 
     26385.168156 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-3 
     26385.168332 s:  VX_ZONE_INFO: [tivxInitLocal:126] Initialization Done !!!
     26385.168433 s:  VX_ZONE_INFO: Globally Disabled VX_ZONE_INFO
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
    Additional debug info:
    /usr/src/debug/gstreamer1.0-plugins-good/1.22.12/sys/v4l2/gstv4l2src.c(950): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    Buffer pool activation failed
    Execution ended after 0:00:00.012753050
    Setting pipeline to NULL ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    /usr/src/debug/gstreamer1.0/1.22.12/libs/gst/base/gstbasesrc.c(3134): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    
    (gst-launch-1.0:2029): GStreamer-Video-CRITICAL **: 12:00:18.145: gst_video_info_from_caps: assertion 'caps != NULL' failed
    ERROR: from element /GstPipeline:pipeline0/GstTIOVXISP:tiovxisp0: Unable to init TIOVX module
    Additional debug info:
    /usr/src/debug/edgeai-gst-plugins/1.0.0/gst-libs/gst/tiovx/gsttiovxmiso.c(1512): gst_tiovx_miso_negotiated_src_caps (): /GstPipeline:pipeline0/GstTIOVXISP:tiovxisp0
    Freeing pipeline ...
     26385.363405 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8a927cf0 of type 00000817 at external count 1, internal count 0, releasing it
     26385.363451 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=raw_image_81) now as a part of garbage collection
     26385.363474 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8a9cac10 of type 00000813 at external count 1, internal count 0, releasing it
     26385.363488 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_82) now as a part of garbage collection
     26385.364253 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8a9cadc0 of type 00000813 at external count 1, internal count 0, releasing it
     26385.364276 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_84) now as a part of garbage collection
     26385.365049 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8a9caf70 of type 00000813 at external count 1, internal count 0, releasing it
     26385.365073 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_86) now as a part of garbage collection
     26385.365777 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8a9cb120 of type 00000813 at external count 1, internal count 0, releasing it
     26385.365797 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_88) now as a part of garbage collection
     26385.366484 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8a9cb2d0 of type 00000813 at external count 1, internal count 0, releasing it
     26385.366502 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_90) now as a part of garbage collection
     26385.367185 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8a9cb480 of type 00000813 at external count 1, internal count 0, releasing it
     26385.367202 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_92) now as a part of garbage collection
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
     26385.372934 s: IPC: Deinit ... !!!
     26385.373537 s: IPC: DeInit ... Done !!!
     26385.373587 s: MEM: Deinit ... !!!
     26385.373599 s: DDR_SHARED_MEM: Alloc's: 6 alloc's of 48254976 bytes 
     26385.373608 s: DDR_SHARED_MEM: Free's : 6 free's  of 48254976 bytes 
     26385.373616 s: DDR_SHARED_MEM: Open's : 0 allocs  of 0 bytes 
     26385.373630 s: MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!
    

    Warm Regards,
    Sajan

  • Hello Sajan,

    I saw you have "format=rggb" in your pipeline. You should use "format=rggb10" because your sensor format is SRGGB10_1X10/3264x2464.

    Regards,

    Jianzhong

  • Hello Jianzhong,

    By making bin files for 3280x2464. I got the output. But seems change in format. I mean the output seems grayscale or something like no RGB.
    and also this seems low quality. 1 minute video only seems 2MB.

    Pipeline I used is below.

    gst-launch-1.0 -e \
    v4l2src device=/dev/video-imx219-cam1 io-mode=5 ! \
    video/x-bayer,width=3280,height=2464,framerate=15/1,format=rggb10 ! \
    tiovxisp sink_0::device=/dev/v4l-imx219-subdev1 sensor-name=SENSOR_SONY_IMX219_RPI \
    dcc-isp-file=/opt/imaging/imx219/linear/dcc_viss_3280x2464_10b.bin \
    sink_0::dcc-2a-file=/opt/imaging/imx219/linear/dcc_2a_3280x2464_10b.bin format-msb=8 ! \
    video/x-raw, format=NV12, width=3280, height=2464, framerate=20/1 ! \
    tiovxmosaic name=mosaic \
    sink_0::startx=0 sink_0::starty=0 sink_0::widths=3280 sink_0::heights=2464 ! \
    video/x-raw, format=NV12, width=3280, height=2464, framerate=20/1 ! \
    v4l2h264enc ! h264parse ! mp4mux ! \
    filesink location=/opt/video.mp4
    Warm Regards,
    Sajan
  • Hi Sajan,

    Yes, providing wrong resolution makes the pipeline not work. I don't see your pipeline in your post.

    I've tested this resolution and below pipeline worked for me:

    gst-launch-1.0 v4l2src device=/dev/video-imx219-cam0 io-mode=dmabuf-import ! queue max-size-buffers=1 leaky=2 ! \
    video/x-bayer, width=3280, height=2464, framerate=15/1, format=rggb10 ! \
    tiovxisp sink_0::pool-size=4  sink_0::device=/dev/v4l-imx219-subdev0 sensor-name="SENSOR_SONY_IMX219_RPI" \
    dcc-isp-file=$1/dcc_viss.bin \
    sink_0::dcc-2a-file=$1/dcc_2a.bin format-msb=9 ! \
    video/x-raw, format=NV12, width=3280, height=2464, framerate=15/1 ! queue ! tiovxmultiscaler ! queue ! \
    video/x-raw, format=NV12, width=1920, height=1080, framerate=15/1 !  \
    kmssink driver-name=tidss sync=false force-modesetting=true 
    

    Regards,

    Jianzhong

  • Hello Jianzhong,

    Sorry for missing the pipeline.

    I used pipeline

    gst-launch-1.0 -e \
    v4l2src device=/dev/video-imx219-cam1 io-mode=5 ! \
    video/x-bayer,width=3280,height=2464,framerate=15/1,format=rggb10 ! \
    tiovxisp sink_0::device=/dev/v4l-imx219-subdev1 sensor-name=SENSOR_SONY_IMX219_RPI \
        dcc-isp-file=/opt/imaging/imx219/linear/dcc_viss_3280x2464_10b.bin \
        sink_0::dcc-2a-file=/opt/imaging/imx219/linear/dcc_2a_3280x2464_10b.bin format-msb=8 ! \
    video/x-raw, format=NV12, width=3280, height=2464, framerate=20/1 ! \
    tiovxmosaic name=mosaic \
    sink_0::startx=0 sink_0::starty=0 sink_0::widths=3280 sink_0::heights=2464 ! \
    video/x-raw, format=NV12, width=3280, height=2464, framerate=20/1 ! \
    v4l2h264enc ! h264parse ! mp4mux ! \
    filesink location=/opt/video.mp4

    seems very low file size, and color. seems grayscale or something like that.1 minute video only seems 2MB



     I tried 4k recording with 2 camera of frame rate 15. But seems errors

    gst-launch-1.0 \
    v4l2src device=/dev/video-imx219-cam0 io-mode=5 ! queue max-size-buffers=1 leaky=2 ! video/x-bayer,width=3280,height=2464,framerate=15/1,format=rggb10 ! \
    tiovxisp sink_0::device=/dev/v4l-imx219-subdev0 sensor-name=SENSOR_SONY_IMX219_RPI dcc-isp-file=/opt/imaging/imx219/linear/dcc_viss_3280x2464_10b.bin \
    sink_0::dcc-2a-file=/opt/imaging/imx219/linear/dcc_2a_3280x2464_10b.bin format-msb=8 ! \
    video/x-raw,format=NV12, width=3280,height=2464 ! queue ! mosaic.sink_0 \
    v4l2src device=/dev/video-imx219-cam1 io-mode=5 ! queue max-size-buffers=1 leaky=2 ! video/x-bayer,width=3280,height=2464,framerate=15/1,format=rggb10 ! \
    tiovxisp sink_0::device=/dev/v4l-imx219-subdev1 sensor-name=SENSOR_SONY_IMX219_RPI dcc-isp-file=/opt/imaging/imx219/linear/dcc_viss_3280x2464_10b.bin \
    sink_0::dcc-2a-file=/opt/imaging/imx219/linear/dcc_2a_3280x2464_10b.bin format-msb=8 ! \
    video/x-raw,format=NV12, width=3280,height=2464 ! queue ! mosaic.sink_1 \
    tiovxmosaic name=mosaic \
    sink_0::startx="<0>" sink_0::starty="<0>" sink_0::widths="<640>" sink_0::heights="<480>" \
    sink_1::startx="<0>" sink_1::starty="<480>" sink_1::widths="<640>" sink_1::heights="<480>" ! \
    queue ! video/x-raw, width=1920, height=1080 ! queue ! kmssink driver-name=tidss sync=false force-modesetting=true

    APP: Init ... !!!
     30709.296138 s: MEM: Init ... !!!
     30709.296196 s: MEM: Initialized DMA HEAP (fd=8) !!!
     30709.296342 s: MEM: Init ... Done !!!
     30709.296354 s: IPC: Init ... !!!
     30709.313874 s: IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
     30709.318282 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
     30709.318397 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_ERROR
     30709.318413 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_WARNING
     30709.318425 s:  VX_ZONE_INFO: Globally Enabled VX_ZONE_INFO
     30709.319332 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-0 
     30709.319618 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-1 
     30709.319882 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-2 
     30709.320120 s:  VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-3 
     30709.320156 s:  VX_ZONE_INFO: [tivxInitLocal:126] Initialization Done !!!
     30709.320170 s:  VX_ZONE_INFO: Globally Disabled VX_ZONE_INFO
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
     30709.478152 s: MEM: ERROR: Alloc failed with status = 12 !!!
     30709.478204 s:  VX_ZONE_ERROR: [tivxMemBufferAlloc:111] Shared mem ptr allocation failed
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src1: Failed to allocate required memory.
    Additional debug info:
    /usr/src/debug/gstreamer1.0-plugins-good/1.22.12/sys/v4l2/gstv4l2src.c(950): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src1:
    Buffer pool activation failed
    Execution ended after 0:00:00.009035095
    Setting pipeline to NULL ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src1: Internal data stream error.
    Additional debug info:
    /usr/src/debug/gstreamer1.0/1.22.12/libs/gst/base/gstbasesrc.c(3134): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src1:
    streaming stopped, reason not-negotiated (-4)
     30709.482227 s: MEM: ERROR: Alloc failed with status = 12 !!!
     30709.482288 s:  VX_ZONE_ERROR: [tivxMemBufferAlloc:111] Shared mem ptr allocation failed
     30709.482301 s:  VX_ZONE_ERROR: [ownAllocRawImageBuffer:359] could not allocate memory
     30709.482313 s:  VX_ZONE_ERROR: [ownGraphAllocateDataObject:1109] Memory allocation for replicated parameter parent object failed
     30709.482328 s:  VX_ZONE_ERROR: [ graph_107 ] Memory alloc for data objects failed
     30709.482339 s:  VX_ZONE_ERROR: [ graph_107 ] Graph verify failed
     30709.482834 s:  VX_ZONE_ERROR: [ownReleaseReferenceInt:747] Invalid reference
    ERROR: from element /GstPipeline:pipeline0/GstTIOVXISP:tiovxisp1: Unable to init TIOVX module
    Additional debug info:
    /usr/src/debug/edgeai-gst-plugins/1.0.0/gst-libs/gst/tiovx/gsttiovxmiso.c(1512): gst_tiovx_miso_negotiated_src_caps (): /GstPipeline:pipeline0/GstTIOVXISP:tiovxisp1
    Freeing pipeline ...
     30709.640231 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8975adc0 of type 00000813 at external count 1, internal count 0, releasing it
     30709.640272 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_84) now as a part of garbage collection
     30709.641680 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8975b120 of type 00000813 at external count 1, internal count 0, releasing it
     30709.641699 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_89) now as a part of garbage collection
     30709.643093 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8975b480 of type 00000813 at external count 1, internal count 0, releasing it
     30709.643117 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_93) now as a part of garbage collection
     30709.644441 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8975b7e0 of type 00000813 at external count 1, internal count 0, releasing it
     30709.644458 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_97) now as a part of garbage collection
     30709.645754 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8975bb40 of type 00000813 at external count 1, internal count 0, releasing it
     30709.645770 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_101) now as a part of garbage collection
     30709.647143 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff896aa970 of type 00000816 at external count 1, internal count 0, releasing it
     30709.647162 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=user_data_object_105) now as a part of garbage collection
     30709.647218 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff896aaba0 of type 00000816 at external count 1, internal count 0, releasing it
     30709.647232 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=user_data_object_106) now as a part of garbage collection
     30709.647280 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8975bea0 of type 00000813 at external count 1, internal count 0, releasing it
     30709.647293 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_108) now as a part of garbage collection
     30709.647313 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff896ab000 of type 00000816 at external count 1, internal count 0, releasing it
     30709.647326 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=user_data_object_109) now as a part of garbage collection
     30709.647344 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8975c050 of type 00000813 at external count 1, internal count 0, releasing it
     30709.647356 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_110) now as a part of garbage collection
     30709.647375 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff896b9ce0 of type 00000817 at external count 1, internal count 0, releasing it
     30709.647388 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=raw_image_111) now as a part of garbage collection
     30709.647406 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8975c200 of type 00000813 at external count 1, internal count 0, releasing it
     30709.647419 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_112) now as a part of garbage collection
     30709.647437 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff896ab230 of type 00000816 at external count 1, internal count 0, releasing it
     30709.647449 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=user_data_object_113) now as a part of garbage collection
     30709.647468 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff8975c3b0 of type 00000813 at external count 1, internal count 0, releasing it
     30709.647480 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=object_array_114) now as a part of garbage collection
     30709.979119 s:  VX_ZONE_WARNING: [vxReleaseContext:1275] Found a reference 0xffff896de340 of type 0000080f at external count 1, internal count 0, releasing it
     30709.979144 s:  VX_ZONE_WARNING: [vxReleaseContext:1277] Releasing reference (name=image_115) now as a part of garbage collection
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
     30709.984488 s: IPC: Deinit ... !!!
     30709.984998 s: IPC: DeInit ... Done !!!
     30709.985037 s: MEM: Deinit ... !!!
     30709.985147 s: DDR_SHARED_MEM: Alloc's: 23 alloc's of 178199718 bytes 
     30709.985167 s: DDR_SHARED_MEM: Free's : 23 free's  of 178199718 bytes 
     30709.985177 s: DDR_SHARED_MEM: Open's : 0 allocs  of 0 bytes 
     30709.985193 s: MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!

    BR,
    Sajan