A few issues I'm trying to troubleshoot



  • Hey All,

    Hoping someone here can help out on a few "issues" I've come across.

    1: I've gotten Timestamps functioning, but the timezone is off. For example, I did a test at 18:00:00 PM CDT (Yes I timed it, I was trying to find the lag between my camera and Shinobi recordings--Interesting note: the recordings are about 2 seconds off while the stream is roughly 40seconds lol) but the timestamp on the recording comes off an hour ahead at 19:00:00. It's a bit odd as the Shinobi dashboard states 18:00 as well. It's almost like it's using EDT as the timestamp timezone.

    Side note on 1... Documentation on Timestamps is a bit lacking. It seems like a pretty straightforward item, but it might be a good idea to note that the positions are from the top left and that +x goes right, and +y goes down. Just a thought. It might also be a good idea to doc the font locations too. NBD, but it took me a bit to get sorted. I digress...

    2: As soon as I enable Motion Tracking, the stream turns black. I've narrowed it down to the fact that I can enable Global Detector Settings, but as soon as Motion Detector is turned on, everything just stays black. It still "records", but they are empty files

    What's unique about this one, is when I set up a VM on a windows host to test out Shinobi, everything was working in this department. But as soon as I moved to my server it doesn't want to work. The test VM was a Win10 host/Ubuntu 18.04 Guest and the server is a Ubuntu 18.04 Server host/CentOS7 guest.

    Server:
    Ubuntu 18.04 Server w/ KVM
    CentOS 7 Guest
    (No video card) - Not sure if that makes a difference for anything outside object detection processing

    Camera: Foscam R2

    Config:
    (Working)
    {
    "mode": "record",
    "mid": "FoscamR2",
    "name": "Foscam R2",
    "type": "h264",
    "protocol": "rtsp",
    "host": "192.168.x.x",
    "port": "443",
    "path": "/videoMain",
    "ext": "mp4",
    "fps": "28",
    "width": "1280",
    "height": "720",
    "details": "{"max_keep_days":"","notes":"","dir":"/mnt/Recordings/","auto_host_enable":"1","auto_host":"rtsp://<Removed>:<Removed>@192.168.x.x:443/videoMain","rtsp_transport":"tcp","muser":"<removed>","mpass":"<removed>","port_force":"0","fatal_max":"0","skip_ping":null,"aduration":"100000","probesize":"100000","stream_loop":"0","sfps":"28","accelerator":"0","hwaccel":"auto","hwaccel_vcodec":"","hwaccel_device":"","stream_type":"hls","stream_flv_type":"ws","stream_flv_maxLatency":"","stream_mjpeg_clients":"","stream_vcodec":"copy","stream_acodec":"","hls_time":"2","hls_list_size":"3","preset_stream":"ultrafast","signal_check":"10","signal_check_log":"0","stream_quality":"15","stream_fps":"2","stream_scale_x":"","stream_scale_y":"","rotate_stream":"no","svf":"","tv_channel":"0","tv_channel_id":"","tv_channel_group_title":"","stream_timestamp":"0","stream_timestamp_font":"","stream_timestamp_font_size":"","stream_timestamp_color":"","stream_timestamp_box_color":"","stream_timestamp_x":"","stream_timestamp_y":"","stream_watermark":"0","stream_watermark_location":"","stream_watermark_position":"tr","snap":"0","snap_fps":"","snap_scale_x":"","snap_scale_y":"","snap_vf":"","vcodec":"libx264","crf":"1","preset_record":"","acodec":"none","dqf":"0","cutoff":"3","rotate_record":"no","vf":"","timestamp":"1","timestamp_font":"/usr/share/fonts/liberation/LiberationSans-Regular.ttf","timestamp_font_size":"12","timestamp_color":"white","timestamp_box_color":"[email protected]","timestamp_x":"15","timestamp_y":"15","watermark":"0","watermark_location":"","watermark_position":"tr","cust_input":"","cust_snap":"","cust_rtmp":"","cust_rawh264":"","cust_detect":"","cust_stream":"","cust_stream_server":"","cust_record":"","custom_output":"","detector":"1","detector_send_frames":"1","detector_lock_timeout":"","detector_save":"0","detector_fps":"2","detector_scale_x":"640","detector_scale_y":"480","detector_record_method":"sip","detector_trigger":"1","detector_trigger_record_fps":"","detector_timeout":"5","watchdog_reset":"0","detector_delete_motionless_videos":"0","detector_webhook":"0","detector_webhook_url":"","detector_command_enable":"0","detector_command":"","detector_command_timeout":"","detector_mail":"0","detector_mail_send_video":null,"detector_mail_timeout":"","detector_discordbot":null,"detector_discordbot_send_video":null,"detector_discordbot_timeout":"","cords":"[]","detector_pam":"0","detector_sensitivity":"10","detector_frame":"1","detector_noise_filter":"0","detector_noise_filter_range":"5","detector_notrigger":"0","detector_notrigger_mail":"0","detector_notrigger_timeout":"","detector_use_detect_object":"0","detector_use_motion":"1","detector_lisence_plate":"0","detector_lisence_plate_country":"us","detector_buffer_vcodec":"copy","detector_buffer_acodec":"auto","detector_buffer_fps":"","detector_buffer_hls_time":"","detector_buffer_hls_list_size":"","detector_buffer_start_number":"","detector_buffer_live_start_index":"","control":"0","control_base_url":"","control_url_method":null,"control_digest_auth":null,"control_stop":"0","control_url_stop_timeout":"","control_url_center":"","control_url_left":"","control_url_left_stop":"","control_url_right":"","control_url_right_stop":"","control_url_up":"","control_url_up_stop":"","control_url_down":"","control_url_down_stop":"","control_url_enable_nv":"","control_url_disable_nv":"","control_url_zoom_out":"","control_url_zoom_out_stop":"","control_url_zoom_in":"","control_url_zoom_in_stop":"","groups":"[]","loglevel":"warning","sqllog":"0","detector_cascades":"","stream_channels":"","input_maps":"","input_map_choices":""}",
    "shto": "[]",
    "shfr": "[]"
    }

    Not Working
    {
    "mode": "record",
    "mid": "FoscamR2",
    "name": "Foscam R2",
    "type": "h264",
    "protocol": "rtsp",
    "host": "192.168.x.x",
    "port": "443",
    "path": "/videoMain",
    "ext": "mp4",
    "fps": "28",
    "width": "1280",
    "height": "720",
    "details": "{"max_keep_days":"","notes":"","dir":"/mnt/Recordings/","auto_host_enable":"1","auto_host":"rtsp://<removed>:<removed>@192.168.x.x:443/videoMain","rtsp_transport":"tcp","muser":"<removed>","mpass":"<removed>","port_force":"0","fatal_max":"0","skip_ping":null,"aduration":"100000","probesize":"100000","stream_loop":"0","sfps":"28","accelerator":"0","hwaccel":"auto","hwaccel_vcodec":"","hwaccel_device":"","stream_type":"hls","stream_flv_type":"ws","stream_flv_maxLatency":"","stream_mjpeg_clients":"","stream_vcodec":"copy","stream_acodec":"","hls_time":"2","hls_list_size":"3","preset_stream":"ultrafast","signal_check":"10","signal_check_log":"0","stream_quality":"15","stream_fps":"2","stream_scale_x":"","stream_scale_y":"","rotate_stream":"no","svf":"","tv_channel":"0","tv_channel_id":"","tv_channel_group_title":"","stream_timestamp":"0","stream_timestamp_font":"","stream_timestamp_font_size":"","stream_timestamp_color":"","stream_timestamp_box_color":"","stream_timestamp_x":"","stream_timestamp_y":"","stream_watermark":"0","stream_watermark_location":"","stream_watermark_position":"tr","snap":"0","snap_fps":"","snap_scale_x":"","snap_scale_y":"","snap_vf":"","vcodec":"libx264","crf":"1","preset_record":"","acodec":"none","dqf":"0","cutoff":"3","rotate_record":"no","vf":"","timestamp":"1","timestamp_font":"/usr/share/fonts/liberation/LiberationSans-Regular.ttf","timestamp_font_size":"12","timestamp_color":"white","timestamp_box_color":"[email protected]","timestamp_x":"15","timestamp_y":"15","watermark":"0","watermark_location":"","watermark_position":"tr","cust_input":"","cust_snap":"","cust_rtmp":"","cust_rawh264":"","cust_detect":"","cust_stream":"","cust_stream_server":"","cust_record":"","custom_output":"","detector":"1","detector_send_frames":"1","detector_lock_timeout":"","detector_save":"0","detector_fps":"2","detector_scale_x":"640","detector_scale_y":"480","detector_record_method":"sip","detector_trigger":"1","detector_trigger_record_fps":"","detector_timeout":"5","watchdog_reset":"0","detector_delete_motionless_videos":"0","detector_webhook":"0","detector_webhook_url":"","detector_command_enable":"0","detector_command":"","detector_command_timeout":"","detector_mail":"0","detector_mail_send_video":null,"detector_mail_timeout":"","detector_discordbot":null,"detector_discordbot_send_video":null,"detector_discordbot_timeout":"","cords":"[]","detector_pam":"1","detector_sensitivity":"10","detector_frame":"1","detector_noise_filter":"0","detector_noise_filter_range":"5","detector_notrigger":"0","detector_notrigger_mail":"0","detector_notrigger_timeout":"","detector_use_detect_object":"0","detector_use_motion":"1","detector_lisence_plate":"0","detector_lisence_plate_country":"us","detector_buffer_vcodec":"copy","detector_buffer_acodec":"auto","detector_buffer_fps":"","detector_buffer_hls_time":"","detector_buffer_hls_list_size":"","detector_buffer_start_number":"","detector_buffer_live_start_index":"","control":"0","control_base_url":"","control_url_method":null,"control_digest_auth":null,"control_stop":"0","control_url_stop_timeout":"","control_url_center":"","control_url_left":"","control_url_left_stop":"","control_url_right":"","control_url_right_stop":"","control_url_up":"","control_url_up_stop":"","control_url_down":"","control_url_down_stop":"","control_url_enable_nv":"","control_url_disable_nv":"","control_url_zoom_out":"","control_url_zoom_out_stop":"","control_url_zoom_in":"","control_url_zoom_in_stop":"","groups":"[]","loglevel":"warning","sqllog":"0","detector_cascades":"","stream_channels":"","input_maps":"","input_map_choices":""}",
    "shto": "[]",
    "shfr": "[]"
    }

    The only differences I see in the above configs is the detector_pam being set from 0 to 1. Logs after enabling the not working config are pretty much not there:

    xx: FoscamR2
    FFMPEG Process Started a few seconds ago
    cmd : -loglevel error -r 28 -analyzeduration 100000 -probesize 100000 -fflags +igndts -rtsp_transport tcp -i "rtsp://<removed>:<removed>@192.168.x.x:443/videoMain" -vcodec libx264 -r 28 -vf drawtext=fontfile=/usr/share/fonts/liberation/LiberationSans-Regular.ttf:text='%{localtime}':x=15:y=15:fontcolor=white:box=1:[email protected]:fontsize=12 -s 1280x720 -f segment -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 -segment_list pipe:2 -segment_time 180 "/mnt/Recordings/xx/FoscamR2/%Y-%m-%dT%H-%M-%S.mp4" -preset ultrafast -c:v copy -f hls -hls_time 2 -hls_list_size 3 -start_number 0 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist "/dev/shm/streams/xx/FoscamR2/s.m3u8" -an -c:v pam -pix_fmt gray -f image2pipe -r 2 -s 640x480 pipe:3 -c:a copy -c:v copy -f hls -tune zerolatency -g 1 -hls_time 2 -hls_list_size 4 -start_number 0 -live_start_index -3 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist "/dev/shm/streams/xx/FoscamR2/detectorStream.m3u8"

    xx: FoscamR2
    Camera is not streaming a few seconds ago
    msg : Restarting Process

    xx: FoscamR2
    Monitor Stopped 2 minutes ago
    Monitor session has been ordered to stop.

    xx: FoscamR2
    Monitor Updated 2 minutes ago
    by user : xx

    3: More of a 1 off question at the moment. Has anyone gotten PTZ working for an R2? I tried to follow the video on Foscam cameras, but the R2 doesn't follow that model.



  • Small update: Enabling motion capture doesn't entirely result in a blank screen. If I refresh the page, an image does show up - but it's a single frame of whatever it saw when it first loads and then never updates until I refresh the page again.



  • For anyone wondering...I figured out the timestamp issue. Turns out that somehow CentOS had reverted to EDT. Not entirely sure what happened there, but I woke up last night and had a 'wait a minute' moment. Figured I should check the date command and see what it kicks out. Bam. Just had to change my system time zone.



  • I figured out my other issues as well. As it turns out, CentOS apparently installs an old version of Node (6.14 my my case) if you just do: yum install nodejs.

    To fix it, I did this:

    • sudo yum remove nodesource-release* nodejs
    • sudo yum clean all
    • sudo rm -rf /var/cache/yum/*
    • sudo rm /etc/yum.repos.d/nodesource-el.repo
    • curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
    • sudo yum install nodejs

    Bam, 8.11.4 version installed and motion detection is working again.

    Note: V10 does NOT work. Only v8 seems to work. I was able to stream with 10, but the little motion detector bar never appears and recordings never start.


 

Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.