viseron icon indicating copy to clipboard operation
viseron copied to clipboard

Error on Jetson Nano

Open jamitupya opened this issue 2 years ago • 16 comments

ETA: Love your work, looking forward to resolving my issues and getting to play with this.

Kind of stumped.

Receive this error on Front End Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 1681, in _execute result = self.prepare() File "/src/viseron/webserver/__init__.py", line 81, in prepare raise tornado.web.HTTPError(404) tornado.web.HTTPError: HTTP 404: Not Found

back-end boot with debug turned on looks like:

'[services.d] done. [2021-10-06 11:38:19] [INFO ] [viseron ] - ------------------------------------------- [2021-10-06 11:38:19] [INFO ] [viseron ] - Initializing... [2021-10-06 11:38:19] [DEBUG ] [viseron.watchdog ] - Starting scheduler [2021-10-06 11:38:19] [DEBUG ] [viseron ] - Starting cleanup scheduler [2021-10-06 11:38:19] [DEBUG ] [viseron ] - Running initial cleanup [2021-10-06 11:38:19] [DEBUG ] [viseron.cleanup ] - Running cleanup [2021-10-06 11:38:19] [DEBUG ] [viseron.cleanup ] - Items in /recordings/2021-10-06/Lorex_IR_2: 2 [2021-10-06 11:38:19] [INFO ] [viseron.mqtt ] - Initializing MQTT connection [2021-10-06 11:38:19] [DEBUG ] [viseron.mqtt ] - MQTT connected with returncode 0 [2021-10-06 11:38:19] [DEBUG ] [viseron.detector ] - Initializing object detector darknet [2021-10-06 11:38:19] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic */frame/scan/object, <queue.Queue object at 0x7f69b6e880> [2021-10-06 11:38:19] [DEBUG ] [viseron.detector ] - Object detector initialized [2021-10-06 11:38:19] [INFO ] [viseron ] - Initializing NVR threads [2021-10-06 11:38:19] [DEBUG ] [viseron.nvr.lorex_ir_2 ] - Initializing NVR thread [2021-10-06 11:38:19] [DEBUG ] [viseron.camera.lorex_ir_2] - Initializing camera Lorex_IR_2 [2021-10-06 11:38:19] [DEBUG ] [viseron.nvr.lorex_ir_3 ] - Initializing NVR thread [2021-10-06 11:38:19] [DEBUG ] [viseron.camera.lorex_ir_3] - Initializing camera Lorex_IR_3 [2021-10-06 11:38:19] [DEBUG ] [viseron.camera.stream.lorex_ir_2] - Getting stream information for rtsp://:@10.100.1.40:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif [2021-10-06 11:38:19] [DEBUG ] [viseron.camera.stream.lorex_ir_3] - Getting stream information for rtsp://:@10.100.1.41:554/cam/realmonitor?channel=1&subtype=0 [2021-10-06 11:38:21] [DEBUG ] [viseron.camera.stream.lorex_ir_3] - Stream information from FFprobe: Width: 3840 Height: 2160 FPS: 15.0 Video Codec: h264 Audio Codec: None [2021-10-06 11:38:21] [DEBUG ] [viseron.camera.lorex_ir_3] - Resolution: 3840x2160 @ 15 FPS [2021-10-06 11:38:21] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic lorex_ir_3/frame/decode/object, <queue.Queue object at 0x7f68302970> [2021-10-06 11:38:21] [DEBUG ] [viseron.camera.lorex_ir_3] - Starting decoder thread [2021-10-06 11:38:21] [DEBUG ] [viseron.camera.lorex_ir_3] - Running decoder lorex_ir_3.object_detection at 1.0s interval, every 15.0 frame(s) [2021-10-06 11:38:21] [DEBUG ] [viseron.camera.lorex_ir_3] - Camera Lorex_IR_3 initialized [2021-10-06 11:38:21] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic lorex_ir_3/frame/processed/object, <queue.Queue object at 0x7f682fd520> [2021-10-06 11:38:21] [DEBUG ] [viseron.motion.lorex_ir_3] - Initializing motion detector [2021-10-06 11:38:21] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic lorex_ir_3/frame/decode/motion, <queue.Queue object at 0x7f683161f0> [2021-10-06 11:38:21] [DEBUG ] [viseron.motion.lorex_ir_3] - Starting decoder thread [2021-10-06 11:38:21] [DEBUG ] [viseron.motion.lorex_ir_3] - Running decoder lorex_ir_3.motion_detection at 1s interval, every 15 frame(s) [2021-10-06 11:38:21] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic lorex_ir_3/frame/scan/motion, <queue.Queue object at 0x7f69b67790> [2021-10-06 11:38:21] [DEBUG ] [viseron.motion.lorex_ir_3] - Motion detector initialized [2021-10-06 11:38:21] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic lorex_ir_3/frame/processed/motion, <queue.Queue object at 0x7f682f54c0> [2021-10-06 11:38:21] [DEBUG ] [viseron.nvr.lorex_ir_3 ] - Starting camera [2021-10-06 11:38:21] [DEBUG ] [viseron.camera.lorex_ir_3] - Starting capture thread [2021-10-06 11:38:21] [DEBUG ] [viseron.recorder.lorex_ir_3] - Initializing ffmpeg recorder [2021-10-06 11:38:21] [DEBUG ] [viseron.camera.stream.lorex_ir_3] - FFMPEG decoder command: lorex_ir_3 -hide_banner -loglevel error -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts -use_wallclock_as_timestamps 1 -vsync 0 -stimeout 5000000 -c:v h264_nvv4l2dec -rtsp_transport tcp -i rtsp://:@10.100.1.41:554/cam/realmonitor?channel=1&subtype=0 -f segment -segment_time 5 -reset_timestamps 1 -strftime 1 -c:v copy -c:a none /segments/Lorex_IR_3/%Y%m%d%H%M%S.mp4 -filter:v fps=1 -f rawvideo -pix_fmt nv12 pipe:1 [2021-10-06 11:38:21] [DEBUG ] [viseron.nvr.lorex_ir_3 ] - Waiting for first frame [2021-10-06 11:38:21] [DEBUG ] [viseron.nvr.lorex_ir_3 ] - NVR thread initialized [2021-10-06 11:38:22] [DEBUG ] [viseron.camera.stream.lorex_ir_2] - Stream information from FFprobe: Width: 352 Height: 240 FPS: 10.0 Video Codec: h264 Audio Codec: None [2021-10-06 11:38:22] [DEBUG ] [viseron.camera.stream_segments.lorex_ir_2] - Getting stream information for rtsp://:@10.100.1.40:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=onvif [2021-10-06 11:38:23] [ERROR ] [viseron.camera.stream.lorex_ir_3] - NvMMLiteOpen : Block : BlockType = 261 [2021-10-06 11:38:23] [ERROR ] [viseron.camera.stream.lorex_ir_3] - NVMEDIA: Reading vendor.tegra.display-size : status: 6 [2021-10-06 11:38:23] [ERROR ] [viseron.camera.stream.lorex_ir_3] - NvMMLiteBlockCreate : Block : BlockType = 261 [2021-10-06 11:38:25] [DEBUG ] [viseron.camera.stream_segments.lorex_ir_2] - Stream information from FFprobe: Width: 3840 Height: 2160 FPS: 15.0 Video Codec: h264 Audio Codec: None [2021-10-06 11:38:25] [DEBUG ] [viseron.camera.lorex_ir_2] - Resolution: 704x480 @ 15 FPS [2021-10-06 11:38:25] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic lorex_ir_2/frame/decode/object, <queue.Queue object at 0x7f6831fcd0> [2021-10-06 11:38:25] [DEBUG ] [viseron.camera.lorex_ir_2] - Starting decoder thread [2021-10-06 11:38:25] [DEBUG ] [viseron.camera.lorex_ir_2] - Running decoder lorex_ir_2.object_detection at 1.0s interval, every 15.0 frame(s) [2021-10-06 11:38:25] [DEBUG ] [viseron.camera.lorex_ir_2] - Camera Lorex_IR_2 initialized [2021-10-06 11:38:25] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic lorex_ir_2/frame/processed/object, <queue.Queue object at 0x7f682f5af0> [2021-10-06 11:38:25] [DEBUG ] [viseron.motion.lorex_ir_2] - Initializing motion detector [2021-10-06 11:38:25] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic lorex_ir_2/frame/decode/motion, <queue.Queue object at 0x7f683287f0> [2021-10-06 11:38:25] [DEBUG ] [viseron.nvr.lorex_ir_3 ] - First frame received [2021-10-06 11:38:25] [DEBUG ] [viseron.motion.lorex_ir_2] - Starting decoder thread [2021-10-06 11:38:25] [DEBUG ] [viseron.motion.lorex_ir_2] - Running decoder lorex_ir_2.motion_detection at 1s interval, every 15 frame(s) [2021-10-06 11:38:25] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic lorex_ir_2/frame/scan/motion, <queue.Queue object at 0x7f683283a0> [2021-10-06 11:38:25] [DEBUG ] [viseron.motion.lorex_ir_2] - Motion detector initialized [2021-10-06 11:38:25] [DEBUG ] [viseron.data_stream ] - Subscribing to data topic lorex_ir_2/frame/processed/motion, <queue.Queue object at 0x7f68328220> [2021-10-06 11:38:25] [DEBUG ] [viseron.nvr.lorex_ir_2 ] - Starting camera [2021-10-06 11:38:25] [DEBUG ] [viseron.camera.lorex_ir_2] - Starting capture thread [2021-10-06 11:38:25] [DEBUG ] [viseron.recorder.lorex_ir_2] - Initializing ffmpeg recorder [2021-10-06 11:38:25] [DEBUG ] [viseron.camera.stream.lorex_ir_2] - FFMPEG decoder command: lorex_ir_2 -hide_banner -loglevel error -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts -use_wallclock_as_timestamps 1 -vsync 0 -stimeout 5000000 -c:v h264_nvv4l2dec -rtsp_transport tcp -i rtsp://:@10.100.1.40:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif -filter:v fps=1 -f rawvideo -pix_fmt nv12 pipe:1 [2021-10-06 11:38:25] [DEBUG ] [viseron.nvr.lorex_ir_2 ] - Waiting for first frame [2021-10-06 11:38:25] [DEBUG ] [viseron.nvr.lorex_ir_2 ] - NVR thread initialized [2021-10-06 11:38:25] [INFO ] [viseron ] - Initialization complete [2021-10-06 11:38:25] [DEBUG ] [viseron.camera.stream_segments.lorex_ir_2] - FFMPEG decoder command: lorex_ir_2_segments -hide_banner -loglevel error -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts -use_wallclock_as_timestamps 1 -vsync 0 -stimeout 5000000 -c:v h264_nvv4l2dec -rtsp_transport tcp -i rtsp://:@10.100.1.40:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=onvif -f segment -segment_time 5 -reset_timestamps 1 -strftime 1 -c:v copy -c:a none /segments/Lorex_IR_2/%Y%m%d%H%M%S.mp4 [2021-10-06 11:38:28] [ERROR ] [viseron.camera.stream.lorex_ir_2] - NvMMLiteOpen : Block : BlockType = 261 [2021-10-06 11:38:28] [ERROR ] [viseron.camera.stream.lorex_ir_2] - NVMEDIA: Reading vendor.tegra.display-size : status: 6 [2021-10-06 11:38:28] [ERROR ] [viseron.camera.stream.lorex_ir_2] - NvMMLiteBlockCreate : Block : BlockType = 261 [2021-10-06 11:38:33] [DEBUG ] [viseron.nvr.lorex_ir_3.object] - Objects: [], message repeated 3 times [2021-10-06 11:38:34] [DEBUG ] [viseron.nvr.lorex_ir_2 ] - First frame received [2021-10-06 11:39:08] [DEBUG ] [viseron.nvr.lorex_ir_3.object] - Objects: [], message repeated 35 times'

