Coder Social home page Coder Social logo

gst-nvmanualcamerasrc's Introduction

Hi there πŸ‘‹

  • πŸ”­ I’m currently working on a Rust collaborative writing app featuring generative AI.
  • πŸ‘― I’m looking to collaborate on anything Rust and/or generative AI related.
  • πŸ“« How to reach me: [email protected]
  • πŸ˜„ Pronouns: he/him

gst-nvmanualcamerasrc's People

Contributors

kay0u avatar mdegans avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gst-nvmanualcamerasrc's Issues

Using nvarguscamerasrc in conda environment?

Hey @mdegans,

thanks for putting so much effort into ensuring people to get access to machine vision on the Jetson!
I've succesfully used your script to install opencv in a miniforge environment and face an issue when trying to access the camera. I think I'm very close, but there is one last error when executing the following line:

mypipeline = "nvarguscamerasrc sensor-id=0 !video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1 ! nvvidconv flip-method=0 ! video/x-raw, width=(int)960, height=(int)540, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink"
cv2.VideoCapture(mypipeline, cv2.CAP_GSTREAMER)

It gives the following error:

[ WARN:0] global /home/uc2/Downloads/opencv-4.5.2/modules/videoio/src/cap_gstreamer.cpp (854) open OpenCV | GStreamer warning: Error opening bin: no element "nvarguscamerasrc"
[ WARN:0] global /home/uc2/Downloads/opencv-4.5.2/modules/videoio/src/cap_gstreamer.cpp (597) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Error: Unable to open camera

gstreamer should be installed properly and the shared library created with tis script is linked properly (at least it installed).. Did I miss anything? In the non pyhton environment python it works just fine. Same as in the terminal.

>>> cv2.getBuildInformation()
'\nGeneral configuration for OpenCV 4.5.2 =====================================\n  Version control:               unknown\n\n  Platform:\n    Timestamp:                   2022-01-25T22:14:52Z\n    Host:                        Linux 4.9.253-tegra aarch64\n    CMake:                       3.10.2\n    CMake generator:             Unix Makefiles\n    CMake build tool:            /usr/bin/make\n    Configuration:               RELEASE\n\n  CPU/HW features:\n    Baseline:                    NEON FP16\n\n  C/C++:\n    Built as dynamic libs?:      YES\n    C++ standard:                11\n    C++ Compiler:                /usr/bin/c++  (ver 7.5.0)\n    C++ flags (Release):         -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG\n    C++ flags (Debug):           -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG\n    C Compiler:                  /usr/bin/cc\n    C flags (Release):           -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG\n    C flags (Debug):             -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG\n    Linker flags (Release):      -Wl,--gc-sections -Wl,--as-needed  \n    Linker flags (Debug):        -Wl,--gc-sections -Wl,--as-needed  \n    ccache:                      NO\n    Precompiled headers:         NO\n    Extra dependencies:          dl m pthread rt\n    3rdparty dependencies:\n\n  OpenCV modules:\n    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching ts video videoio\n    Disabled:                    world\n    Disabled by dependency:      -\n    Unavailable:                 java python2\n    Applications:                tests perf_tests examples apps\n    Documentation:               NO\n    Non-free algorithms:         YES\n\n  GUI: \n    GTK+:                        NO\n    OpenGL support:              NO\n    VTK support:                 NO\n\n  Media I/O: \n    ZLib:                        /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)\n    JPEG:                        /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)\n    WEBP:                        build (ver encoder: 0x020f)\n    PNG:                         /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.34)\n    TIFF:                        /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.0.9)\n    JPEG 2000:                   build (ver 2.4.0)\n    OpenEXR:                     build (ver 2.3.0)\n    HDR:                         YES\n    SUNRASTER:                   YES\n    PXM:                         YES\n    PFM:                         YES\n\n  Video I/O:\n    DC1394:                      NO\n    FFMPEG:                      YES\n      avcodec:                   YES (57.107.100)\n      avformat:                  YES (57.83.100)\n      avutil:                    YES (55.78.100)\n      swscale:                   YES (4.8.100)\n      avresample:                YES (3.7.0)\n    GStreamer:                   YES (1.14.5)\n    v4l/v4l2:                    YES (linux/videodev2.h)\n\n  Parallel framework:            TBB (ver 2017.0 interface 9107)\n\n  Trace:                         YES (with Intel ITT)\n\n  Other third-party libraries:\n    Lapack:                      NO\n    Eigen:                       YES (ver 3.3.4)\n    Custom HAL:                  YES (carotene (ver 0.0.1))\n    Protobuf:                    build (3.5.1)\n\n  OpenCL:                        YES (no extra features)\n    Include path:                /home/uc2/Downloads/opencv-4.5.2/3rdparty/include/opencl/1.2\n    Link libraries:              Dynamic load\n\n  Python 3:\n    Interpreter:                 /home/uc2/miniforge3/envs/imswitch/bin/python3 (ver 3.7.12)\n    Libraries:                   /home/uc2/miniforge3/envs/imswitch/lib/libpython3.7m.so (ver 3.7.12)\n    numpy:                       /home/uc2/miniforge3/envs/imswitch/lib/python3.7/site-packages/numpy/core/include (ver 1.21.5)\n    install path:                /home/uc2/miniforge3/envs/imswitch/lib/python3.7/site-packages/cv2/python-3.7\n\n  Python (for build):            /home/uc2/miniforge3/envs/imswitch/bin/python3\n\n  Java:                          \n    ant:                         NO\n    JNI:                         NO\n    Java wrappers:               NO\n    Java tests:                  NO\n\n  Install to:                    /home/uc2/miniforge3/envs/imswitch\n-----------------------------------------------------------------\n\n'

