1

Trying to run object detection algorithms in jetson nano (ubuntu 18.4) and Gstreamer cannot open the video files because of this warning in the Gstreamer. I have Gstreamer 1.14.5 version. (I tried .avi, .mp4 and .MOV).

It also appeared these warnings:

"Gstreamer warning:unable to start pipeline" and

"Gstreamer warning: Embedded video playback halted; module avidemux0 reported: Internal data stream error."

The code:

if __name__ == '__main__':
args = arg_parse()
confidence = float(args.confidence)
start = 0

CUDA = torch.cuda.is_available()

num_classes = 80

CUDA = torch.cuda.is_available()

videofile = args.video



# start the file video stream thread and allow the buffer to
# start to fill
print("[INFO] starting video file thread...")
fvs = FileVideoStream(videofile).start()
time.sleep(1.0)
# start the FPS timer
fps = FPS().start()

# loop over frames from the video file stream
while fvs.more():

    try:
        # grab the frame from the threaded video file stream, resize
        # it, and convert it to grayscale (while still retaining 3
        # channels)
        frame = fvs.read()
        frame = imutils.resize(frame, width=800)
        frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
        frame = np.dstack([frame, frame, frame])

        fps.update()
        # stop the timer and display FPS information
        fps.stop()
        print()
        print("[INFO] elasped time: {:.2f}".format(fps.elapsed()))
        print("[INFO] approx. FPS: {:.2f}".format(fps.fps()))
        print("[INFO] Accuracy: {:.2f}%".format(np.clip((accuracy/(frames+1))*100,1,100)))

        PIL_image = Image.fromarray(np.uint8(frame)).convert('RGB')
        original_image = PIL_image
        # original_image = original_image.convert('RGB')
        ret = detect(original_image, min_score=confidence, max_overlap=0.1, top_k=200)
        ret = np.asarray(ret)
        cv2.imshow("frame", ret)

        frames+=1

        key = cv2.waitKey(1)
        if key & 0xFF == ord('q'):
            break
        continue
    except:
        pass

How will i fix it? Thanks.

Chris K.
  • 13
  • 1
  • 6

0 Answers0