Deepstream num-sources issues

I can’t understand the role of “num-sources” in “source group”. If I want to enter two different sources, I can set source0 and source1. I can’t understand the meaning of setting num-sources=4 in source0, because they are from the same video.
the sample configure file is following:

[tiled-display]
enable=1
rows=2
columns=2
width=1280
height=720
gpu-id=0
#(0): nvbuf-mem-default - Default memory allocated, specific to particular platform
#(1): nvbuf-mem-cuda-pinned - Allocate Pinned/Host cuda memory applicable for Tesla
#(2): nvbuf-mem-cuda-device - Allocate Device cuda memory applicable for Tesla
#(3): nvbuf-mem-cuda-unified - Allocate Unified cuda memory applicable for Tesla
#(4): nvbuf-mem-surface-array - Allocate Surface Array memory, applicable for Jetson
nvbuf-memory-type=0

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=3
uri=file://../../streams/sample_1080p_h264.mp4
num-sources=4
#drop-frame-interval=2
gpu-id=0
# (0): memtype_device   - Memory type Device
# (1): memtype_pinned   - Memory type Host Pinned
# (2): memtype_unified  - Memory type Unified
cudadec-memtype=0

if I enter four uri information like"

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=3
uri=file://../../streams/sample_1080p_h264.mp4
uri=file://../../streams/sample_1.mp4
uri=file://../../streams/sample_2.mp4
uri=file://../../streams/sample_3.mp4
num-sources=4
#drop-frame-interval=2
gpu-id=0
# (0): memtype_device   - Memory type Device
# (1): memtype_pinned   - Memory type Host Pinned
# (2): memtype_unified  - Memory type Unified
cudadec-memtype=0

it will only read the file at the bottom “sample_3.mp4”

So what’s the role of “num-sources” and how to use it? By the way, what’s the difference between “multiURI” and “URI”? Thanks

if I enter four uri information like"

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=3
uri=file://../../streams/sample_1080p_h264.mp4
uri=file://../../streams/sample_720p.mp4
num-sources=4
#drop-frame-interval=2
gpu-id=0
# (0): memtype_device   - Memory type Device
# (1): memtype_pinned   - Memory type Host Pinned
# (2): memtype_unified  - Memory type Unified
cudadec-memtype=0

it will only read the file at the bottom “sample_720p.mp4”

You can check the code:

deepstream_app_config_parser.c → line 259

Code is the best helper.

rename your input streams as source_0.mp4, source_1.mp4…
and specify uri=file:///home/ubuntu/source_%d.mp4
in the config file.