How to save the result of deepstream-dewarper-test in mp4

• Hardware Platform (Jetson / GPU) :Jetson AGX Xavier
• DeepStream Version :5.1
• JetPack Version (valid for Jetson only) :4.5.1

When I ran the sample app, I confirmed that the undistorted video was displayed on the display.
I’m trying to make change the deepstream-dewarper-app.c to save the undistorted video.

I changed the as follows:
– sink = gst_element_factory_make (“nveglglessink”, “nvvideo-renderer”);
++ sink = gst_element_factory_make (“filesink”, “filesink”);
++ g_object_set(G_OBJECT(sink), “location”, “test.mp4”, NULL); .

When I run it after make, I get the following error in the terminal:
Now playing: file:/// -(secret)- /sources/apps/sample_apps/deepstream-dewarper-test/input_streams/105_2021-03-10_102826.mp4
Decodebin child added: source
Decodebin child added: decodebin0
Running…
Decodebin child added: qtdemux0
Decodebin child added: multiqueue0
Decodebin child added: h264parse0
Decodebin child added: capsfilter1
Decodebin child added: aacparse0
Decodebin child added: faad0
Decodebin child added: nvv4l2decoder0
Opening in BLOCKING MODE
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
In cb_newpad
In cb_newpad
ERROR from element qtdemux0: Internal data stream error.
Error details: qtdemux.c(6073): gst_qtdemux_loop (): /GstPipeline:dewarper-app-pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
streaming stopped, reason error (-5)
Returned, stopping playback
Deleting pipeline

How do I save the undistorted video?
Thank you.

How much do you know about mp4 video file? How much do you know about gstreamer basic knowledge and coding skills?

Why do you think you can save a hardware RGB buffer directly to a mp4 file?

There is sample code for save mp4 file in create_encode_file_bin() in deepstream_sink_bin.c in /opt/nvidia/deepstream/deepstream/sources/apps/apps-common/src/ folder.

Thank you for your quick reply.

I don’t understand the mp4 video file format and am a beginner about gstreamer.
It seems that I need to study with the sample code you taught me.

You’d better start with gstreamer and video format and container knowledge first before you start with any deepstream sample. GStreamer: open source multimedia framework

Thanks.
I achieved this aim, so describe the element configuration in the pipeline.
source_bin->nvvideoconvert1->capsfilter1->nvdewarper->streammux->nvvideoconvert2->capsfilter2->nvvideoconvert3->capsfilter3->x264enc->qtmux->sink