DeepStream 3.0 Error saving source video stream to file using sink group configuration

Here’s my source and sink in configuration file. I want to save the source 0 video stream to an .mp4 file using sink0.

[source0]
enable=1
type=2
uri=rtsp://admin:test123@192.168.0.135:554
num-sources=1
latency=200


[sink0]
enable=1
type=3
container=1
codec=1
sync=0
output-file=out0.mp4
source-id=0

Following is the error I am receiving. What am I dong wrong here?

>>> Using TRT model serialized engine /home/nvidia/Desktop/SafeSite/Master-branch/config/../models/Secondary_CarMake/resnet18.caffemodel_b16_int8.engine crypto flags(0)
>>> Using TRT model serialized engine /home/nvidia/Desktop/SafeSite/Master-branch/config/../models/Secondary_CarColor/resnet18.caffemodel_b16_int8.engine crypto flags(0)
>>> Using TRT model serialized engine /home/nvidia/Desktop/SafeSite/Master-branch/config/../models/Secondary_VehicleTypes/resnet18.caffemodel_b16_int8.engine crypto flags(0)
>>> Using TRT model serialized engine /home/nvidia/Desktop/SafeSite/Master-branch/config/../models/Primary_Detector/resnet10.caffemodel_b4_int8.engine crypto flags(0)
cb_sourcesetup set 200 latency
cb_sourcesetup set 200 latency

Runtime commands:
	h: Print this help
	q: Quit

	p: Pause
	r: Resume

	z<row-index(0-9)><column-index(0-9)>: Expand a source from the 2D tile array
	u: Go back to 2D tile array


**PERF: FPS 0 (Avg)	FPS 1 (Avg)	
**PERF: 0.00 (0.00)	0.00 (0.00)	
** INFO: <bus_callback:104>: Pipeline ready

** INFO: <bus_callback:90>: Pipeline running

NvMMLiteOpen : Block : BlockType = 261 
NvMMLiteBlockCreate : Block : BlockType = 261 
Allocating new output: 2560x1440 (x 20), ThumbnailMode = 0
OPENMAX: HandleNewStreamFormat: 3528: Send OMX_EventPortSettingsChanged: nFrameWidth = 2560, nFrameHeight = 1440 
NvMMLiteOpen : Block : BlockType = 261 
Framerate set to : 0 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4 
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
NvMMLiteBlockCreate : Block : BlockType = 261 
H264: Profile = 66, Level = 40 
nvstreamtiler: batchSize set as 4
Allocating new output: 2560x1440 (x 20), ThumbnailMode = 0
OPENMAX: HandleNewStreamFormat: 3528: Send OMX_EventPortSettingsChanged: nFrameWidth = 2560, nFrameHeight = 1440 
** INFO: <bus_callback:90>: Pipeline running

**PERF: 0.00 (0.00)	0.00 (0.00)	
**PERF: 3.40 (3.40)	0.00 (0.00)	
**PERF: 0.14 (0.49)	0.00 (0.00)	
**PERF: 0.25 (0.42)	0.25 (0.25)	
**PERF: 0.56 (0.47)	0.56 (0.45)	
avg/max bitrate=0 for VBR_MINQP, force to CQP mode
**PERF: 0.00 (0.47)	0.00 (0.45)	
ERROR from sink_sub_bin_mux1: Could not multiplex stream.
Debug info: gstqtmux.c(4553): gst_qt_mux_add_buffer (): /GstPipeline:pipeline/GstBin:processing_bin_0/GstBin:sink_bin/GstBin:sink_sub_bin1/GstQTMux:sink_sub_bin_mux1:
Buffer has no PTS.
ERROR from sink_sub_bin_encoder1: Internal data stream error.
Debug info: /dvs/git/dirty/git-master_linux/external/gstreamer/gst-omx/omx/gstomxvideoenc.c(1383): gst_omx_video_enc_loop (): /GstPipeline:pipeline/GstBin:processing_bin_0/GstBin:sink_bin/GstBin:sink_sub_bin1/GstOMXH264Enc-omxh264enc:sink_sub_bin_encoder1:
stream stopped, reason error
Quitting
ERROR from sink_sub_bin_mux1: Could not multiplex stream.
Debug info: gstqtmux.c(4553): gst_qt_mux_add_buffer (): /GstPipeline:pipeline/GstBin:processing_bin_0/GstBin:sink_bin/GstBin:sink_sub_bin1/GstQTMux:sink_sub_bin_mux1:
Buffer has no PTS.
ERROR from sink_sub_bin_queue1: Internal data stream error.
Debug info: gstqueue.c(988): gst_queue_handle_sink_event (): /GstPipeline:pipeline/GstBin:processing_bin_0/GstBin:sink_bin/GstBin:sink_sub_bin1/GstQueue:sink_sub_bin_queue1:
streaming stopped, reason error (-5)
NVMEDIA: cbDisplayPicture: 1738: Retunred NULL Frame Buffer 
NVMEDIA: cbDisplayPicture: 1738: Retunred NULL Frame Buffer 
App run failed

