Dewarper plugin

Hello,

I downloaded DS 3.0 and I am trying to use the dewarper plugin.

I have started with the example given in the documentation, which works well:

gst-launch-1.0 filesrc location=streams/sample_cam6.mp4 ! qtdemux ! h264parse ! \
nvdec_h264 ! nvvidconv ! nvdewarper config-file=configs/deepstream-app/config_dewarper.txt ! \
m.sink_0 nvstreammux name=m width=960 height=752 batch-size=4 ! nvmultistreamtiler ! nveglglessink

I just can’t understand the type of data at the output of the dewarper. According to the documentation, it is a buffer containing four “surfaces”.

In my use case, I only need two surfaces, with different processings. How can I extract those two frames from the four provided?
I already tried some combinations of nvstreammux / nvstreamdemux with no result, and gst-inspect didn’t helped so far.

Thank you for your help.

Aurélien

Hello,

I kept investigating on this and I found a few elements about the dewarper’s output.

It seems that the four buffers keep the same stream ID. As nvstreamdemux separates buffers in batch according to this ID, it can’t be used to get one particular surface generated by the dewarper.

The four buffers are stored in the “buf_data” structure, as one can see here for example: [url]https://github.com/vat-nvidia/deepstream-plugins/blob/bbe2231838ffb4bd3d25a2d6992f0908b8068e92/sources/plugins/gst-yoloplugin-tesla/gstyoloplugin.cpp#L511[/url].

I tried using nvvidconv ! capsfilter caps=“video/x-raw” to get back those buffers in RAM, but it only grab the first one. Is there any way to choose the buffer to extract, or to get all of them? Or should I write some piece of code to access the “buf_data” structure?

Aurélien

How do you get the first one ?

4 buffers are saved in NvBufSurface → *buf_data[MAX_NVBUFFERS]

Thank you for your answer.

I get the first buffer with nvvidconv, with caps on “video/x-raw” (without “(memory:NVMM)”).

For example, I changed the command line given in my first message with this conversion:

gst-launch-1.0 filesrc location=streams/sample_cam6.mp4 ! qtdemux ! h264parse ! \
nvdec_h264 ! nvvidconv ! nvdewarper config-file=configs/deepstream-app/config_dewarper.txt ! \
nvvidconv ! capsfilter caps="video/x-raw" ! videoconvert ! ximagesink

This code only displays the first buffer.

Did you try to change config_dewarper.txt → surface-index order ?