nvcamerasrc is fail if GST_DEBUG_DUMP_DOT_DIR is set

if envrionment variable GST_DEBUG_DUMP_DOT_DIR is set with something
nvcamerasrc make abnormal error message.
why error occur ?

nvidia@tegra-ubuntu:~/works$ export GST_DEBUG_DUMP_DOT_DIR=./

nvidia@tegra-ubuntu:~/works$ gst-launch-1.0 nvcamerasrc fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)320, height=(int)240, format=(string)I420, framerate=(fraction)30/1' ! nvtee ! nvivafilter cuda-process=true customer-lib-name="libnvsample_cudaprocess.so" !  'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink

Setting pipeline to PAUSED ...
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingSocket read error. Camera Daemon stopped functioning.....
0:00:00.157242970  6609       0x438410 ERROR            nvcamerasrc gstnvcamerasrc.cpp:3400:gst_nvcam_get_orientation:<nvcamerasrc0> Error in retrieving camera properties 

0:00:00.220343208  6609       0x438410 ERROR            nvcamerasrc gstnvcamerasrc.cpp:2380:gst_nvcamera_open:<nvcamerasrc0> REQ_NVCAM_CREATE_SESSION to camera_daemon failed

gst_nvcamera_open() failed ret=0
ERROR: Pipeline doesn't want to pause.
0:00:00.223608761  6609       0x438410 ERROR            nvcamerasrc gstnvcamerasrc.cpp:3400:gst_nvcam_get_orientation:<nvcamerasrc0> Error in retrieving camera properties 

ERROR: from element /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Additional debug info:
gstbasesrc.c(3354): gst_base_src_start (): /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0:
Failed to start
Setting pipeline to NULL ...
Freeing pipeline ...

gstnvcamerasrc.cpp:3400:gst_nvcam_get_orientation: Error in retrieving camera properties

if export GST_DEBUG_DUMP_DOT_DIR=, the script do not make error

nvidia@tegra-ubuntu:~/works$ export GST_DEBUG_DUMP_DOT_DIR=
nvidia@tegra-ubuntu:~/works$ gst-launch-1.0 nvcamerasrc fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)320, height=(int)240, format=(string)I420, framerate=(fraction)30/1' ! nvtee ! nvivafilter cuda-process=true customer-lib-name="libnvsample_cudaprocess.so" !  'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink
Setting pipeline to PAUSED ...
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and Mjstreaming
Available Sensor modes : 
2592 x 1944 FR=30.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
2592 x 1458 FR=30.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1280 x 720 FR=120.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...

NvCameraSrc: Trying To Set Default Camera Resolution. Selected 320x240 FrameRate = 30.000000 ...

New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:03.167159674
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
nvidia@tegra-ubuntu:~/works$ ^C

and

gst_buffer_n_memory() api is not work properly with nvidia gstramer plugin

nv plugin return always 808 byte as GstMemory size

gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)I420, width=(int)320, height=(int)240' ! nvvidconv ! 'video/x-raw(memory:NVMM), width=(int)320, height=(int)240, format=(string)I420' ! rgbdemux ! fakesink

rgbdemux plug source is

static GstFlowReturn
gst_rgbdemux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
{
  Gstrgbdemux *filter;
  GstBuffer *outbuf;

  filter = GST_RGBDEMUX (parent);

if (filter->silent == FALSE)
  {
      gsize offset;
      gsize maxsize;
      gsize i;
      i= gst_buffer_n_memory(buf);
      g_print ("I'm %s plugged, therefore I'm in.\n",__func__);
      gst_buffer_get_sizes (buf,&offset, &maxsize);
      g_print ("Have data of size %" G_GSIZE_FORMAT" bytes!\n",
                                            maxsize);
      g_print ("gst_buffer_n_memory %" G_GSIZE_FORMAT" !\n",
                                            i);
      g_print ("frametype is %d\n", filter->frametype);
  }
I'm gst_rgbdemux_chain plugged, therefore I'm in.
Have data of size 808 bytes!
gst_buffer_n_memory 1 !
gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)I420, width=(int)320, height=(int)240' ! rgbdemux ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
I'm gst_rgbdemux_chain plugged, therefore I'm in.
Have data of size 115207 bytes!
gst_buffer_n_memory 1 !
frametype is 0

