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.
Also:
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:
gst-launch-1.0
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
With new streammux what would be the way to add black border to keep the original image aspect ratio?
Old streammux had “enable-padding” property, how should I do to simulate the same behaviour?
@fanzh I know that.
But if I want to move to new streammux and have the same behaviour as the old one, is there a way to add padding with videoconvert or any other component?
Thanks @fanzh, I’ll try it, I now understand the dest-crop :)
Do you think support for multiple resolution will be added soon to the new streammux? Is it something in your roadmap?