Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running masckcam manually #11

Closed
Chockaaa opened this issue Jun 11, 2021 · 5 comments
Closed

running masckcam manually #11

Chockaaa opened this issue Jun 11, 2021 · 5 comments

Comments

@Chockaaa
Copy link

I am getting this error

python3 maskcam_run.py
| DEBUG Using selector: EpollSelector selector_events.py:54
INFO maskcam-run | Using input from config file: prints.py:48
v4l2:///dev/video0
WARNING maskcam-run | MQTT is DISABLED since MQTT_BROKER_IP or prints.py:44
MQTT_DEVICE_NAME env vars are not defined

INFO maskcam-run | Press Ctrl+C to stop all processes prints.py:48
INFO maskcam-run | Process file-server started with PID: prints.py:48
12650
INFO maskcam-run | Starting streaming prints.py:48
(streaming-start-default is set)
INFO maskcam-run | Received command: streaming_start prints.py:48
INFO maskcam-run | Process inference started with PID: 12652 prints.py:48
INFO maskcam-run | Processing command: streaming_start prints.py:48
INFO maskcam-run | Process streaming started with PID: 12653 prints.py:48
INFO mqtt | MQTT not connected. Skipping message to topic: prints.py:48
device-status
| INFO file-server | Serving static files from directory: prints.py:48
/tmp/saved_videos
INFO file-server | Static server STARTED at prints.py:48
http://:8080
| INFO streaming | Codec: H264 prints.py:48
INFO streaming | prints.py:48

       Streaming at                                                         
       rtsp://<device-address-not-configured>:8554/maskcam                  

| INFO inference | Auto calculated frames to skip inference: 2 prints.py:48
INFO inference | Creating Pipeline prints.py:48

INFO inference | Creating Camera input prints.py:48
INFO inference | Creating Convertor src 2 prints.py:48
INFO inference | Creating Camera caps filter prints.py:48
INFO inference | Creating Convertor src 1 prints.py:48
INFO inference | Creating NVMM caps for input stream prints.py:48
INFO inference | Creating NvStreamMux prints.py:48
INFO inference | Creating pgie prints.py:48
INFO inference | Creating Converter NV12->RGBA prints.py:48
INFO inference | Creating OSD (nvosd) prints.py:48
INFO inference | Creating Queue prints.py:48
INFO inference | Creating Converter RGBA->NV12 prints.py:48
INFO inference | Creating capsfilter prints.py:48
INFO inference | Creating H264 stream prints.py:48
INFO inference | Creating Encoder prints.py:48
INFO inference | Creating Code Parser prints.py:48
INFO inference | Creating RTP H264 Payload prints.py:48
INFO inference | Creating Splitter file/UDP prints.py:48
INFO inference | Creating UDP queue prints.py:48
INFO inference | Creating Multi UDP Sink prints.py:48
INFO inference | Creating Fake Sink prints.py:48
INFO inference | Linking elements in the Pipeline prints.py:48