any ideas where to look?

jamitupya avatar Oct 06 '21 01:10 jamitupya

Could you show me your docker command?

roflcoopter avatar Oct 06 '21 05:10 roflcoopter

absolutely.

'docker run -d
-v /opt/nvr/media:/recordings
-v /opt/nvr/viseron:/config
-v /etc/localtime:/etc/localtime:ro
--name viseron
--runtime=nvidia
--privileged
--tmpfs /tmp
-p 8888:8888
roflcoopter/jetson-nano-viseron:latest'

jamitupya avatar Oct 06 '21 10:10 jamitupya

Try roflcoopter/jetson-nano-viseron:dev

The UI is very new and has not been released yet, but it is included in the dev image. I plan on creating a release later today hopefully.

roflcoopter avatar Oct 06 '21 10:10 roflcoopter

that resolved that issue, but now i'm in. i can not actually pull up a stream.

im guessing ffmpeg error has something to do with it [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 10-adduser: executing... ************************ UID/GID ************************* User uid: 0 User gid: 0 ************************** Done ************************** [cont-init.d] 10-adduser: exited 0. [cont-init.d] 20-gid-video-device: executing... [cont-init.d] 20-gid-video-device: exited 0. [cont-init.d] 30-edgetpu-permission: executing... ************** Setting EdgeTPU permissions *************** Coral Vendor IDs: "1a6e",ATTRS{idProduct}=="089a" "18d1",ATTRS{idProduct}=="9302" No EdgeTPU USB device was found ************************** Done ************************** [cont-init.d] 30-edgetpu-permission: exited 0. [cont-init.d] 40-set-env-vars: executing... ****** Checking for hardware acceleration platforms ****** OpenCL cannot be used VA-API cannot be used CUDA is available! *********************** Done ***************************** [cont-init.d] 40-set-env-vars: exited 0. [cont-init.d] 50-check-if-rpi: executing... ********** Checking if we are running on an RPi ********** Not running on any supported RPi *********************** Done ***************************** [cont-init.d] 50-check-if-rpi: exited 0. [cont-init.d] 55-check-if-jetson: executing... ****** Checking if we are running on a Jetson Board ****** Running on a Jetson Nano *********************** Done ***************************** [cont-init.d] 55-check-if-jetson: exited 0. [cont-init.d] 60-ffmpeg-path: executing... ****************** Getting FFmpeg path ******************* FFmpeg path: /usr/local/bin/ffmpeg *********************** Done ***************************** [cont-init.d] 60-ffmpeg-path: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [2021-10-06 21:28:48] [INFO ] [viseron ] - ------------------------------------------- [2021-10-06 21:28:48] [INFO ] [viseron ] - Initializing... [2021-10-06 21:28:48] [INFO ] [viseron.mqtt ] - Initializing MQTT connection [2021-10-06 21:28:49] [INFO ] [viseron ] - Initializing NVR threads [2021-10-06 21:28:53] [ERROR ] [viseron.camera.stream.lorex_ir_3] - [h264_nvmpi @ 0x558e6488b0] Invalid Pix_FMT for NVMPI Only yuv420p is supported [2021-10-06 21:28:53] [ERROR ] [viseron.camera.stream.lorex_ir_3] - Error while opening decoder for input stream #0:0 : Invalid data found when processing input [2021-10-06 21:28:53] [ERROR ] [viseron.camera.lorex_ir_3] - FFmpeg process has exited [2021-10-06 21:28:55] [INFO ] [viseron ] - Initialization complete [2021-10-06 21:28:58] [ERROR ] [viseron.camera.stream.lorex_ir_2] - [h264_nvmpi @ 0x55a656ca20] Invalid Pix_FMT for NVMPI Only yuv420p is supported [2021-10-06 21:28:58] [ERROR ] [viseron.camera.stream.lorex_ir_2] - Error while opening decoder for input stream #0:0 : Invalid data found when processing input [2021-10-06 21:28:58] [ERROR ] [viseron.camera.lorex_ir_3] - Restarting frame pipe WARNING:tornado.access:404 GET /favicon.ico (192.168.1.220) 3.74ms WARNING:tornado.access:404 GET /favicon.ico (192.168.1.220) 9.35ms

jamitupya avatar Oct 06 '21 11:10 jamitupya

Hmm yeah the Nano is very special when it comes to the FFMPEG build. The hardware accelerated decoder is quite limited.

Can you by any chance change your cameras output pixel format? As you can see from the error message, only yuv420p is supported.

roflcoopter avatar Oct 06 '21 11:10 roflcoopter

yeah, i can't see anywhere to change that on the Lorex camera's themselves, but taking a dig :-) thanks for the help :-)

