parameter "interval" in [primary-gie] only works for some video-files

Hello,
I have a really weird problem.
I want to run primary object detection every nth frame. I set the interval=n in [primary-gie]. As rendered output video I expect, that bounding boxes are drawn in every nth frame (tracker is disabled).

I tested two video-files “file1.mp4” and “file2.mp4”. In file1.mp4(original video) I get the expected output, in file2.mp4 (generated from file1.mp4, while each frame has been undistorted) the object detector runs on each frame.

I compared the video properties via mediainfo command and I get the exact same:

Complete name : file2.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 30.1 MiB
Duration : 1mn 31s
Overall bit rate : 2 755 Kbps
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00
Writing application : Lavf56.40.101

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1mn 31s
Bit rate : 2 754 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.100
Stream size : 30.1 MiB (100%)
Writing library : x264 core 148 r2643 5c65704
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

Any ideas for a solution?

Hi,
Is the issue seen in running deepstream-app? Or other deepstream-test* samples?
Please share steps so that we can reproduce the issue.

It occurs with both deepstream-app and deepstream-test5-app.
I use a custom yolo model.
I have the following config.

[source0]
enable=1
type=3
#uri=file:///home/nvidia/samples/sample_streams/file1.mp4 # works
uri=file:///home/nvidia/samples/sample_streams/file2.mp4 # doesn’t work
num-sources=5
gpu-id=0
nvbuf-memory-type=0

[sink2]
enable=1
type=3
container=1
codec=3
sync=1
bitrate=2000000
output-file=out.mp4
source-id=0

[osd]
enable=1
gpu-id=0
border-width=1
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Arial
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0

[streammux]
gpu-id=0
live-source=0
batch-size=5
batched-push-timeout=40000
width=608
height=608
enable-padding=0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
batch-size=5

0=FP32, 1=INT8, 2=FP16 mode

bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;1;1;1
bbox-border-color3=0;1;0;1
nvbuf-memory-type=0
interval=4
gie-unique-id=1
model-engine-file=model_b1_fp16.engine
config-file=config_infer_primary_yoloV3_tiny_custom.txt

[tracker]
enable=0
tracker-width=608
tracker-height=608
ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so
gpu-id=0
enable-batch-process=0

It will be difficult to reproduce, because I can’t say, what is the difference between video file “file1.mp4” and “file2.mp4”.
I used the command mediainfo and they both have the properties listed in the first post. Are there any other commands to check the files differences.

file2.mp4 has been created as followed:
I took each frame from file1.mp4, undistorted it with the remap()-function of opencv, and generated a stream with those undistorted images again. Then I used ffmpeg to ensure h264 codec and so on. Following command has been applied.

ffmpeg -i undistorted_video.mp4 -refs 3 -x264opts b-pyramid=2 -profile:v high -level:v 4.0 -r 30 file2.mp4

I hope those steps help to reproduce the error or find a solution.

Hi,
Is the issue seen if you run the model downloaded from

# For yolo v3 tiny,
echo "Downloading yolov3-tiny config and weights files ... "
wget https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov3-tiny.cfg -q --show-progress
wget https://pjreddie.com/media/files/yolov3-tiny.weights -q --show-progress

Please also configure ‘interval=4’ in config_infer_primary_yoloV3_tiny_custom.txt and try again.

I tried that already. No success.

Hi,
If default deepstream_app_config_yoloV3_tiny.txt can be used to reproduce the issue, please share the video clip so that we can reproduce it and do further check.

When I find time, I try to reproduce it with the default yolo and come back to you.