Dynamically changing input resolution of RTSP streams

• Hardware Platform (Jetson / GPU) Jetson
• DeepStream Version 6.1
• JetPack Version (valid for Jetson only) 5.0.2
• TensorRT Version 8.4.1
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs) Question

This is regarding one of the topic I posted earlier:

I am using nvurisrcbin for reading and decoding RTSP streams.
Is there any probes, or callback functions I can use inside it to detect the change in input resolution?

my pipeline is basically:

nvurisrcbin → streammux → nvinfer → fakesink

In the previous post you mentioned that the decoder plugin can detect changes in width and height. How to achieve this?

I think that DeepStream checks the input resolution only at the start of the stream and continues fixating on that resolution. Please correct me if I’m wrong.

after decoding, you can know the resolution change. you can add a src probe on nvurisrcbin, please refer to this FAQ for how to get width and height.

after decoding the encoded data, the decoder will know the new with and height. please refer to the comment above.

@fanzh

After changing the input resolution (1280x720 → 1920x1080), this is the image I’m getting. You can see the pixelation happening all over the image. Also the image resolution is unchanged.

is the source the physical camera or virtual rtspserver? how did you imitate changing input resolution? how did you get the image?

@fanzh The source is a physical camera. We have the access to remotely change the camera configuration settings (resolution, frame rate, bitrate, etc.).

I have added a probe on the sinkpad of the streammux to pull the frame.

n_frame = pyds.get_nvds_buf_surface(hash(gst_buffer), 0)
frame_image = np.array(n_frame, copy=True, order="C")
frame = cv2.cvtColor(frame_image, cv2.COLOR_RGBA2BGRA)

Thanks for the sharing! I will try to reproduce this issue.

  1. do every saved frame have pixelation issue after changing resolution?
  2. if connecting nv3dsink, is the rendering fine?

@fanzh

  1. Yes, almost every frame has pixelation issue after the resolution is changed.
  2. Haven’t tried this. In our application, we want individual frames. That’s why we are pulling the frames and not saving the video.

I can’t reproduce this issue on xavier with DS6.1.1. here is my test detail.

  1. execute “cat sample_720p.h264 sample_1080p_h264.h264 > 720p_1080p.h264” to make a local file.
  2. execute “python3 deepstream_test_3.py -i file:///home/nvnv123/720p_1080p.h264 --file-loop”. all the saved jpg files are fine. the jpg resolution includes 720p and 1080p. here is the codedeepstream_test_3.py (16.1 KB)
    .

@fanzh I’m not sure about the local video file. Maybe it could be working there.

But suppose let’s consider the same test setup you are using. There will be a point in which a transition happens in the pipeline from 720p to 1080p. Is there any way to detect that? I mean not checking the output image but rather some way to check within the nvurisrcbin plugin itself.

There is no update from you for a period, assuming this is not an issue any more. Hence we are closing this topic. If need further support, please open a new one. Thanks.
please refer to decoder_src_pad_event_probe in opt\nvidia\deepstream\deepstream-6.4\sources\apps\audio_apps\deepstream_asr_app\deepstream_asr_pipeline.c. you can add a event probe on decoder plugin 's src. when output resolution changed, the probe will get GST_EVENT_CAPS event, then you can get the new resolution.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.