Opening in BLOCKING MODE
Opening in BLOCKING MODE
ERROR: Deserialize engine failed because file path: /home/jetsonnano/maskcam/yolo/maskcam_y4t_1024_608_fp16.trt open error
0:00:02.575327981 12652 0x200a86f0 WARN nvinfer gstnvinfer.cpp:616:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1691> [UID = 1]: deserialize engine from file :/home/jetsonnano/maskcam/yolo/maskcam_y4t_1024_608_fp16.trt failed
0:00:02.575399128 12652 0x200a86f0 WARN nvinfer gstnvinfer.cpp:616:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1798> [UID = 1]: deserialize backend context from engine from file :/home/jetsonnano/maskcam/yolo/maskcam_y4t_1024_608_fp16.trt failed, try rebuild
0:00:02.575429806 12652 0x200a86f0 INFO nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1716> [UID = 1]: Trying to create engine from model files
Yolo type is not defined from config file name:
ERROR: Failed to create network using custom network creation function
ERROR: Failed to get cuda engine from custom library API
0:00:02.575762260 12652 0x200a86f0 ERROR nvinfer gstnvinfer.cpp:613:gst_nvinfer_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1736> [UID = 1]: build engine file failed
0:00:02.575795021 12652 0x200a86f0 ERROR nvinfer gstnvinfer.cpp:613:gst_nvinfer_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1822> [UID = 1]: build backend context failed
0:00:02.575826220 12652 0x200a86f0 ERROR nvinfer gstnvinfer.cpp:613:gst_nvinfer_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1149> [UID = 1]: generate backend failed, check config file settings
0:00:02.576405397 12652 0x200a86f0 WARN nvinfer gstnvinfer.cpp:812:gst_nvinfer_start: error: Failed to create NvDsInferContext instance
0:00:02.576446544 12652 0x200a86f0 WARN nvinfer gstnvinfer.cpp:812:gst_nvinfer_start: error: Config file path: maskcam_config.txt, NvDsInfer Error: NVDSINFER_CONFIG_FAILED
ERROR inference | gst-resource-error-quark: Failed to create prints.py:42
NvDsInferContext instance (1): /dvs/git/dirty/git-master
_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvi
nfer.cpp(812): gst_nvinfer_start ():
/GstPipeline:pipeline0/GstNvInfer:primary-inference:
Config file path: maskcam_config.txt, NvDsInfer Error:
NVDSINFER_CONFIG_FAILED
INFO inference | prints.py:48
TROUBLESHOOTING HELP

           If the error is like: v4l-camera-source / reason                 
       not-negotiated                                                       
           Solution: configure camera capabilities                          
           Run the script under utils/gst_capabilities.sh and               
       find the lines with type                                             
           video/x-raw ...                                                  
           Find a suitable framerate=X/1 (with X being an                   
       integer like 24, 15, etc.)                                           
           Then edit config_maskcam.txt and change the line:                
           camera-framerate=X                                               
           Or configure using --env MASKCAM_CAMERA_FRAMERATE=X              
       (see README)                                                         
                                                                            
           If the error is like:                                            
           /usr/lib/aarch64-linux-gnu/libgomp.so.1: cannot                  
       allocate memory in static TLS block                                  
           Solution: preload the offending library                          
           export                                                           
       LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1                   
                                                                            
           END HELP                                                         

INFO inference | Inference main loop ending. prints.py:48
INFO maskcam-run | Sending interrupt to file-server process prints.py:48
INFO file-server | Shutting down static file server prints.py:48
INFO maskcam-run | Waiting for process file-server to prints.py:48
terminate...
INFO file-server | Server shut down correctly prints.py:48
INFO file-server | Server alive threads: prints.py:48
[<_MainThread(MainThread, started 548193665040)>]
INFO maskcam-run | Process terminated: file-server prints.py:48

INFO maskcam-run | Sending interrupt to streaming process prints.py:48
INFO maskcam-run | Waiting for process streaming to prints.py:48
terminate...
INFO streaming | Ending streaming prints.py:48
INFO maskcam-run | Process terminated: streaming prints.py:48

@manb911
Copy link

manb911 commented Jun 11, 2021

By any chance, are you running on deepstream-5.1?

@Chockaaa
Copy link
Author

yes, I am using deepstream-5.1

@Chockaaa
Copy link
Author

Chockaaa commented Jun 12, 2021

currently I am facing this issue after changing to deepstream 5.0

python3 maskcam_run.py
| DEBUG Using selector: EpollSelector selector_events.py:54
INFO maskcam-run | Using input from config file: prints.py:48
v4l2:///dev/video0
INFO maskcam-run | Connecting to MQTT server prints.py:48
192.68.10.130:1883
INFO maskcam-run | Device name: jetsonnano prints.py:48

