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.

Grayscale video in GStreamer

Other Parts Discussed in Thread: TVP5146

Hello everyone!
I am using:
1) Evaluation module EVMDM365 from Digital Spectrum (support.spectrumdigital.com/.../) with DVSDK 4.02
2) Analog grayscale videocamera 576i (625/50) with composite output.
My GStreamer pipeline is
gst-launch -v v4l2src always-copy=FALSE input-src=COMPOSITE ! 'video/x-raw-yuv,format=(fourcc)NV12,width=736,height=576' ! TIVidenc1 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=test.mp4
I get a color video with ugly colors.
How can I get a grayscale video?
Thank you in advance.
Sorry for my english.
Dmitry Ioffe

  • Hi Dmitry,

    You should change the format from 'NV12' to 'GRAY8'. You can find more detailed description at:
    gstreamer.freedesktop.org/.../gstreamer-plugins-capsfilter.html

    BR
    Tsvetolin Shulev
  • Hi, Cvetolin!
    Thanks!

    But this link is for GStreamer 1.0. I have DVSDK 4.02, and my GStreamer version is 0.1. The v4l2src v 0.1 element has no GRAY8 format. It has the video/x-raw-gray Capabilities.
    If my pipeline is
    gst-launch -v v4l2src always-copy=FALSE input-src=COMPOSITE ! 'video/x-raw-yuv,format=(fourcc)GRAY8,width=736,height=576' ! TIVidenc1 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=test.mp4
    then I get the message:
    WARNING: erroneous pipeline: could not parse caps "video/x-raw-yuv,format=(fourcc)GRAY8,width=736,height=576"

    How can I achieve the goal with version 0.1?
    Or should I install version 1.0?
    How to do it?
    This version will work with EVMDM365?

    I tried a pipeline for version 0.1:
    gst-launch -v v4l2src always-copy=FALSE input-src=COMPOSITE ! 'video/x-raw-gray,width=736,height=576' ! TIVidenc1 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=test.mp4
    and I get the message:
    WARNING: erroneous pipeline: could not link v4l2src0 to tividenc10

    And I tried a pipeline with ffmpegcolorspace element:
    gst-launch -v v4l2src always-copy=FALSE input-src=COMPOSITE ! 'video/x-raw-gray,width=736,height=576' ! ffmpegcolorspace ! TIVidenc1 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=test.mp4
    and I received many messages:

    Setting pipeline to PAUSED ...
    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
    davinci_previewer davinci_previewer.2: ipipe_set_preview_config
    vpfe-capture vpfe-capture: IPIPE Chained
    vpfe-capture vpfe-capture: Resizer present
    tvp514x 1-005d: invalid control id -2147483648
    EVM: switch to tvp5146 SD video input
    tvp514x 1-005d: tvp5146 (Version - 0x03) found at 0xba (DaVinci I2C adapter)
    tvp514x 1-005d: invalid control id 9963780
    ...
    vpfe-capture vpfe-capture: width = 1, height = 1, bpp = 2
    vpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64
    ...
    ERROR: Pipeline doesn't want to pause.
    WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to set input 0 on device /dev/video0.
    Additional debug info:
    v4l2_calls.c(975): gst_v4l2_set_input (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    system error: Invalid argument
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
    Additional debug info:
    gstbasesrc.c(2755): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    Check your filtered caps, if any
    Setting pipeline to NULL ...
    Freeing pipeline ...

    Thank you in advance.

  • Hello,

    I gstreamer 0.10 you need to have something like this 'video/x-raw-gray,width=736,height=576'

    Cheers,
    --Prabhakar Lad
  • Hi,

    My bad I dint go through the complete post earlier.

    What version of the kernel is it ? Have you implemented the driver for the camera which fits in accordingly to that kernel ?
    Assuming it its 2.6.32 the dm365 ccdc supports the following:

    132 /* Raw Bayer formats */
    133 static u32 ccdc_raw_bayer_pix_formats[] =
    134 {V4L2_PIX_FMT_SBGGR8, V4L2_PIX_FMT_SBGGR16};
    135
    136 /* Raw YUV formats */
    137 static u32 ccdc_raw_yuv_pix_formats[] =
    138 {V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_YUYV};

    Cheers,
    --Prabhakar Lad
  • Hi, Prabhakar,
    thanks!
    My kernel version is "Linux version 2.6.32.17-davinci1".
    I found a driver and kernel in DVSDK 4.02.
    I see these lines in the file ~/ti-dvsdk_dm365-evm_4_02_00_06/psp/linux-2.6.32.17-psp03.01.01.39/drivers/media/video/davinci/dm365_ccdc.c :

    /* Raw Bayer formats */
    static u32 ccdc_raw_bayer_pix_formats[] =
    {V4L2_PIX_FMT_SBGGR8, V4L2_PIX_FMT_SBGGR16};

    /* Raw YUV formats */
    static u32 ccdc_raw_yuv_pix_formats[] =
    {V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_YUYV};

    What should I do?
    Thank you in advance.
  • Hi,

    Are there any sample v4l2 apps present in the DVSDK for capture ?(v4l2_capture/ capture.. )
    If there are any can you just try using this app to capture the image first.

    Cheers,
    --Prabhakar Lad
  • Hi, Prabhakar,
    thanks!
    I found an example file /usr/share/ti/dvsdk-demos/encode and read the 'encode.txt' file.
    Then I wrote the command '/etc/init.d/loadmodule-rc start'.
    I got the answer 'mknod: /dev/dm365mmap: File exists.'
    And then I wrote a command './encode -v test.264 -y 2 -I 1'
    Here is the answer:
    Encode demo started.
    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
    davinci_previewer davinci_previewer.2: ipipe_set_preview_config
    vpfe-capture vpfe-capture: IPIPE Chained
    vpfe-capture vpfe-capture: Resizer present
    EVM: switch to tvp5146 SD video input
    Error: Failed to create capture device. Is video input connected?

    I know that the video input is connected, because the GStreamer pipeline runs and gives an ugly video.
    Please tell me what else can I do?
    Perhaps it is necessary to edit the bootargs?
    My bootargs is
    bootargs=console=ttyS0,115200n8 rw mem=54M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=1 vpfe_capture.cont_bufsize=6291456 davinci_enc_mngr.ch0_output=COMPOSITE davinci_enc_mngr.ch0_mode=PAL root=/dev/mtdblock4 rootfstype=jffs2 ip=off
    Thank you in advance.