How can I get jpeg data from the output of nvjpegenc plug-in?

hi.I am developing my program in Xavier NX platform.I can use nvjpegenc plugin to encode YUV to jpeg by following command:get-launch-1.0 filesrc location=video.yuv ! videoparse format=nv12 width=1920 height=1080 framerate=1/1 ! nvvideoconvert ! nvjpegenc ! filesink location=www.jpg -e.Using this command,I can get the www.jpg file in current directory.But when I use same element to create a pipeline in C program,I can’t find appropriate method to access the output jpeg data In addition to using filesink element to save file.I try to use ‘get_pad_add_probe’ function to add probe to the nvjpegenc element src pad.But I can’t get the correct jpeg data from GstBuffer structure in callback function。Please help to analyze the problem。

Hi,
You can use appsink. Please check the sample in


It is a video decoding pipeline. Please replace it with the pipeline :

filesrc location=video.yuv ! videoparse format=nv12 width=1920 height=1080 framerate=1/1 ! nvvideoconvert ! nvjpegenc ! appsink

And you should get compressed JPEG data in new_buffer().