thank you for your reply.
It seems I misunderstood.
There’s no need to add “5 RGB, 6 RGBA” to the -f option.
./video_decode H264 --disable-rendering -o test.i420 -f 2 ../../data/Video/sample_outdoor_car_1080p_10fps.h264
Run the above command to convert from H264 to I420.
At that time, NvTransform is executed.
/* Perform Blocklinear to PitchLinear conversion. */
ret = NvBufSurf::NvTransform(&transform_params, dec_buffer->planes[0].fd, ctx->dst_dma_fd);
Then dump_dmabuf is executed.
/* Write raw video frame to file. */
if (!ctx->stats && ctx->out_file)
{
/* Dumping two planes for NV12, NV16, NV24 and three for I420 */
dump_dmabuf(ctx->dst_dma_fd, 0, ctx->out_file);
dump_dmabuf(ctx->dst_dma_fd, 1, ctx->out_file);
if (ctx->out_pixfmt == 2)
{
dump_dmabuf(ctx->dst_dma_fd, 2, ctx->out_file);
}
}
Inside dump_dmabuf, NvBufSurfaceMap is executed.
NvBufSurface *nvbuf_surf = 0;
ret = NvBufSurfaceFromFd(dmabuf_fd, (void**)(&nvbuf_surf));
ret = NvBufSurfaceMap(nvbuf_surf, 0, plane, NVBUF_MAP_READ_WRITE);
This process stores I420 data in “NvBufSurface *nvbuf_surf”.
After that, I am writing the I420 data to the stream.
I need to “convert I420 data to RGB or RGBA” between “get I420 data” and “write”.
Is the above understanding correct?
If so, how can I convert I420 data to RGB or RGBA?
In the query_and_set_capture function, there is a process to NvAllocate using NvBufSurfaceTag_VIDEO_CONVERT.
Does this process give you a hint?
thank you.