passing gst-launch from nvcamerasrc to v4l2sink

Hi,

I’m trying to get Leopard Imaging IMX185 camera with nvcamerasrc output to v4l2sink but fail to accomplish it after some attempt. The following is the pipeline i attempted:

gst-launch-1.0 --gst-debug-level=3 nvcamerasrc ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1’ ! nvtee ! nvvidconv flip-method=2 ! ‘video/x-raw(memory:NVMM), format=(string)I420, framerate=(fraction)30/1’ ! v4l2sink device=/dev/video3
0:00:00.042475886 7498 0x59a0c0 ERROR GST_PIPELINE grammar.y:642:gst_parse_perform_link: could not link nvvconv0 to v4l2sink0

The following is the output of the gst-inspect-1.0 v4l2sink

Factory Details:
  Rank                     none (0)
  Long-name                Video (video4linux2) Sink
  Klass                    Sink/Video
  Description              Displays frames on a video4linux2 device
  Author                   Rob Clark <rob@ti.com>,

Plugin Details:
  Name                     video4linux2
  Description              elements for Video 4 Linux
  Filename                 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so
  Version                  1.8.2
  License                  LGPL
  Source module            gst-plugins-good
  Source release date      2016-06-09
  Binary package           GStreamer Good Plugins (Ubuntu)
  Origin URL               https://launchpad.net/distros/ubuntu/+source/gst-plugins-good1.0

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSink
                         +----GstVideoSink
                               +----GstV4l2Sink

