I tried running the code :
import jetson.inference
import jetson.utils
import time
import argparse
import sys
# create video output object
output = jetson.utils.videoOutput(f"output{time.time()}.mp4","--headless")
# load the object detection network
net = jetson.inference.detectNet("ssd-mobilenet-v2", threshold=0.5)
# create video sources
input = jetson.utils.videoSource("v4l2:///dev/video0")
# process frames until the user exits
while True:
# capture the next image
img = input.Capture()
# detect objects in the image (with overlay)
detections = net.Detect(img)
# print the detections
print("detected {:d} objects in image".format(len(detections)))
for detection in detections:
print(detection)
# render the image
output.Render(img)
# exit on input/output EOS
if not input.IsStreaming() or not output.IsStreaming():
break
Which produced the 1280x720 video (default). The timing was correct.
But the video is only 13fps.
I guess some other code runs when executing ./detectnet from the terminal.