Decoding with nvv4l2decoder and using nvjpegenc to encode

Hi,I have used nvv4l2decoder and nvjpegenc to encode rtsp or rtmp h264 stream to jpeg,but the all of the jpeg image is green.
The environment is TX2 nvcr.io/nvidia/l4t-base:r32.4.4 JetPack 4.3
The pipeline is easy and just like this:

gst-launch-1.0 rtspsrc location=rtsp://192.168.10.46:8554/test ! rtph264depay ! nvv4l2decoder ! nvvidconv ! nvjpegenc ! multifilesink location='%03d.jpeg'
gst-launch-1.0 rtmpsrc location=rtmp://ip:port/xxx ! flvdemux ! h264parse ! nvv4l2decoder ! nvvidconv ! nvjpegenc ! multifilesink location='%03d.jpeg'

the result jpeg is green


But when replacing nvv4l2decoder with avdec_h264 or replacing videosrc with local video file, the jpeg is normal.
So how can i solve this problem and decode h264 and encode jpeg with GPU?

Hi,
Seems like h264parse is missing. Please run the command:

gst-launch-1.0 rtspsrc location=rtsp://192.168.10.46:8554/test ! rtph264depay ! h264parse ! nvv4l2decoder ! nvoverlaysink

And check if you see video preview.

It seems the pipeline dosen’t work with the h264parse plugin, there is no data in the last plugin. Using the pipeline without h264parse i can see video preview

Hi,
Please share your release version:

$ head -1 /etc/nv_tegra_release

Jetpack 4.3 is r32.3.1 but you mention r32.4.4. A bit confusing about the exact version. Certain issues may have been fixed in later releases.

R32 (release), REVISION: 4.3, GCID: 21589087, BOARD: t186ref, EABI: aarch64, DATE: Fri Jun 26 04:34:27 UTC 2020

Exactly I tyied use pipeline in the envirment of jetpack 4.3 in linux and in the container nvcr.io/nvidia/l4t-base:r32.4.4, both of its have this problem.

It seems that the problem will appear when the plugin nvv4l2decoder link nvjpegenc.
gst-launch-1.0 rtspsrc location=rtsp://xxx ! rtph264depay ! nvv4l2decoder ! nvvidconv ! tee name=thread ! queue ! filesink location=video.raw thread. ! jpegenc ! multifilesink location='%03d.nvjpegdec.jpeg'
The jpeg is OK.

Hi,
Are you able to try Jetpack 4.5.1(r32.5.1)?

For nvjpegenc, you would try using I420 format in NVMM:

gst-launch-1.0 rtspsrc location=rtsp://xxx ! rtph264depay ! nvv4l2decoder ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nvjpegenc ! multifilesink location='test_%03d.jpeg
2 Likes

Thanks a lot, it worked

I refershed TX2 to the updated version, and also has this problem.It looks adding caps is useful

Hi,
It is good to set caps. Probably something wrong in caps negotiation, if caps isn’t set exactly.

Thank Honey Patouceul for providing suggestion.

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