@johlim

I think it’s cause the path incorrect. You should put an validate path like below

export GST_DEBUG_DUMP_DOT_DIR=~/works

You can also check it by echo $GST_DEBUG_DUMP_DOT_DIR to check the path is validate or not.

@ShaneCCC

It is not a goal to create a dot file. I just want to know the size of the buffer using the gst_buffer_get_sizes () api.

When nvxxx plugin is used, it is a problem that gst_buffer_get_size is always 808 bytes.

Please look again.

@ShaneCC

GST_DEBUG_DUMP_DOT_DIR problem is clear,

Unlike PC, it seems that it does not work when setting “export GST_DBBUG_DUMP_DOT_DIR=./” On TX2, if I specify “./” on PC , a dot file is created in current directory.

anyway

I got dot files setting “export GST_DBBUG_DUMP_DOT_DIR=/home/nvidia/DOT”

@ShaneCC

A tranfered buffer size is always 808 byte.

/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (808 bytes,


nvidia@tegra-ubuntu:~/DOT$ gst-launch-1.0 videotestsrc ! ‘video/x-raw, format=(string)I420, width=(int)320, height=(int)240’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), width=(int)320, height=(int)240, format=(string)I420’ ! identity silent=false ! fakesink -v
Setting pipeline to PAUSED …
Pipeline is PREROLLING …
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = event ******* (identity0:sink) E (type: stream-start (10254), GstEventStreamStart, stream-id=(string)15ba7ced598a21ef9f1340f845e5a41e, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)0;) 0x5bad00
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = “video/x-raw,\ format=(string)I420,\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive”
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = “video/x-raw,\ format=(string)I420,\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive”
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:src: caps = “video/x-raw(memory:NVMM),\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive,\ format=(string)I420”
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = “video/x-raw(memory:NVMM),\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive,\ format=(string)I420”
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = event ******* (identity0:sink) E (type: caps (12814), GstEventCaps, caps=(GstCaps)“video/x-raw(memory:NVMM),\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive,\ format=(string)I420”;) 0x5baec0
/GstPipeline:pipeline0/GstIdentity:identity0.GstPad:src: caps = “video/x-raw(memory:NVMM),\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive,\ format=(string)I420”
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = “video/x-raw(memory:NVMM),\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive,\ format=(string)I420”
/GstPipeline:pipeline0/GstIdentity:identity0.GstPad:sink: caps = “video/x-raw(memory:NVMM),\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive,\ format=(string)I420”
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = “video/x-raw(memory:NVMM),\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive,\ format=(string)I420”
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:sink: caps = “video/x-raw,\ format=(string)I420,\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive”
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = “video/x-raw,\ format=(string)I420,\ width=(int)320,\ height=(int)240,\ framerate=(fraction)30/1,\ pixel-aspect-ratio=(fraction)1/1,\ interlace-mode=(string)progressive”
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = event ******* (identity0:sink) E (type: segment (17934), GstEventSegment, segment=(GstSegment)“GstSegment, flags=(GstSegmentFlags)GST_SEGMENT_FLAG_NONE, rate=(double)1, applied-rate=(double)1, format=(GstFormat)GST_FORMAT_TIME, base=(guint64)0, offset=(guint64)0, start=(guint64)0, stop=(guint64)18446744073709551615, time=(guint64)0, position=(guint64)0, duration=(guint64)18446744073709551615;”;) 0x7f98003840
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (808 bytes, dts: none, pts: 0:00:00.000000000, duration: 0:00:00.033333333, offset: 0, offset_end: 1, flags: 00000040 discont ) 0x7f9802b110
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (808 bytes, dts: none, pts: 0:00:00.033333333, duration: 0:00:00.033333333, offset: 1, offset_end: 2, flags: 00000000 ) 0x7f9802b220
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (808 bytes, dts: none, pts: 0:00:00.066666666, duration: 0:00:00.033333334, offset: 2, offset_end: 3, flags: 00000000 ) 0x7f9802b330
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (808 bytes, dts: none, pts: 0:00:00.100000000, duration: 0:00:00.033333333, offset: 3, offset_end: 4, flags: 00000000 ) 0x7f9802b440