It seems nvvideoconvert scales the biggest surface to the same resolution as the smallest one.
How can I convert input surfaces to CUDA UNIFIED, converting to RGBA, but respecting the original resolution.
I don’t want to make resolution uniform between all the buffers in the batch.
I also checked doing it manually with NvBufSurfaceCopy(), but it seems the NvBufSurface API doesn’t permit support of multiple resolution.
When I call NvBufSurfaceCreate() with batch of 2, I cannot specify a different resolution for the buffers.
You refer to the documentation and say new streammux can’t accept different resolutions.
In the documentation it is said:
New nvstreammux do not transform/scale batched buffers to a single color-format/resolution unlike the default nvstreammux. A batch can have buffers from different streams of different resolutions and formats.
When we have plugins that could transform the input buffers (example: change resolution or color format of video buffers in the batch) between nvstreammux and nvstreamdemux, we need to ensure nvstreammux output is homogeneous (meaning buffers from all sources in the batch shall have same resolution and color format). This is a limitation in the new nvstreammux and shall be addressed in upcoming releases.
I am not using nvstreamdemux, so the documentation is not clear at all.
Here is the key description “a single resolution for this heterogeneous batched buffer is invalid and the muxer’s source-pad-caps is not valid either.” , the solution is converting different resolutions to the same resolution, like this:
uridecodebin ! nvvideoconvert ! “video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12” ! m.sink_0
uridecodebin ! nvvideoconvert ! “video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12” ! m.sink_1
nvstreammux name=m batch-size=2 ! fakesink async=0