I have a 4K grayscale .mkv video encoded in Y800 format (8-bit, 1 byte per pixel). I want to play it back on a Jetson Xavier NX using hardware acceleration, but without any conversion to formats like I420/YUV, which introduce pixel approximation and alter the original grayscale data.
Is it possible to achieve this while preserving exact pixel values (no chroma subsampling or conversion)?
What would be the correct GStreamer pipeline to use for this purpose?
The codec used to generate the .mkv video is h265 and the pixel format is gray. The following pipeline was used on Windows to generate the video: ".\ffmpeg\bin\ffmpeg.exe" -r 1 -i "\path\to\images\%04d.png" -vf format=gray -c:v libx265 -x265-params lossless=1 -pix_fmt gray -r 1 out.mkv
Using libx264 resulted of a .mkv video with pixel format yuv420 which is not desired.
On Jetson Xavier NX, I run the following command: gst-launch-1.0 filesrc location= out.mkv ! matroskademux ! h265parse ! nvv4l2decoder ! nvvidconv ! video/x-raw,format=I420 ! xvimagesink
and the outcome:
Setting pipeline to PAUSED …
Opening in BLOCKING MODE
Pipeline is PREROLLING …
NvMMLiteOpen : Block : BlockType = 279
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 279
Invalid NvBuffer plane 2
Invalid NvBuffer plane 2
ERROR: from element /GstPipeline:pipeline0/nvv4l2decoder:nvv4l2decoder0: Failed to allocate required memory.
Additional debug info:
/dvs/git/dirty/git-master_linux/3rdparty/gst/gst-v4l2/gst-v4l2/gstv4l2videodec.c(1634): gst_v4l2_video_dec_handle_frame (): /GstPipeline:pipeline0/nvv4l2decoder:nvv4l2decoder0:
Buffer pool activation failed
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to NULL …
Freeing pipeline …
In addition to that even if the pipeline worked, I am afraid that the decoder ‘nvv4l2decoder’ will convert the gray frames (y800) to corresponding yuv420 which alters the pixels values. What do you suggest?
Many thanks in advance!
Hi,
The stream compressed from GREY cannot be decoded through hardware decoder. Would suggest convert it to I420 with no data in U V plane. If you must have it be GREY, please use software decoder.