jamitupya avatar Oct 06 '21 20:10 jamitupya

Another option could be to change the codec used to decode the stream using the codec config option

roflcoopter avatar Oct 08 '21 20:10 roflcoopter

let me try that

if its any help, Shinobi's jetson build has this nailed. worked first go.

jamitupya avatar Oct 09 '21 09:10 jamitupya

just to update, not luck on this path unfortunately.

eta: i did further testing at the time and by switching the test camera to HEVC, i was able to get rid of all those errors and am left with:

[services.d] done. [2021-11-02 17:30:25] [INFO ] [viseron ] - ------------------------------------------- [2021-11-02 17:30:25] [INFO ] [viseron ] - Initializing... [2021-11-02 17:30:26] [INFO ] [viseron ] - Initializing NVR threads [2021-11-02 17:30:29] [INFO ] [viseron ] - Initialization complete [2021-11-02 17:30:31] [ERROR ] [viseron.camera.stream.lorex_ir_1] - [hevc @ 0x5593df4df0] Could not find ref with POC 0

but that results in

The site at http://192.168.X.Y:8888/lorex_ir_1/mjpeg-stream has experienced a network protocol violation that cannot be repaired.

jamitupya avatar Nov 02 '21 07:11 jamitupya

Sorry you are having so many issues!

