Doubts about deeepstream-test5-app for smart record event

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) - Jetson Nano
• DeepStream Version - 6.0.1
• JetPack Version (valid for Jetson only) - 4.6.3
• TensorRT Version - 8.4
• NVIDIA GPU Driver Version (valid for GPU only) - 10.2
• Issue Type( questions, new requirements, bugs) - this is regarding doubts for deepstream-test5-app for smart record event in storing local event ,i have done successfully compile deepstream -test5-app but when i set smart-record = 2 which is storing in local disk and this is ok fine but video which is storing continuously if i set total duration of the video and one more thing i am also wanted to know about where is it triggering smart record start and stop event.
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

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

[tiled-display]
enable=1
rows=1
columns=1
width=1280
height=720
gpu-id=0
nvbuf-memory-type=0

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=4
uri=rtsp://admin:Sieora123@192.168.1.108:554/cam/realmonitor?channel=1&subtype=0
num-sources=1
select-rtp-protocol=4
gpu-id=0

enable the record

nvbuf-memory-type=0

to store in local or cloud

smart-record = 2
smart-rec-container = 0
smart-rec-duration = 15

store only first five seconds

smart-rec-interval = 5
smart-rec-file-prefix=record.mp4
smart-rec-dir-path=record
smart-rec-cache=300

[sink0]
enable=1
type=2
#1=mp4 2=mkv
container=3
#1=h264 2=h265 3=mpeg4

only SW mpeg4 is supported right now.

codec=3
sync=1
bitrate=2000000
output-file=output.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
##Boolean property to inform muxer that sources are live
live-source=0
batch-size=1
##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

If set to TRUE, system timestamp will be attached as ntp timestamp

If set to FALSE, ntp timestamp from rtspsrc, if available, will be attached

attach-sys-ts-as-ntp=1

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
#Required to display the PGIE labels, should be added even when using config-file
#property
batch-size=1
#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=0
#Required by the app for SGIE, when used along with config-file property
gie-unique-id=1
nvbuf-memory-type=0
model-engine-file = Primary_Detector/resnet10.caffemodel_b1_gpu0_fp16.engine
labelfile-path= Primary_Detector/labels.txt
config-file = Primary_Detector/config_infer_primary_nano.txt
#infer-raw-output-dir=…/…/…/…/…/samples/primary_detector_raw_output/

The smart recording APIs are designed to record videos in period while the NvDsSRCreate() and NvDsSRStart() are evoked. You can also finish one of the videos before “defaultDuration” by NvDsSRStop(), another new video will be recorded after NvDsSRStop(). The recording only stops when the “recordbin” is changed to NULL state and removed from the pipeline. Smart Video Record — DeepStream 6.3 Release documentation

deepstream -test5-app is open source, you can refer to the source code for how the sample uses the smart recording APIs.

static gboolean
smart_record_event_generator (gpointer data)
{
NvDsSRSessionId sessId = 0;
NvDsSrcBin *src_bin = (NvDsSrcBin *) data;
guint startTime = 0;
guint duration = ;

if (src_bin->config->smart_rec_duration >= 0)
duration = src_bin->config->smart_rec_duration;

if (src_bin->config->smart_rec_start_time >= 0)
startTime = src_bin->config->smart_rec_start_time;

if (src_bin->recordCtx && !src_bin->reconfiguring) {
NvDsSRContext *ctx = (NvDsSRContext *) src_bin->recordCtx;
if (ctx->recordOn) {
NvDsSRStop (ctx, 0);
} else {
NvDsSRStart (ctx, &sessId, startTime, duration, NULL);
}
}
return TRUE;
}

everything should be done in smart_reocrd_event_generator function? and also i need to modify 10 seconds segment and total duration is 60 seconds

how to get smart record event instance or object in deepstream-test5 code

should we create pipeline element for recordbin then it can be able to change the pipeline status to null

Please read the deepstream-test5 code. smart_reocrd_event_generator () is a timer callback function. If you want to control the smart recording by your own “event”, you should remove the timer and control the NvDsSRStart() and NvDsSRStop() by your own logic.

The code is open source, you can add your own logic in the code.

kindly reply this one also it will be more useful for me

There is no smart record event. I don’t understand what does this mean?

deepstream-test5 is just a sample application, you can implement your own logic based on the deepstream-test5 source code. E.G. To make the smart recording context a global structure which can be accessed by the other parts of the app.

then it would not store record right

What do you mean? What is your requirement?

You can control smart record by the smart record APIs. Smart Video Record — DeepStream 6.2 Release documentation

ok tq

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