10 Bit encoding using Gstreamer with appsrc

Hi,

I am new to GStreamer and try to use it with C++ by inputing 10 -Bit Images into appsrc.
Therefore I am taking Images from my grayscale camera which supports 10/12 bit.
Following this, I do some Image processing and push those Images into appsrc.

What I use:

  • Jetson TX2
  • Gstreamer Version 1.83

Input -> 10 bit Images saved in GRAY16_LE
output -> I420_10LE (H265 encoder)

My Pipeline idea:

appsrc —GRAY16_LE—> videoconvert —Video/x-raw, Format=I420_10LE—> nvvdiconv Video/x-raw(Memory:NVMM), Format=I420_10LE—> omxh265enc ---->matroskamux —> filesink

By doing this, I am getting the following Errors:

gst_nvvconv_prepare_isurface: invalid in_pxt_fmt
gst_nvvconv_transform: Failed to prepare inter surfaces

Does this mean it does not support the conversion from I420_10LE Video/x-raw, Format=I420_10LE to Video/x-raw(Memory:NVMM), Format=I420_10LE? So no conversion between Video/x-raw and Video/x-raw(Memory:NVMM) are allowed. How to construct the Pipeline correctly?

Thank you in advance.

Hi,
The capability is not correct in r28.3 and is corrected in r32.1. ‘video/x-raw,format=I420_10LE’ is not supported. Please try I420.

$ gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw,format=GRAY16_LE ! videoconvert ! video/x-raw,format=<b>I420</b> ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420_10LE' ! omxh265enc ! matroskamux ! filesink location= a.mkv

Thank you for your answer.

Converting the frames to 8 bit and then back to 10 bit produces a loss of image quality or not?
I would like to have a lossless 10 /12 bit video.

Is there a way to convert it to video/x-raw(Memory:NVMM) and format=I420_10LE instead?

Hi,
We will review this feature request.

Hi DaneLLL,

any new information from your site regarding this topic?

Hi,
It shall be supported in next r32 release. The supported video format is P010_10LE

$ gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw,format=GRAY16_LE ! videoconvert ! video/x-raw,<b>format=P010_10LE</b> ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420_10LE' ! omxh265enc ! matroskamux ! filesink location= a.mk

Hi,

what video format is actually passed to OMX encoder? Is it planar I420_10LE or semi-planar P010? I mean will nvvidconv actually do any conversion in your example pipeline, or will it just copy P010_10LE input as-is to NVMM memory?

Hi,

It is semi-planar P010. It just copies P010_10LE input as-is to NVMM memory.