Error: `STOPPING:because:"err" returned code:8`

On repeated runs, camera stalls here:

0:00:48.845939027  9224   0x7f50018990 INFO    nvmanualcamerasrc:producer producer.cpp:227:producer: 4032 x 3040 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 11000, max 500000000;
0:00:48.846963741  9224   0x7f50018990 INFO    nvmanualcamerasrc:producer producer.cpp:227:producer: 1920 x 1080 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 11000, max 500000000;
0:00:48.847776429  9224   0x7f50018990 INFO    nvmanualcamerasrc:producer producer.cpp:393:producer: Running with following settings:
   Camera index = 0 
   Camera mode  = 0 
   Output Stream W = 4032 H = 3040 
   seconds to Run    = 1 
   Frame Rate = 29.999999
0:00:48.848100171  9224   0x7f50018990 INFO    nvmanualcamerasrc:producer producer.cpp:476:producer: Setup Complete, Starting captures for 1 seconds
0:00:48.848132306  9224   0x7f50018990 INFO    nvmanualcamerasrc:producer producer.cpp:478:producer: Starting repeat capture requests.
0:00:48.881605280  9224   0x7f34001c00 INFO    nvmanualcamerasrc:consumer consumer.cpp:67:threadExecute: Producer has connected; continuing.
0:00:48.881806733  9224   0x7f50018990 ERROR   nvmanualcamerasrc:producer producer.cpp:488:producer: InvalidState.
0:00:48.885512944  9224   0x7f50018990 INFO    nvmanualcamerasrc:producer producer.cpp:502:producer: Cleaning up
0:00:49.410684487  9224   0x7f34001c00 ERROR   nvmanualcamerasrc:consumer consumer.cpp:93:threadExecute: STOPPING:because:"err" returned code:8

Argus daemon is left in a bad state as well which is really not hard. Almost any use outside the official examples will break it.