Hi,
In the example, it also configures bitrate:

enable=0
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265 3=mpeg4
codec=1
sync=0
<b>bitrate=2000000</b>
output-file=out.mp4
source-id=0

Please add it and give it a try.

If I add bitrate, it gives the following error:

Using winsys: x11 
>>> Using TRT model serialized engine /home/nvidia/Desktop/SafeSite/Master-branch/config/../models/Secondary_CarMake/resnet18.caffemodel_b16_int8.engine crypto flags(0)
>>> Using TRT model serialized engine /home/nvidia/Desktop/SafeSite/Master-branch/config/../models/Secondary_CarColor/resnet18.caffemodel_b16_int8.engine crypto flags(0)
>>> Using TRT model serialized engine /home/nvidia/Desktop/SafeSite/Master-branch/config/../models/Secondary_VehicleTypes/resnet18.caffemodel_b16_int8.engine crypto flags(0)
>>> Using TRT model serialized engine /home/nvidia/Desktop/SafeSite/Master-branch/config/../models/Primary_Detector/resnet10.caffemodel_b4_int8.engine crypto flags(0)
cb_sourcesetup set 200 latency
cb_sourcesetup set 200 latency

Runtime commands:
	h: Print this help
	q: Quit

	p: Pause
	r: Resume

	z<row-index(0-9)><column-index(0-9)>: Expand a source from the 2D tile array
	u: Go back to 2D tile array

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)	
**PERF: 0.00 (0.00)	0.00 (0.00)	
** INFO: <bus_callback:104>: Pipeline ready

** INFO: <bus_callback:90>: Pipeline running

NvMMLiteOpen : Block : BlockType = 261 
NvMMLiteBlockCreate : Block : BlockType = 261 
Allocating new output: 2560x1440 (x 20), ThumbnailMode = 0
OPENMAX: HandleNewStreamFormat: 3528: Send OMX_EventPortSettingsChanged: nFrameWidth = 2560, nFrameHeight = 1440 
NvMMLiteOpen : Block : BlockType = 261 
NvMMLiteBlockCreate : Block : BlockType = 261 
Allocating new output: 2560x1440 (x 20), ThumbnailMode = 0
OPENMAX: HandleNewStreamFormat: 3528: Send OMX_EventPortSettingsChanged: nFrameWidth = 2560, nFrameHeight = 1440 
nvstreamtiler: batchSize set as 4
Killed

Hi,
We can run it by modifying
/home/nvidia/deepstream_sdk_on_jetson/samples/configs/deepstream-app/source4_720p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt

[sink0]
<b>enable=0</b>
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming 5=Overlay
type=2
sync=1
display-id=0
offset-x=0
offset-y=0
width=0
height=0
overlay-id=1
source-id=0

[sink1]
<b>enable=1</b>
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265 3=mpeg4
codec=1
sync=0
bitrate=2000000
output-file=out.mp4

You may try to run the successful case first, and compare your case to this working case.

source4_720p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt has an existing video file (sample_720p.mp4) as source, not an IP camera stream. Existing video files can be written by modifying depstream 3.0 config. I am having issues writing the IP camera streams.

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=3
uri=file://../../streams/sample_720p.mp4
num-sources=4

I’d suspect the URI to be invalid with relative path. You may try to give absolute path to your file.

Hi shejuti,

Have you managed to resolve this issue?
Any result can be shared?

Thanks

Hi shejuti,

We have released the DeepSteam SDK 4.0 at last week, please try to move this new version for more features and supports, see [url]Announcing DeepStream SDK 4.0 - Announcements - NVIDIA Developer Forums

Thanks