I'm trying to run a simple multiprocessing system on a Jetson NANO device, flashed with Jetpack 4.5. I'm doing what I would usually do on a computer, so I have a main script, launcher.py
launcher.py
import multiprocessing as mp
from multiprocessing import set_start_method, Queue, Event
from camera_reader import Camera_Reader_Initializer
def main():
set_start_method("spawn")
cam_read = mp.Process(target=Camera_Reader_Initializer, args=())
cam_read.daemon = True
cam_read.start()
if __name__ == "__main__":
main()
which should launch the script camera.py (actually, together with a couple of other scripts) camera.py:
camera.py
print("check 00")
def Camera_Reader_Initializer():
print('check 01')
cam_read = Camera_Reader()
cam_read.run()
class Camera_Reader():
def __init__(self):
print('check 02)
self.source = "/dev/video0"
def run(self):
print('check 03')
input = jetson.utils.videoSource(self.source)
output = jetson.utils.videoOutput("")
while output.IsStreaming():
image = input.Capture(format='rgb8')
output.Render(image)
output.SetStatus(f"Video Viewer | {image.width:d}x{image.height:d} | {output.GetFrameRate():.1f} FPS")
However, when running launcher.py the only output I got is:
check 00
So, basically the cam_read object isn't created or run. Am I doing something wrong?