Lines 90-96 in question:

  while (true) {
    UniqueObj<Frame> frame(
        iFrameConsumer->acquireFrame(Argus::TIMEOUT_INFINITE, &err));
    NONZERO_STOP_SRC(err); // sets src->stop_requested = true
    if (src->stop_requested == TRUE) {
      break;
    }

Which breaks out of the loop and runs:

  g_slice_free(NvManualFrameInfo, src->frameInfo);
  if (!src->in_error) {
    GST_INFO("Done Success");
  }
  PROPAGATE_ERROR(requestShutdown());
  return true;

In the original code, error is not checked for (IIRC), but frame is checked for null, then this is run:

      g_mutex_lock(&src->manual_buffers_queue_lock);
      STOP_SRC("Could not acquireFrame");
      g_mutex_unlock(&src->manual_buffers_queue_lock);
      break;

Error also happens on first shutdown:

0:00:15.454652664 10009   0x5555a16320 INFO    nvmanualcamerasrc:producer producer.cpp:502:producer: Cleaning up
0:00:15.456752371 10009   0x7f4c002330 ERROR   nvmanualcamerasrc:consumer consumer.cpp:93:threadExecute: STOPPING:because:"err" returned code:8

Appears shutdown logic may need re-examination. Probably just using the snippet above will resolve it. Should add start & stop stress test to see if the camera source and/or daemon break.

FPS defaulting is problematic

The way the default frame rate is set is problematic.

const int DEFAULT_FPS = 21;       // mostly ignored, deprecated
const int DEFAULT_HEIGHT = 1080;  // mostly ignored, deprecated
const int DEFAULT_WIDTH = 1920;   // mostly ignored, deprecated

All need to go. This is bad design and inflexible when new sensors are used.

Proposed solution: default to camera mode 0

Auto-gain is still enabled somehow

The camera is still adjusting gain on it's own, leading to innacurate repeat captures. This was first observed by Indra and I during integration testing, and again by @lackdaz while testing the eyescan app.

While working on #9 , I'm going to double check any auto-gain code to ensure it's disabled. It may be there's a problem with property setting. It also may be libArgus does not always respect a gain range set to (1.0, 1.0).

In the latter case, we'll have to file a bug with Nvidia and work around it by checking the gain every frame and re-setting it, or re-setting it on every frame no matter what. There are probably some minor performance implications there.

gst-inspect help is confusing

  • minimum/maximum range values are not specified
  • it's not clear what some properties do without reading the source
  • split string range properties into min/max uints

Building with deep stream 6.1

Hi , does anyone know an updated version for building this with deepstream version 6.1?

Seems there was a big refactor in the code from 5.0 and 6.1

Thus this doesn’t build on the newer version

use standard GST_DEBUG macros

GST_DEBUG macros are the standard but somebody decided to use printf and the like instead, leading to console spew with every app using the argus source. Some such statements have already been removed but a few still need to be hunted down.

Unable to set camera properties using g_object_set

Steps to reproduce error

Setting digitalgain and gain in test/exitcode/test_ptzf.cpp:

g_object_set(camera, "digitalgain", 1.0, NULL);
g_object_set(camera, "gain", 4.0, NULL);

Message log

nvbuf_utils: Could not get EGL display connection
[2021-04-05 14:09:33.524073] [0x0000007fa15d7010] [debug]   Opening: /dev/MCB
[2021-04-05 14:09:33.524860] [0x0000007fa15d7010] [debug]   Opened: /dev/MCB
[2021-04-05 14:09:33.525105] [0x0000007fa15d7010] [debug]   Baud set: 115200
[2021-04-05 14:09:33.525188] [0x0000007fa15d7010] [debug]   Speed set: 2400mm/min
[2021-04-05 14:09:33.525239] [0x0000007fa15d7010] [debug]   G28 Auto Home set
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
(NvCamV4l2) Error ModuleNotPresent: V4L2Device not available (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function findDevice(), line 256)
(NvCamV4l2) Error ModuleNotPresent:  (propagating from /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function initialize(), line 60)
(NvOdmDevice) Error ModuleNotPresent:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 106)
NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
NvPclStartPlatformDrivers: Failed to start module drivers
NvPclStateControllerOpen: Failed ImagerGUID 0. (error 0xA000E)
NvPclOpen: PCL Open Failed. Error: 0xf
SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 582)
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 437)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 295)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function getSource(), line 458)
Acquiring SCF Camera device source via index 1 has failed. CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
[2021-04-05 14:09:36.217796] [0x0000007f7b5a71d0] [debug]   send:G0 X16.000 Y26.000 Z0.000 E2.000
[2021-04-05 14:09:36.218486] [0x0000007f7b5a71d0] [debug]   send:M400
[2021-04-05 14:09:36.218837] [0x0000007f7b5a71d0] [debug]   Waiting for "ok"
[2021-04-05 14:09:36.219217] [0x0000007f7b5a71d0] [debug]   recv:ok P63 B30

isp error `... Error BadParameter ...`

Works on one nano but not another. Issue occurs on both JetPack 4.4 and 4.5.

