if obj_counter[PGIE_CLASS_ID_PERSON] != obj_counter[SGIE_CLASS_ID_HELMET]: track_id = obj_meta.object_id now = time.time() if flag==0 and track_id != last_track_id: #print(str(track_id) + ' -- ' + str(last_track_id)) n_frame = pyds.get_nvds_buf_surface(hash(gst_buffer), frame_meta.batch_id) frame_copy = np.array(n_frame, copy=True, order='C') frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_RGBA2BGRA) last_track_id = track_id save_image = True print('Photo') takenow = time.time() flag = 1 TAKE_PHOTO = True if now>takenow+5: print('Reset') flag = 0 else: TAKE_PHOTO = False try: l_obj=l_obj.next except StopIteration: break if save_image: img_path = "{}/stream_{}_frame_{}.jpg".format(folder_name, frame_meta.pad_index, frame_number) print(img_path) cv2.imwrite(img_path, frame_copy)
Its works like I wanted.
But I had problem with orginal img_path provided in example below. frame_{} folder wasnt created. I don’t know if I missed the part for that folder creation but I changed it to stream_{}_frame{}
hello I have tried using deepstream-imagedata-multistream but for me it shows bus error , segmentation fault after saving 1-2 frames . If I comment n_frame = pyds.get_nvds_buf_surface(hash(gst_buffer), rame_meta.batch_id) Then there is no probelm arising, could you help me to figure out this problem. I have been stuck with it for long . I have tesla k40 gpu, and all other applications are working fine except when I try to extract frame meta…