Im busy with a rewrite of Viseron right now which makes it more extensible and easier for me to maintain. As soon as i am done with that i will look into improving the Jetson Nano integration.

Another user kindly set up a VPN to his Nano so i can remote into it and develop directly on it. That was my biggest issue before and is the reason why there are so many problems with it, i could not do any debugging at all.

roflcoopter avatar Nov 02 '21 17:11 roflcoopter

Sorry you are having so many issues!

no need to be sorry my man, its a cool project and i was keen to screw with it and see if i could move away from Shinobi to something a bit lighter in weight. all is good though and will keep plodding away seeing what i can figure out :-)

makes it more extensible and easier for me to maintain.

look forward to seeing it, how much abstraction are you doing out of curiosity? enough to abstract ffmpeg out so we could drop in gstreamer as an example? n.b. i have no idea about the complexity of gstreamer or if it even supports whats needed :-)

Another user kindly set up a VPN to his Nano so i can remote into it and develop directly on it.

great, yell if you need a B01 (4GB) as well, i can get one online for you when the time comes as well :-)

e: formatting screwed up

jamitupya avatar Nov 04 '21 01:11 jamitupya

look forward to seeing it, how much abstraction are you doing out of curiosity? enough to abstract ffmpeg out so we could drop in gstreamer as an example? n.b. i have no idea about the complexity of gstreamer or if it even supports whats needed :-)

Yes exactly that. Im splitting it into components and domains, so the component would be gstreamer and the domain would be camera. I will post my progress soon in a WIP Pull Request so people can follow along

great, yell if you need a B01 (4GB) as well, i can get one online for you when the time comes as well :-)

Thats very kind of you!

roflcoopter avatar Nov 04 '21 06:11 roflcoopter

I will post my progress soon in a WIP Pull Request so people can follow along

how do i get notified about the pull request, me n00b? with this issue here? liek to see the gstreamer options as i am also struggling getting this (or frigate) onto the jetson nano. may shinobi (??) is my third option.. but like to give this here the first shot on the nano

ozett avatar Dec 01 '21 09:12 ozett

#306 is where it happens! Still a bit to go before its ready. Also need to implement gstreamer and i dont really know how hard that will be.

roflcoopter avatar Dec 06 '21 06:12 roflcoopter

i subscribed also to https://github.com/roflcoopter/viseron/pull/306 to see it happen. hope to see ffmpeg coming stable on the nano. seems hard work...

ozett avatar Dec 06 '21 08:12 ozett

Awesome!! Look forward to having a play :)

also sub’ed on #306, yell if you need anything tested 👍

jamitupya avatar Dec 08 '21 06:12 jamitupya