Implemented Interfaces:
  GstTuner
  GstColorBalance
  GstVideoOrientation

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      image/jpeg
      video/mpeg
            mpegversion: 4
           systemstream: false
      video/mpeg
            mpegversion: 2
      video/mpegts
           systemstream: true
      video/x-bayer
                 format: { bggr, gbrg, grbg, rggb }
                  width: [ 1, 32768 ]
                 height: [ 1, 32768 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-dv
           systemstream: true
      video/x-h263
                variant: itu
      video/x-h264
          stream-format: { byte-stream, avc }
              alignment: au
      video/x-pwc1
                  width: [ 1, 32768 ]
                 height: [ 1, 32768 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-pwc2
                  width: [ 1, 32768 ]
                 height: [ 1, 32768 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw
                 format: { RGB16, BGR, RGB, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV24, NV61, NV16, NV21, NV12, I420, BGRA, BGRx, ARGB, xRGB, BGR15, RGB15 }
                  width: [ 1, 32768 ]
                 height: [ 1, 32768 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-sonix
                  width: [ 1, 32768 ]
                 height: [ 1, 32768 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-vp8
      video/x-wmv
             wmvversion: 3
                 format: WVC1

Element Flags:
  no flags set

Element Implementation:
  Has change_state() function: 0x7fb1491710

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "v4l2sink0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  sync                : Sync on the clock
                        flags: readable, writable
                        Boolean. Default: true
  max-lateness        : Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited)
                        flags: readable, writable
                        Integer64. Range: -1 - 9223372036854775807 Default: 20000000 
  qos                 : Generate Quality-of-Service events upstream
                        flags: readable, writable
                        Boolean. Default: true
  async               : Go asynchronously to PAUSED
                        flags: readable, writable
                        Boolean. Default: true
  ts-offset           : Timestamp offset in nanoseconds
                        flags: readable, writable
                        Integer64. Range: -9223372036854775808 - 9223372036854775807 Default: 0 
  enable-last-sample  : Enable the last-sample property
                        flags: readable, writable
                        Boolean. Default: true
  last-sample         : The last sample received in the sink
                        flags: readable
                        Boxed pointer of type "GstSample"
  blocksize           : Size in bytes to pull per buffer (0 = default)
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4096 
  render-delay        : Additional render delay of the sink in nanoseconds
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  throttle-time       : The time to keep between rendered buffers (0 = disabled)
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  max-bitrate         : The maximum bits per second to render (0 = disabled)
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  show-preroll-frame  : Whether to render video frames during preroll
                        flags: readable, writable
                        Boolean. Default: true
  device              : Device location
                        flags: readable, writable
                        String. Default: "/dev/video1"
  device-name         : Name of the device
                        flags: readable
                        String. Default: null
  device-fd           : File descriptor of the device
                        flags: readable
                        Integer. Range: -1 - 2147483647 Default: -1 
  flags               : Device type flags
                        flags: readable
                        Flags "GstV4l2DeviceTypeFlags" Default: 0x00000000, "(none)"
                           (0x00000001): capture          - Device supports video capture
                           (0x00000002): output           - Device supports video playback
                           (0x00000004): overlay          - Device supports video overlay
                           (0x00000010): vbi-capture      - Device supports the VBI capture
                           (0x00000020): vbi-output       - Device supports the VBI output
                           (0x00010000): tuner            - Device has a tuner or modulator
                           (0x00020000): audio            - Device has audio inputs or outputs
  brightness          : Picture brightness, or more precisely, the black level
                        flags: readable, writable, controllable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 
  contrast            : Picture contrast or luma gain
                        flags: readable, writable, controllable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 
  saturation          : Picture color saturation or chroma gain
                        flags: readable, writable, controllable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 
  hue                 : Hue or color balance
                        flags: readable, writable, controllable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 
  norm                : video standard
                        flags: readable, writable
                        Enum "V4L2_TV_norms" Default: 0, "none"
                           (0): none             - none
                           (45056): NTSC             - NTSC
                           (4096): NTSC-M           - NTSC-M
                           (8192): NTSC-M-JP        - NTSC-M-JP
                           (32768): NTSC-M-KR        - NTSC-M-KR
                           (16384): NTSC-443         - NTSC-443
                           (255): PAL              - PAL
                           (7): PAL-BG           - PAL-BG
                           (1): PAL-B            - PAL-B
                           (2): PAL-B1           - PAL-B1
                           (4): PAL-G            - PAL-G
                           (8): PAL-H            - PAL-H
                           (16): PAL-I            - PAL-I
                           (224): PAL-DK           - PAL-DK
                           (32): PAL-D            - PAL-D
                           (64): PAL-D1           - PAL-D1
                           (128): PAL-K            - PAL-K
                           (256): PAL-M            - PAL-M
                           (512): PAL-N            - PAL-N
                           (1024): PAL-Nc           - PAL-Nc
                           (2048): PAL-60           - PAL-60
                           (16711680): SECAM            - SECAM
                           (65536): SECAM-B          - SECAM-B
                           (262144): SECAM-G          - SECAM-G
                           (524288): SECAM-H          - SECAM-H
                           (3276800): SECAM-DK         - SECAM-DK
                           (131072): SECAM-D          - SECAM-D
                           (1048576): SECAM-K          - SECAM-K
                           (2097152): SECAM-K1         - SECAM-K1
                           (4194304): SECAM-L          - SECAM-L
                           (8388608): SECAM-Lc         - SECAM-Lc
  io-mode             : I/O mode
                        flags: readable, writable
                        Enum "GstV4l2IOMode" Default: 0, "auto"
                           (0): auto             - GST_V4L2_IO_AUTO
                           (1): rw               - GST_V4L2_IO_RW
                           (2): mmap             - GST_V4L2_IO_MMAP
                           (3): userptr          - GST_V4L2_IO_USERPTR
                           (4): dmabuf           - GST_V4L2_IO_DMABUF
                           (5): dmabuf-import    - GST_V4L2_IO_DMABUF_IMPORT
  extra-controls      : Extra v4l2 controls (CIDs) for the device
                        flags: readable, writable
                        Boxed pointer of type "GstStructure"
  pixel-aspect-ratio  : Overwrite the pixel aspect ratio of the device
                        flags: readable, writable
                        String. Default: null
  force-aspect-ratio  : When enabled, the pixel aspect ratio will be enforced
                        flags: readable, writable
                        Boolean. Default: true
  overlay-top         : The topmost (y) coordinate of the video overlay; top left corner of screen is 0,0
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 
  overlay-left        : The leftmost (x) coordinate of the video overlay; top left corner of screen is 0,0
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 
  overlay-width       : The width of the video overlay; default is equal to negotiated image width
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0 
  overlay-height      : The height of the video overlay; default is equal to negotiated image height
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0 
  crop-top            : The topmost (y) coordinate of the video crop; top left corner of image is 0,0
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 
  crop-left           : The leftmost (x) coordinate of the video crop; top left corner of image is 0,0
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 
  crop-width          : The width of the video crop; default is equal to negotiated image width
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0 
  crop-height         : The height of the video crop; default is equal to negotiated image height
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0

Please advice if it is possible to pass the nvcamerasrc to v4l2sink?

Hi kimchuan,
nvvidconv can output ‘video/x-raw’. Please try
gst-launch-1.0 --gst-debug-level=3 nvcamerasrc ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1’ ! nvtee ! nvvidconv flip-method=2 ! ‘video/x-raw, format=(string)I420, framerate=(fraction)30/1’ ! v4l2sink device=/dev/video3

Hi DaneLLL,

no luck with the pipeline you suggested.

gst-launch-1.0 --gst-debug-level=3 nvcamerasrc ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1’ ! nvtee ! nvvidconv flip-method=2 ! ‘video/x-raw, format=(string)I420, framerate=(fraction)30/1’ ! v4l2sink device=/dev/video3
Setting pipeline to PAUSED …
libv4l2: error getting pixformat: Invalid argument

Available Sensor modes :
1920 x 1080 FR=30.000000 CF=0xf09208a10 SensorModeType=4 CSIPixelBitDepth=12 DynPixelBitDepth=12
Pipeline is live and does not need PREROLL …
0:00:00.187455416 13266 0x48c4f0 FIXME default gstutils.c:3766:gst_pad_create_stream_id_internal:nvcamerasrc0:src Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Setting pipeline to PLAYING …
0:00:00.188197187 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at YUYV@48x32: 0
New clock: GstSystemClock
0:00:00.188313697 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at UYVY@48x32: 0
0:00:00.188386197 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at 422P@48x32: 0
0:00:00.188509010 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at YU12@48x32: 0
0:00:00.188606562 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at YV12@48x32: 0
0:00:00.188717604 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at 411P@48x32: 0
0:00:00.188804375 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at YVU9@48x32: 0
0:00:00.188892343 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at YUV9@48x32: 0
0:00:00.188995312 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at JPEG@48x32: 0
0:00:00.189252135 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at MJPG@48x32: 0
0:00:00.189352656 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at dvsd@48x32: 0
0:00:00.189413437 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at RGB4@48x32: 0
0:00:00.189484479 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at BGR4@48x32: 0
0:00:00.189543750 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at RGB3@48x32: 0
0:00:00.189603593 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at BGR3@48x32: 0
0:00:00.189662708 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at RGBQ@48x32: 0
0:00:00.189721041 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at RGBP@48x32: 0
0:00:00.189778020 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at RGBO@48x32: 0
0:00:00.189835052 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at GREY@48x32: 0
0:00:00.189892343 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at VP80@48x32: 0
0:00:00.189956250 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at VC1L@48x32: 0
0:00:00.190010052 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at VC1G@48x32: 0
0:00:00.190065104 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at XVID@48x32: 0
0:00:00.190119218 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at MPG4@48x32: 0
0:00:00.190170989 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at MPG2@48x32: 0
0:00:00.190222604 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at MPG1@48x32: 0
0:00:00.190275260 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at H263@48x32: 0
0:00:00.190328333 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at AVC1@48x32: 0
0:00:00.190382656 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at H264@48x32: 0
0:00:00.190436770 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at Y16 @48x32: 0
0:00:00.190506979 13266 0x48c4f0 WARN v4l2 gstv4l2object.c:2389:gst_v4l2_object_probe_caps_for_format_and_size: Unknown frame interval type at YVYU@48x32: 0

NvCameraSrc: Trying To Set Default Camera Resolution. Selected 1920x1080 FrameRate = 30.000000 …

0:00:00.530199114 13266 0x48c4f0 WARN basetransform gstbasetransform.c:1414:gst_base_transform_setcaps: transform could not transform video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1 in anything we support
0:00:00.680451822 13266 0x48c4f0 WARN basetransform gstbasetransform.c:1414:gst_base_transform_setcaps: transform could not transform video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1 in anything we support
0:00:00.680787864 13266 0x48c4f0 WARN basetransform gstbasetransform.c:1414:gst_base_transform_setcaps: transform could not transform video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1 in anything we support
0:00:00.680922083 13266 0x48c4f0 WARN basesrc gstbasesrc.c:2948:gst_base_src_loop: error: Internal data flow error.
0:00:00.680959999 13266 0x48c4f0 WARN basesrc gstbasesrc.c:2948:gst_base_src_loop: error: streaming task paused, reason not-negotiated (-4)
0:00:00.681264531 13266 0x48c4f0 WARN basetransform gstbasetransform.c:1414:gst_base_transform_setcaps: transform could not transform video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1 in anything we support
ERROR: from element /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.493143229
Setting pipeline to PAUSED …
Setting pipeline to READY …
0:00:00.681645520 13266 0x48c4f0 WARN basetransform gstbasetransform.c:1414:gst_base_transform_setcaps: transform could not transform video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1 in anything we support
Setting pipeline to NULL …
Freeing pipeline …

BTW, the following is the result of gst-inspect-1.0 nvcamerasrc

gst-inspect-1.0 nvcamerasrc
Factory Details:
  Rank                     primary (256)
  Long-name                Nvidia Camera Source
  Klass                    Video/Capture
  Description              Nvidia Camera Source
  Author                   Jitendra Kumar <jitendrak@nvidia.com>

Plugin Details:
  Name                     nvcamera
  Description              Nvidia Video Capture Component 
  Filename                 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcamera.so
  Version                  1.2.0
  License                  Proprietary
  Source module            nvcamera
  Binary package           NvCamera
  Origin URL               http://nvidia.com

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSrc
                         +----GstNvCameraSrc

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
                 format: { I420, NV12, UYVY }
              framerate: [ 0/1, 120/1 ]


Element Flags:
  no flags set

Element Implementation:
  Has change_state() function: gst_nvcamerasrc_change_state

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "nvcamerasrc0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  blocksize           : Size in bytes to read per buffer (-1 = default)
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4096 
  num-buffers         : Number of buffers to output before sending EOS (-1 = unlimited)
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  typefind            : Run typefind before negotiating
                        flags: readable, writable
                        Boolean. Default: false
  do-timestamp        : Apply current stream time to buffers
                        flags: readable, writable
                        Boolean. Default: true
  queue-size          : Number of buffers for the driver to enqueue
                        flags: readable, writable
                        Integer. Range: 10 - 100 Default: 10 
  wbmode              : White balance affects the color temperature of the photo
                        flags: readable, writable
                        Enum "GstNvCamWBMode" Default: 1, "auto"
                           (0): off              - GST_NVCAM_WB_MODE_OFF
                           (1): auto             - GST_NVCAM_WB_MODE_AUTO
                           (2): incandescent     - GST_NVCAM_WB_MODE_INCANDESCENT
                           (3): fluorescent      - GST_NVCAM_WB_MODE_FLUORESCENT
                           (4): warm-fluorescent - GST_NVCAM_WB_MODE_WARM_FLUORESCENT
                           (5): daylight         - GST_NVCAM_WB_MODE_DAYLIGHT
                           (6): cloudy-daylight  - GST_NVCAM_WB_MODE_CLOUDY_DAYLIGHT
                           (7): twilight         - GST_NVCAM_WB_MODE_TWILIGHT
                           (8): shade            - GST_NVCAM_WB_MODE_SHADE
                           (9): manual           - GST_NVCAM_WB_MODE_MANUAL
  scene-mode          : property to set scene mode
                        flags: readable, writable
                        Enum "GstNvCamSceneMode" Default: 0, "face-priority"
                           (0): face-priority    - GST_NVCAM_SCENE_MODE_FACE_PRIORITY
                           (1): action           - GST_NVCAM_SCENE_MODE_ACTION
                           (2): portrait         - GST_NVCAM_SCENE_MODE_PORTRAIT
                           (3): landscape        - GST_NVCAM_SCENE_MODE_LANDSCAPE
                           (4): night            - GST_NVCAM_SCENE_MODE_NIGHT
                           (5): night-portrait   - GST_NVCAM_SCENE_MODE_NIGHT_PORTRAIT
                           (6): theatre          - GST_NVCAM_SCENE_MODE_THEATRE
                           (7): beach            - GST_NVCAM_SCENE_MODE_BEACH
                           (8): snow             - GST_NVCAM_SCENE_MODE_SNOW
                           (9): sunset           - GST_NVCAM_SCENE_MODE_SUNSET
                           (10): steady-photo     - GST_NVCAM_SCENE_MODE_STEADYSHOT
                           (11): fireworks        - GST_NVCAM_SCENE_MODE_FIREWORKS
                           (12): sports           - GST_NVCAM_SCENE_MODE_SPORTS
                           (13): party            - GST_NVCAM_SCENE_MODE_PARTY
                           (14): candle-light     - GST_NVCAM_SCENE_MODE_CANDLE_LIGHT
                           (15): barcode          - GST_NVCAM_SCENE_MODE_BARCODE
  color-effect        : property to set color effect
                        flags: readable, writable
                        Enum "GstNvCamColorEffectMode" Default: 1, "off"
                           (1): off              - GST_NVCAM_COLOR_EFFECT_OFF
                           (2): mono             - GST_NVCAM_COLOR_EFFECT_MONO
                           (3): negative         - GST_NVCAM_COLOR_EFFECT_NEGATIVE
                           (4): solarize         - GST_NVCAM_COLOR_EFFECT_SOLARIZE
                           (5): sepia            - GST_NVCAM_COLOR_EFFECT_SEPIA
                           (6): posterize        - GST_NVCAM_COLOR_EFFECT_POSTERIZE
                           (7): aqua             - GST_NVCAM_COLOR_EFFECT_AQUA
  auto-exposure       : property to set auto exposure mode
                        flags: readable, writable
                        Enum "GstNvCamAutoExposureMode" Default: 2, "on"
                           (1): off              - GST_NVCAM_AUTO_EXPOSURE_OFF
                           (2): on               - GST_NVCAM_AUTO_EXPOSURE_ON
                           (3): OnAutoFlash      - GST_NVCAM_AUTO_EXPOSURE_AUTOFLASH
                           (4): OnAlwaysFlash    - GST_NVCAM_AUTO_EXPOSURE_ALWAYSFLASH
                           (5): OnFlashRedEye    - GST_NVCAM_AUTO_EXPOSURE_AUTO_RED_EYE
  flash               : property to set flash mode
                        flags: readable, writable
                        Enum "GstNvCamFlashMode" Default: 0, "off"
                           (0): off              - GST_NVCAM_FLASH_OFF
                           (1): on               - GST_NVCAM_FLASH_ON
                           (2): torch            - GST_NVCAM_FLASH_TORCH
                           (3): auto             - GST_NVCAM_FLASH_AUTO
  flicker             : property to select flicker detection and avoidance mode
                        flags: readable, writable
                        Enum "GstNvCamFlickerMode" Default: 3, "auto"
                           (0): off              - GST_NVCAM_FLICKER_OFF
                           (1): 50Hz             - GST_NVCAM_FLICKER_50HZ
                           (2): 60Hz             - GST_NVCAM_FLICKER_60HZ
                           (3): auto             - GST_NVCAM_FLICKER_AUTO
  contrast            : property to adjust contrast value
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:               0 
  saturation          : property to adjust saturation value
                        flags: readable, writable
                        Float. Range:               0 -               2 Default:               1 
  tnr-strength        : property to adjust temporal noise reduction strength
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:               0 
  tnr-mode            : property to select temporal noise reduction mode
                        flags: readable, writable
                        Enum "GstNvCamTNRMode" Default: 0, "NoiseReduction_Off"
                           (0): NoiseReduction_Off - GST_NVCAM_NR_OFF
                           (1): NoiseReduction_Fast - GST_NVCAM_NR_FAST
                           (2): NoiseReduction_HighQuality - GST_NVCAM_NR_HIGHQUALITY
  edge-enhancement    : property to adjust edge enhnacement value
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:              -1 
  trigger             : property to fire pre capture trigger
                        flags: readable, writable
                        Enum "GstNvCamCaptureTrigger" Default: 0, ""
                           (1): idle             - GST_NVCAM_TRIGGER_IDLE
                           (2): start            - GST_NVCAM_TRIGGER_START
  intent              : property to select capture intent
                        flags: readable, writable
                        Enum "GstNvCamCaptureIntent" Default: 1, "preview"
                           (1): preview          - GST_NVCAM_INTENT_PREVIEW
                           (2): still            - GST_NVCAM_INTENT_STILL
                           (3): video            - GST_NVCAM_INTENT_VIDEO
                           (4): video-snapshot   - GST_NVCAM_INTENT_VIDEO_SNAPSHOT
                           (5): zsl              - GST_NVCAM_INTENT_ZSL
  sensor-id           : Set the id of camera sensor to use. Default 0.)
                        flags: readable, writable
                        Integer. Range: 0 - 255 Default: 0 
  enable-exif         : Return Exif data with captured frame
                        flags: readable, writable
                        Boolean. Default: false
  enable-meta         : Return Sensor meta data with captured frame
                        flags: readable, writable
                        Boolean. Default: false
  aeRegion            : Property to set region of interest for auto exposure.
			 Use GArray, with values of ROI coordinates (top,left,bottom,right)
			 and weight in that order, to set the property.
                        flags: readable, writable
                        Boxed pointer of type "GArray"
  wbRegion            : Property to set region of interest for white balance.
			 Use GArray, with values of ROI coordinates (top,left,bottom,right)
			 and weight in that order, to set the property.
                        flags: readable, writable
                        Boxed pointer of type "GArray"
  fpsRange            : Property to set FPS range.
			 Use string with values of FPS Range (low, high)
			 in that order, to set the property.
                        flags: readable, writable
                        String. Default: null
  exposure-time       : Property to adjust exposure time.
			 This property will have effect only when Exposure mode is Off.
                        flags: readable, writable
                        Float. Range:               0 -    3.402823e+38 Default:           0.033 
  wbManualMode        : Property to set manual mode of White balance.
			 This property will have effect only when wbMode is manual.
                        flags: readable, writable
                        Enum "GstNvCamWBManualMode" Default: 0, "off"
                           (0): off              - GST_NVCAM_WB_MANUAL_OFF
                           (1): reset            - GST_NVCAM_WB_MANUAL_RESET
                           (2): restore          - GST_NVCAM_WB_MANUAL_RESTORE
                           (3): external-gains   - GST_NVCAM_WB_MANUAL_EXTGAINS
  wbGains             : Property to set external white balance Gains.
			 Use GArray, with values of WB gains (R, GR, GB, B)
			 in that order, to set the property.
			 This will have effect only when wbMode is manual.
                        flags: readable, writable
                        Boxed pointer of type "GArray"
  aeLock              : Property to lock auto exposure.
                        flags: readable, writable
                        Boolean. Default: false
  callback            : Property to set user callback. It is required if user wants 
			 to change capture settings per frame. Provide address 
			 of GstNvCamSrcCallbacks type struct as value. 

                        flags: writable
                        Pointer. Write only
  dump-bayer          : Dump raw bayer data in still capture mode.
                        flags: readable, writable
                        Boolean. Default: false
  num-sensors         : Property to get number of sensors.
			 Returns GArray containing number of sensors {usb,csi}

                        flags: readable
                        Boxed pointer of type "GArray"
  enable-surround-cameras: Enable Surround Camera (Res: 3456x2304)
                        flags: readable, writable
                        Boolean. Default: false
  stitch-in-w         : Set the stitch in W.
                        flags: readable, writable
                        Integer. Range: 0 - 4336 Default: 4336 
  stitch-in-h         : Set the stitch in H.
                        flags: readable, writable
                        Integer. Range: 0 - 2440 Default: 2440 
  surface-layout      : Set the surface layout. Default 0. (0=Blocklinear, 1=Pitch)
                        flags: readable, writable
                        Integer. Range: 0 - 1 Default: 0 
  orientation         : Sensor orientation value. This must be accessed after PAUSED state.
                        flags: readable
                        Integer. Range: 0 - 360 Default: -1 

Element Actions:
  "start-capture" :  void user_function (GstElement* object);
  "stop-capture" :  void user_function (GstElement* object);

is it possible to sink to v4l2sink?

Hi kimchuan,
I think the problem is how you make /dev/video3. By default, it fails at earlier stage:

ubuntu@tegra-ubuntu:~$ gst-launch-1.0 --gst-debug-level=3 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvtee ! nvvidconv flip-method=2 ! 'video/x-raw, format=(string)I420, framerate=(fraction)30/1' ! v4l2sink device=/dev/video3
Setting pipeline to PAUSED ...
0:00:00.036032796  2693       0x527e00 WARN                    v4l2 v4l2_calls.c:606:gst_v4l2_open:<v4l2sink0> error: Cannot identify device '/dev/video3'.
0:00:00.036101546  2693       0x527e00 WARN                    v4l2 v4l2_calls.c:606:gst_v4l2_open:<v4l2sink0> error: system error: No such file or directory
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Cannot identify device '/dev/video3'.
Additional debug info:
v4l2_calls.c(606): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
system error: No such file or directory
Setting pipeline to NULL ...
Freeing pipeline ...

You can verify nvvidconv output via xvimagesink

gst-launch-1.0 --gst-debug-level=3 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvtee ! nvvidconv flip-method=2 ! 'video/x-raw, format=(string)I420, framerate=(fraction)30/1' ! xvimagesink

Have you ensured that /dev/video3 is in I420?

Hi DaneLLL, may I know where you get the error message “ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Cannot identify device ‘/dev/video3’.”? My TX1 never give me the error message.

Hi kimchuan,
On TX1 with r24.2.1, I only see /dev/video0 which is default camera ov5693

Welcome to Ubuntu 16.04 LTS (GNU/Linux 3.10.96-tegra aarch64)

 * Documentation:  https://help.ubuntu.com/

370 packages can be updated.
137 updates are security updates.

Last login: Thu Feb 16 01:37:34 2017
ubuntu@tegra-ubuntu:~$ ls -all /dev/video*
crw-rw----+ 1 root video 81, 0 Feb 11  2016 /dev/video0
ubuntu@tegra-ubuntu:~$

DaneLLL, my /dev/video3 is created with v4l2loopback
see https://github.com/umlaeute/v4l2loopback

Hi kimchuan,
We have confirmed the case is not supported in r24.2.1.

any chance it will be supported in near future?

Hi kimchaun,
Please share your usecase for linking nvcamerasrc -> v4l2sink for our evaluation

we purchased a nvcamerasrc MIPI camera from leopardimaging and would like to make use of gst-rtsp-server to stream the video and at the same time split the input stream for opencv image processing. the quickest way we could figure it out is to sink it with v4l2sink to the v4l2loopback adapter we created and make the opencv to open the v4l2loopback adapter.

Hi kimchuan,
Please refer to the following thread for nvcamerasrc -> opencv
https://devtalk.nvidia.com/default/topic/987537/jetson-tx1/videocapture-fails-to-open-onboard-camera-l4t-24-2-1-opencv-3-1/post/5064902/#5064902

Hi DaneLLL,

Many thanks for your very helpful response.

We have no problem to write an OpenCV C/C++ application to open nvcamerasrc camera for image processing.

We also have no problem to write an gstreamer application to open nvcamerasrc camera for rtsp server streaming.

We would like to split the input stream used by gstreamer application for concurent opencv image processing at the same time. The quickest way we could figure it out is to sink it with v4l2sink to the v4l2loopback adapter we created and make the opencv to open the v4l2loopback adapter.

Linking nvcamerasrc -> v4l2sink is the quickest hack we could figure it out.

Anyway, thanks again for your effort.

Hi kimchaun,
Please use attached libgstnvvidconv.so and give it a try. We have verified with

[Stream to v4l2sink]
gst-launch-1.0 nvcamerasrc ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1’ ! nvtee ! nvvidconv flip-method=2 ! ‘video/x-raw, format=(string)I420, framerate=(fraction)30/1’ ! tee ! v4l2sink device=/dev/video1
[Get preview via guvcview]
export DISPLAY=:0
guvcview -d /dev/video1
libgstnvvidconv.so.txt (75.5 KB)

Hi DaneLLL,

Thanks for your kindness. The provided libgstnvvidconv.so is able to sink to v4l2sink.

Hopefully the improved libgstnvvidconv.so will be merged into the official gstreamer.

Good job!