How to disable console output when decoding jpeg?

I’m running the example in jetson_multimedia_api/samples/06_jpeg_decode. Every time it runs, I see this output:

libv4l2_nvvidconv (0):(802) (INFO) : Allocating (1) OUTPUT PLANE BUFFERS Layout=0
libv4l2_nvvidconv (0):(818) (INFO) : Allocating (1) CAPTURE PLANE BUFFERS Layout=0

How do I disable this output?

I tried the suggestion from this post (export TEGRA_VIDEO_LOGS=0), but it doesn’t work as I still see the output from libv4l2_nvvidconv:

Hi,
In the sample NvVideoConverter is used but it can be replaced by NvBufferTransform(). We suggest modify the sample to use NvBufferTransform() so that the prints will not be shown.

I’m looking at the places that NvBufferTransform is used in the samples, and as someone completely new to this API, it’s not clear to me how to replace NvVideoConverter with NvBufferTransform in the 06_jpeg_decode sample code. Their interfaces are different, NvVideoConverter is a class while NvBufferTransform is a function, etc.

Are there any tips, pointers, or example code that you can provide to help?

Hi,
Please create NvBuffer in NvBufferColorFormat_YUV420 by calling NvBufferCreate()( or NvBufferCreateEx() ). And then call NvBufferTransform() after

      for (int i = 0; i < iterator_num; ++i)
      {
        ret = ctx.jpegdec->decodeToFd(fd, ctx.in_buffer, ctx.in_file_size, pixfmt,
            width, height);
        TEST_ERROR(ret < 0, "Could not decode image", cleanup);
      }

So that the decoded data will be put to the NvBuffer, same as what NvVideoConverter does.

Hi DaneLLL,

In the 06_jpeg_decode example which uses NvVideoConverter, a callback function is used that has NvBuffer in its signature, and then the callback function passes the NvBuffer object to write_video_frame().

If I instead use NvBufferTransform, the callback won’t be used, correct? If that’s the case, then how do I get an NvBuffer object after calling NvBufferTransform? NvBufferCreate() seems like it creates the NvBuffer internally and only exposes a file descriptor to me. But to write the outout image, I need an NvBuffer object, not just a file descriptor, correct? Am I supposed to use NvBuffer2Raw() to retrieve the image data from the NvBuffer file descriptor?

edit: I see in the 00_video_decode example that dump_dmabuf() is used for this. I will try that. Is this correct?

Hi,
Yes, please refer to dump_dmabuf() to save NvBuffer to a video file.

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