gst-launch-1.0 nvmanualcamerasrc ! autovideosink

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 460: Error: Bad parameter: "ae.CameraEfficiency=0.1508"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 473: Error: Bad parameter: "ae.MeanAlg.ConvergeSpeed=0.10"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 810: Error: Bad parameter: "awb.convergeSpeed=0.3"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3100: Error: Bad parameter: "af.alg.over_scan_percent=0.15"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3101: Error: Bad parameter: "af.alg.smooth_over_scan_percent=0.035"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3107: Error: Bad parameter: "af.alg.scene_change_t_guard_factor=0.30f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3108: Error: Bad parameter: "af.alg.scene_stable_sharpness=0.15f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3109: Error: Bad parameter: "af.alg.scene_change_sharpness=0.30f"
Motion points are not strictly ascending.NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 4524: Error: 11: "tnr.v1.consistencyPoints={0.00,0.25,0.50,0.75,1.00}"
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
(NvCamV4l2) Error ModuleNotPresent: V4L2Device not available (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function findDevice(), line 256)
(NvCamV4l2) Error ModuleNotPresent:  (propagating from /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function initialize(), line 60)
(NvOdmDevice) Error ModuleNotPresent:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 106)
NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
NvPclStartPlatformDrivers: Failed to start module drivers
NvPclStateControllerOpen: Failed ImagerGUID 0. (error 0xA000E)
NvPclOpen: PCL Open Failed. Error: 0xf
SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 582)
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 437)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 295)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function getSource(), line 458)
Acquiring SCF Camera device source via index 1 has failed. NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 460: Error: Bad parameter: "ae.CameraEfficiency=0.1508"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 473: Error: Bad parameter: "ae.MeanAlg.ConvergeSpeed=0.10"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 810: Error: Bad parameter: "awb.convergeSpeed=0.3"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3100: Error: Bad parameter: "af.alg.over_scan_percent=0.15"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3101: Error: Bad parameter: "af.alg.smooth_over_scan_percent=0.035"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3107: Error: Bad parameter: "af.alg.scene_change_t_guard_factor=0.30f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3108: Error: Bad parameter: "af.alg.scene_stable_sharpness=0.15f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3109: Error: Bad parameter: "af.alg.scene_change_sharpness=0.30f"
Motion points are not strictly ascending.NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 4524: Error: 11: "tnr.v1.consistencyPoints={0.00,0.25,0.50,0.75,1.00}"
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 95
        Invalid default value of type 'vec2'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 24:81: 

    <!-- Flow -->
    <flow operation='clone' operand0='inputImageY' operand1='outputImageY' opera
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/samples/deFog/StoreDeFog.cpp function create() line 66
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 15:57: 
    <node name='transmissionMap' file='networks/transmissionMapBlockYCbCr420.xml'/>
    <node name=
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/samples/deFog/StoreDeFog.cpp function create() line 66
        Out of memory
SCF: Error InsufficientMemory:  (propagating from src/components/stages/DeFogStage.cpp, function doAsyncInitialize(), line 91)
SCF: Error InsufficientMemory: DeFogStage initialization failed (in src/components/stages/DeFogStage.cpp, function doAsyncInitialize(), line 151)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 95
        Invalid default value of type 'vec2'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 22:81: 
    <attribute name='repetitions' type='parameter' dataType='uint' default='1'/>

    <!-- Flow -->
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/samples/deFog/StoreDeFog.cpp function create() line 66
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:53: 
    <node name="lowpass" file="filters/box3x3.xml"/>
    <node name="ltmFilter" file="filters/ltm.x
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:46: 

    <!-- Parameters -->
    <export name="Quality" from="ltm" attribute="quality" default="3" min=
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
SCF: Error InsufficientMemory:  (propagating from src/components/stages/AoltmStage.cpp, function doAsyncInitialize(), line 100)
SCF: Error InsufficientMemory: AoltmStage initialization failed (in src/components/stages/AoltmStage.cpp, function doAsyncInitialize(), line 130)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 95
        Invalid default value of type 'vec2'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 22:81: 
    <attribute name='repetitions' type='parameter' dataType='uint' default='1'/>

    <!-- Flow -->
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/samples/deFog/StoreDeFog.cpp function create() line 66
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:53: 
    <node name="lowpass" file="filters/box3x3.xml"/>
    <node name="ltmFilter" file="filters/ltm42
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:49: 

    <!-- Parameters -->
    <export name="Quality" from="ltm" attribute="quality" default="3" min=
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
SCF: Error InsufficientMemory:  (propagating from src/components/stages/HdfxStage.cpp, function doAsyncInitialize(), line 147)
SCF: Error InsufficientMemory: HdfxStage initialization failed (in src/components/stages/HdfxStage.cpp, function doAsyncInitialize(), line 252)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 115
        Invalid default value of type 'vec4'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 13:96: 

    <!-- Flow -->
    <flow operation="execute"/>
    <flow operation="detach" operand0="inputImag
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
SCF: Error InsufficientMemory:  (propagating from src/components/stages/SharpenStage.cpp, function doAsyncInitialize(), line 159)
SCF: Error InsufficientMemory: SharpenStage initialization failed (in src/components/stages/SharpenStage.cpp, function doAsyncInitialize(), line 182)
(Autocontrol) Error BadParameter: Invalid use or bad call parameters (in src/algorithms/blender/blender.cpp, function interpolateValInternal(), line 306)
(Autocontrol) Error BadParameter:  (propagating from src/algorithms/blender/blender.cpp, function NvIspParamBlenderInterpolateValue(), line 156)
(Camera_ISP) Error BadParameter:  (propagating from state_update/blocks/SAPOR.cpp, function NvCameraIspUpdateState_SAPOR_isp2(), line 50)
(Camera_ISP) Error BadParameter:  (propagating from state_update/nvcamera_isp_update_state.cpp, function NvCameraIspUpdateInputStateHw(), line 92)
SCF: Error BadParameter:  (propagating from src/services/autocontrol/NvCameraIspDriver.cpp, function generate(), line 1161)
SCF: Error BadParameter:  (propagating from src/components/ac_stages/AcMergeStage.cpp, function doHandleRequest(), line 84)
SCF: Error BadParameter:  (propagating from src/components/stages/OrderedStage.cpp, function doExecute(), line 158)
SCF: Error BadParameter: Sending critical error event (in src/api/Session.cpp, function sendErrorEvent(), line 990)
(Autocontrol) Error BadParameter: Invalid use or bad call parameters (in src/algorithms/blender/blender.cpp, function interpolateValInternal(), line 306)
(Autocontrol) Error BadParameter:  (propagating from src/algorithms/blender/blender.cpp, function NvIspParamBlenderInterpolateValue(), line 156)
(Camera_ISP) Error BadParameter:  (propagating from state_update/blocks/SAPOR.cpp, function NvCameraIspUpdateState_SAPOR_isp2(), line 50)
(Camera_ISP) Error BadParameter:  (propagating from state_update/nvcamera_isp_update_state.cpp, function NvCameraIspUpdateInputStateHw(), line 92)
SCF: Error BadParameter:  (propagating from src/services/autocontrol/NvCameraIspDriver.cpp, function generate(), line 1161)
SCF: Error BadParameter:  (propagating from src/components/ac_stages/AcMergeStage.cpp, function doHandleRequest(), line 84)
SCF: Error BadParameter:  (propagating from src/components/stages/OrderedStage.cpp, function doExecute(), line 158)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceEvent.cpp, function wait(), line 59)
Error: Camera HwEvents wait, this may indicate a hardware timeout occured,abort current/incoming cc
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:15.981591495
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
^C