Traceback (most recent call last):
╭──────────────────────────────────────────────────────────────────────────────╮
│ File "maskcam_run.py", line 443, in │
│ 440 │
│ 441 # Init MQTT or set these to None │
│ 442 if is_live_input: │
│ ❱ 443 mqtt_client = mqtt_init(config) │
│ 444 else: │
│ 445 mqtt_client = None │
│ 446 │
│ File "maskcam_run.py", line 159, in mqtt_init │
│ 156 broker_ip=MQTT_BROKER_IP, │
│ 157 broker_port=MQTT_BROKER_PORT, │
│ 158 subscribe_to=[(MQTT_TOPIC_COMMANDS, 2)], # handles re-sub│
│ ❱ 159 cb_success=mqtt_on_connect, │
│ 160 ) │
│ 161 mqtt_client.on_message = mqtt_process_message │
│ 162 │
│ File "/home/jetsonnano/maskcam/maskcam/mqtt_common.py", line 94, in │
│mqtt_connect_broker │
│ 91 client = paho_mqtt_client.Client(client_id) │
│ 92 client.on_connect = cb_on_connect │
│ 93 client.on_disconnect = cb_on_disconnect │
│ ❱ 94 client.connect(broker_ip, broker_port) │
│ 95 client.loop_start() │
│ 96 return client │
│ 97 │
│ File │
│"/home/jetsonnano/.local/lib/python3.6/site-packages/paho/mqtt/client.py", │
│line 941, in connect │
│ 938 │
│ 939 self.connect_async(host, port, keepalive, │
│ 940 bind_address, bind_port, clean_start, prop│
│ ❱ 941 return self.reconnect() │
│ 942 │
│ 943 def connect_srv(self, domain=None, keepalive=60, bind_address="",│
│ 944 clean_start=MQTT_CLEAN_START_FIRST_ONLY, properti│
│ File │
│"/home/jetsonnano/.local/lib/python3.6/site-packages/paho/mqtt/client.py", │
│line 1075, in reconnect │
│ 1072 # Put messages in progress in a valid state. │
│ 1073 self._messages_reconnect_reset() │
│ 1074 │
│ ❱ 1075 sock = self._create_socket_connection() │
│ 1076 │
│ 1077 if self._ssl: │
│ 1078 # SSL is only supported when SSLContext is available (imp│
│ File │
│"/home/jetsonnano/.local/lib/python3.6/site-packages/paho/mqtt/client.py", │
│line 3546, in _create_socket_connection │
│ 3543 if proxy: │
│ 3544 return socks.create_connection(addr, source_address=sourc│
│ 3545 else: │
│ ❱ 3546 return socket.create_connection(addr, source_address=sour│
│ 3547 │
│ 3548 │
│ 3549 # Compatibility class for easy porting from mosquitto.py. │
│ File "/usr/lib/python3.6/socket.py", line 724, in create_connection │
│ 721 sock.close() │
│ 722 │
│ 723 if err is not None: │
│ ❱ 724 raise err │
│ 725 else: │
│ 726 raise error("getaddrinfo returns an empty list") │
│ 727 │
│ File "/usr/lib/python3.6/socket.py", line 713, in create_connection │
│ 710 sock.settimeout(timeout) │
│ 711 if source_address: │
│ 712 sock.bind(source_address) │
│ ❱ 713 sock.connect(sa) │
│ 714 # Break explicitly a reference cycle │
│ 715 err = None │
│ 716 return sock │
╰──────────────────────────────────────────────────────────────────────────────╯
timeout: timed out
Traceback (most recent call last):
╭──────────────────────────────────────────────────────────────────────────────╮
│ File "maskcam_run.py", line 572, in │
│ 569 except: # noqa │
│ 570 console.print_exception() │
│ 571 try: │
│ ❱ 572 if process_inference is not None and process_inference.is_aliv│
│ 573 terminate_process(P_INFERENCE, process_inference, e_interr│
│ 574 except: # noqa │
│ 575 console.print_exception() │
╰──────────────────────────────────────────────────────────────────────────────╯
NameError: name 'process_inference' is not defined
Traceback (most recent call last):
╭──────────────────────────────────────────────────────────────────────────────╮
│ File "maskcam_run.py", line 577, in │
│ 574 except: # noqa │
│ 575 console.print_exception() │
│ 576 try: │
│ ❱ 577 if process_fileserver is not None and process_fileserver.is_al│
│ 578 terminate_process(P_FILESERVER, process_fileserver, e_inte│
│ 579 except: # noqa │
│ 580 console.print_exception() │
╰──────────────────────────────────────────────────────────────────────────────╯
NameError: name 'process_fileserver' is not defined
Traceback (most recent call last):
╭──────────────────────────────────────────────────────────────────────────────╮
│ File "maskcam_run.py", line 582, in │
│ 579 except: # noqa │
│ 580 console.print_exception() │
│ 581 try: │
│ ❱ 582 if process_streaming is not None and process_streaming.is_aliv│
│ 583 terminate_process(P_STREAMING, process_streaming, e_interr│
│ 584 except: # noqa │
│ 585 console.print_exception() │
╰──────────────────────────────────────────────────────────────────────────────╯
NameError: name 'process_streaming' is not defined

@manb911
Copy link

manb911 commented Jun 13, 2021

I would check:

  1. Are any ports being utilized already?
  2. If the Yolo extraction was done correctly, since I ran across an error in building yolo on deepstream-5.1 so had to edit the makefile abit

@Chockaaa
Copy link
Author

I managed to use docker instead to run it. I think I might have missed some steps in the manual installation process. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants