[TX2] deepstream 4.0 run failed with my own media file

Test environment:TX2+JetPack4.2.1+deepstream4.0
Below command failed:

deepstream-app -c source12_1080p_dec_infer-resnet_tracker_tiled_display_fp16_tx2.txt

output of the command:

nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream-4.0/samples/configs/deepstream-app$ deepstream-app -c source12_1080p_dec_infer-resnet_tracker_tiled_display_fp16_tx2.txt
Creating LL OSD context new
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so
gstnvtracker: Optional NvMOT_RemoveStreams not implemented
gstnvtracker: Batch processing is OFF

Runtime commands:
	h: Print this help
	q: Quit

	p: Pause
	r: Resume

NOTE: To expand a source in the 2D tiled display and view object details, left-click on the source.
      To go back to the tiled display, right-click anywhere on the window.


**PERF: FPS 0 (Avg)	FPS 1 (Avg)	FPS 2 (Avg)	FPS 3 (Avg)	FPS 4 (Avg)	FPS 5 (Avg)	FPS 6 (Avg)	FPS 7 (Avg)	FPS 8 (Avg)	FPS 9 (Avg)	FPS 10 (Avg)	FPS 11 (Avg)	
**PERF: 0.00 (0.00)	0.00 (0.00)	0.00 (0.00)	0.00 (0.00)	0.00 (0.00)	0.00 (0.00)	0.00 (0.00)	0.00 (0.00)	0.00 (0.00)	0.00 (0.00)	0.00 (0.00)	0.00 (0.00)	
** INFO: <bus_callback:163>: Pipeline ready

Creating LL OSD context new
** INFO: <bus_callback:149>: Pipeline running

ERROR from src_bin_muxer: Input buffer number of surfaces (1196185182) must be equal to mux->num_surfaces_per_frame (1)
	Set nvstreammux property num-surfaces-per-frame appropriately

Debug info: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvmultistream/gstnvstreammux.c(308): gst_nvstreammux_chain (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstNvStreamMux:src_bin_muxer
Quitting
ERROR from qtdemux9: Internal data stream error.
Debug info: qtdemux.c(6073): gst_qtdemux_loop (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin10/GstURIDecodeBin:src_elem/GstDecodeBin:decodebin10/GstQTDemux:qtdemux9:
streaming stopped, reason error (-5)
ERROR from src_bin_muxer: Input buffer number of surfaces (1196185182) must be equal to mux->num_surfaces_per_frame (1)
	Set nvstreammux property num-surfaces-per-frame appropriately

Debug info: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvmultistream/gstnvstreammux.c(308): gst_nvstreammux_chain (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstNvStreamMux:src_bin_muxer
App run failed

The only change I made to the config file is to replace the media file with my own:

#uri=file://../../streams/sample_1080p_h264.mp4
uri=file://../../streams/1.mp4

Here is the config file:

# Copyright (c) 2019 NVIDIA Corporation.  All rights reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA Corporation is strictly prohibited.

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5
#gie-kitti-output-dir=streamscl

[tiled-display]
enable=1
rows=4
columns=3
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
uri=file://../../streams/1.mp4
num-sources=12
#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

[sink0]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File
type=5
sync=1
source-id=0
gpu-id=0
qos=0
nvbuf-memory-type=0
overlay-id=1

[sink1]
enable=0
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265
codec=1
sync=0
#iframeinterval=10
bitrate=2000000
output-file=out.mp4
source-id=0

[sink2]
enable=0
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming
type=4
#1=h264 2=h265
codec=1
sync=0
bitrate=4000000
# set below properties in case of RTSPStreaming
rtsp-port=8554
udp-port=5400

[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=Serif
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
##Boolean property to inform muxer that sources are live
live-source=0
batch-size=12
##time out in usec, to wait after the first buffer is available
##to push the batch even if the complete batch is not formed
batched-push-timeout=40000
## Set muxer output width and height
width=1920
height=1080
##Enable to maintain aspect ratio wrt source, and allow black borders, works
##along with width, height properties
enable-padding=0
nvbuf-memory-type=0

# config-file property is mandatory for any gie section.
# Other properties are optional and if set will override the properties set in
# the infer config file.
[primary-gie]
enable=1
gpu-id=0
model-engine-file=../../models/Primary_Detector_Nano/resnet10.caffemodel_b12_fp16.engine
batch-size=12
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
interval=4
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary_nano.txt

[tracker]
enable=1
tracker-width=480
tracker-height=272
#ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_iou.so
ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so
#ll-config-file required for IOU only
#ll-config-file=iou_config.txt
gpu-id=0

[tests]
file-loop=0

Below is the output of ffprobe and mediainfo:

luis@luis-dm:/media/luis/d$ ffprobe 1.mp4
ffprobe version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.27.102
  Duration: 00:44:54.52, start: 3.586000, bitrate: 2698 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 39 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 2654 kb/s, 24.97 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
luis@luis-dm:/media/luis/d$ mediainfo 1.mp4
General
Complete name                            : 1.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 867 MiB
Duration                                 : 44mn 54s
Overall bit rate mode                    : Variable
Overall bit rate                         : 2 698 Kbps
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00
Writing application                      : Lavf58.27.102

Video
ID                                       : 2
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Format settings, GOP                     : M=4, N=25
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 44mn 54s
Bit rate                                 : 2 655 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 24.975 fps
Minimum frame rate                       : 5.000 fps
Maximum frame rate                       : 25.000 fps
Original frame rate                      : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.051
Stream size                              : 853 MiB (98%)
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio
ID                                       : 1
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 44mn 54s
Bit rate mode                            : Variable
Bit rate                                 : 39.1 Kbps
Maximum bit rate                         : 40.0 Kbps
Channel(s)                               : 2 channels
Channel(s)_Original                      : 1 channel
Channel positions                        : Front: C
Sampling rate                            : 16.0 KHz
Frame rate                               : 15.625 fps (1024 spf)
Compression mode                         : Lossy
Stream size                              : 12.6 MiB (1%)
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00

Any idea?

Hi,
Could you modify the config file to single source and give it a try:

[tiled-display]
rows=1
columns=1

[source0]
num-sources=1

[streammux]
batch-size=1

[primary-gie]
batch-size=1

Thanks, DaneLLL. I did make the change as you suggested. But no good luck.Anyway, I am going to test rtsp source. So let’s put it aside.

Hi,
Could you try the case of disabling [streammux] and [tiled-display]? The two elements are not required in single source.

hi,
my issue, like up that.
uri=file://…/…/samples/streams/1920_image.jpg
and if the picture is 1280720 is ok.
but if i put picture is 1920
1080 get the error

create_multi_source_bin
Creating LL OSD context new
Deserialize yoloLayerV3 plugin: yolo_83
Deserialize yoloLayerV3 plugin: yolo_95
Deserialize yoloLayerV3 plugin: yolo_107
0:00:01.426319404 20281 0x7f7d94002320 WARN basesrc gstbasesrc.c:3583:gst_base_src_start_complete: pad not activated yet
0:00:01.426494050 20281 0x7f7d94002320 WARN basesrc gstbasesrc.c:3583:gst_base_src_start_complete: pad not activated yet

Runtime commands:
h: Print this help
q: Quit

p: Pause
r: Resume

NOTE: To expand a source in the 2D tiled display and view object details, left-click on the source.
To go back to the tiled display, right-click anywhere on the window.

** INFO: <bus_callback:163>: Pipeline ready

(deepstream-app:20281): GLib-GObject-WARNING **: 17:05:10.518: g_object_set_is_valid_property: object class ‘GstNvJpegDec’ has no property named ‘DeepStream’
0:00:01.429584794 20281 0x5597ae4a4590 WARN videodecoder gstvideodecoder.c:2443:gst_video_decoder_chain: Received buffer without a new-segment. Assuming timestamps start from 0.
Using GPU 0 (GeForce GTX 1080 Ti, 28 SMs, 2048 th/SM max, CC 6.1, ECC off)
YUV 4:2:0 chroma subsampling
0:00:01.433043540 20281 0x5597ae4a4590 WARN video-info video-info.c:662:gst_video_info_to_caps: invalid matrix 4 for RGB format, using RGB
0:00:01.433055806 20281 0x5597ae4a4590 WARN video-info video-info.c:662:gst_video_info_to_caps: invalid matrix 4 for RGB format, using RGB
** INFO: <bus_callback:149>: Pipeline running

Creating LL OSD context new
NvJPEG decode complete
size set = 64
0:00:01.475980530 20281 0x5597ae572770 WARN nvstreammux gstnvstreammux.c:408:gst_nvstreammux_chain:<src_bin_muxer> error: memory type configured and i/p buffer mismatch ip_surf 3 muxer 0
0:00:01.476053042 20281 0x5597ae572770 WARN queue gstqueue.c:1566:gst_queue_loop: error: Internal data stream error.
0:00:01.476058304 20281 0x5597ae572770 WARN queue gstqueue.c:1566:gst_queue_loop: error: streaming stopped, reason error (-5)
ERROR from src_bin_muxer: memory type configured and i/p buffer mismatch ip_surf 3 muxer 0
Debug info: gstnvstreammux.c(408): gst_nvstreammux_chain (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstNvStreamMux:src_bin_muxer
ERROR from queue: Internal data stream error.
Debug info: gstqueue.c(1566): gst_queue_loop (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstQueue:queue:
streaming stopped, reason error (-5)
Quitting
App run failed

Hi legacy.wang,
You may make a new post for your issue. This thread is to run resnet with rtsp source. Yours is to run yolo with single jpeg.

Hi DaneLLL,

I am having the sameproblem of not having able to run the “/deepstream_sdk_v4.0.1_x86_64/sources/objectDetector_Yolo” sample using default deepstream-app with my own video on Tesla P100.

I am using

I changed only the uri in the source. I tried the experiments listed above but it didn’t work.

Hi mohit21sharma.ms,
The default video file is 1920x1080. You may check if your video file is in same resolution.
If the issue is still present, please attach the video file so that we can try to reproduce the issue.