This happens with some pipelines but not others. This test works perfectly:

  g_autoptr(GstElement) pipe = nullptr;
  GstElement* camera = nullptr;
  GstElement* ptzf = nullptr;
  GstElement* sink = nullptr;
  g_autoptr(GstBus) bus = nullptr;
  g_autoptr(GstMessage) msg = nullptr;
  g_autoptr(GMainLoop) loop = nullptr;

#ifdef HAS_FLASHFIRE
  // Create a flash. This turns on the NIR automatically, and unique_ptr will
  // call `flash_free` at the end of this scope.
  std::unique_ptr<flashfire::Flash, void (*)(flashfire::Flash*)> flash(
      flashfire::flash_new(0, 0, 2), flashfire::flash_free);
  if (!flash) {
    GST_WARNING("Flash could not be created. Likely bad chip/pin id.");
  }
#endif  // HAS_FLASHFIRE

  pipe = gst_pipeline_new("pipe");
  g_assert(pipe);
  camera = gst_element_factory_make("nvmanualcamerasrc", "camera");
  g_assert(camera);
  ptzf = gst_element_factory_make("ptzf", "ptzf");
  g_assert(ptzf);
  sink = gst_element_factory_make("autovideosink", "sink");
  g_assert(sink);

  for (auto e : {camera, ptzf, sink}) {
    g_assert(gst_bin_add(GST_BIN(pipe), e));
  }

  g_assert(gst_element_link_many(camera, ptzf, sink, nullptr));

  g_object_set(camera, "metadata", true, nullptr);
  g_object_set(camera, "bayer-sharpness-map", true, nullptr);
  g_object_set(camera, "digitalgain", 4.0, NULL);
  g_object_set(camera, "gain", 8.0, NULL);
#ifdef PRINTER
  g_object_set(ptzf, "device", PRINTER, nullptr);
#endif  // PRINTER

  g_assert(GST_STATE_CHANGE_FAILURE !=
           gst_element_set_state(pipe, GST_STATE_PLAYING));

  // get the bus from the pipeline
  bus = gst_element_get_bus(pipe);
  g_assert(bus);

  // create the main loop
  loop = g_main_loop_new(nullptr, false);
  g_assert(loop);

  // add the bus message callback
  gst_bus_add_watch(bus, (GstBusFunc)on_bus_message, loop);

  // register the signal handler to quit the mainloop
  g_unix_signal_add(SIGINT, (GSourceFunc)on_sigint, loop);

  // run the main loop (blocks here)
  g_main_loop_run(loop);

  g_assert(GST_STATE_CHANGE_FAILURE !=
           gst_element_set_state(pipe, GST_STATE_NULL));

  return 0;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.