Nvjpegenc lost color in gstreamer pipline while jpegenc does not

Hi,

I’m testing gstreamer pipelines on a Xavier device.

gst-launch-1.0 rtspsrc location="rtsp..." latency=300 ! rtph265depay ! h265parse ! nvv4l2decoder ! nvvidconv ! video/x-raw, format=BGRx, width=960, height=540 ! nvjpegenc ! filesink location=sample.jpeg buffer-size=1

this generates sample.jpeg but it’s in graycolor and jpeg file size is about 2.3M, resolution is 960x540.

If I change the nvjpegenc into jpegenc,

the file has color, file size is 5.8M, resolution is 960x540, and it’s in full color.

I don’t know what’s problem.

Thanks

Hi,
You may try to encode YUV420 like:

gst-launch-1.0 rtspsrc location="rtsp..." latency=300 ! rtph265depay ! h265parse ! nvv4l2decoder ! nvvidconv ! video/x-raw, format=I420, width=960, height=540 ! nvjpegenc ! filesink location=sample.jpeg buffer-size=1
1 Like

It works, may I know why? is it expected to lost color if I use BGRx?

Hi,
General format is YUV420 and BGRx may not be handled properly. Decoded frame data is in YUV420 so it is more straightforward to encode the frame data into JPEG directly. It is not necessary to convert to BGRx.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.