Commit Graph

5507 Commits (97bb130cd126bd39fe3005eb78d2e3f1e5d0f73d)

Author SHA1 Message Date
Isaac Connor 047d775528 Add more debug to loaded group permission 2022-12-08 13:53:58 -05:00
Isaac Connor 64786cc103 Set Status to Connected when updating FPS 2022-12-07 20:35:56 -05:00
Isaac Connor 2ca4756958 Only update fps if capture was successful. Beacuse it now also updates status to say Conected 2022-12-07 20:35:56 -05:00
Isaac Connor b53eed852c Merge branch 'master' of ../cloudmule 2022-12-07 12:39:58 -05:00
Isaac Connor 9e8d2a8428 Remove extra debug 2022-12-07 12:27:02 -05:00
Isaac Connor 7e489f7fa2 When there are NO frames in the db, populate the list of frames by 1/fps. 2022-12-07 12:26:51 -05:00
Isaac Connor 46bb48e2c8 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2022-12-06 11:20:20 -05:00
Isaac Connor f010356d62
Merge pull request #3638 from kholk/patch-1
zm_ffmpeg_camera: Add support for Jetson Nano/Xavier NVMPI
2022-12-06 04:01:51 -05:00
Oleg 83a401fc44 Fix typo fwrite -> write 2022-12-02 21:43:45 +00:00
Isaac Connor 0c41333976 remove extra braces, explicilty handle INHERIT permission and log any other values as a warning 2022-12-02 14:51:53 -05:00
Isaac Connor b4f674ef5d Merge branch 'master' of github.com:ZoneMinder/zoneminder 2022-11-30 13:18:38 -05:00
Isaac Connor ae66782ddb Use 32byte aligned buffer size when allocating an image buffer to make ffmpeg happy. Fixes a crash when width = 1080. When linesizes are different, copy line by line instead of the whole buffer all at once. 2022-11-30 13:18:13 -05:00
Isaac Connor 61e5527b63 Log image size as wel 2022-11-30 13:18:13 -05:00
Isaac Connor fbb9350c58 Remove some extra scope, log group id as well. 2022-11-30 13:00:37 -05:00
AngeloGioacchino Del Regno 7f8badc334
zm_ffmpeg_camera: Add support for Jetson Nano/Xavier NVMPI
Add support for the NVMPI hardware decoders (not CUDA decoders!)
of the Tegra SoCs found in the Jetson Nano/TX/TX2 and Xavier NX/AGX.

This platform supports hardware decoding of H264, HEVC, MPEG2,
MPEG4, VP8 and VP9.
2022-11-24 00:09:02 +01:00
Isaac Connor b3a262fc9b Fix crash due to using unrotated y-channel image. Put the y-image creation in ::Decode, stored in ZMPacket. 2022-11-22 12:38:48 -05:00
Isaac Connor 5fdf66b51c Instead of return, set zm_terminate and continue so that we join the command processor thread and don't crash 2022-11-16 10:33:10 -05:00
Isaac Connor 4d716f26ee Make shm is not connected a debug... otherwise we really spam the logs. Useful error messages can go at a higher level 2022-11-16 09:07:36 -05:00
Isaac Connor a4c88cea0a Fix warning about parentheses around assignment used as truth value 2022-11-15 13:03:55 -05:00
Isaac Connor e59451b6da Check for return value of openEvent. In the situation where opening the event fails we must not crash. 2022-11-15 12:49:59 -05:00
Isaac Connor bfaf8c8b53 Fix logic inversion on testing user Monitors for camera access 2022-11-06 07:46:41 -05:00
Isaac Connor 7fda500140 Make permission values 0 based but stsarting with UNKNOWN because when doing permission+0 in SQL, we get a 1-based value 2022-11-03 18:28:23 -04:00
Isaac Connor 6265a1ca41 Move from MonitorIds to Monitor_Permissions and Group_Permissions. 2022-11-02 13:25:43 -04:00
Isaac Connor 6d2b2ae525 Implement split out username/password for remote_camera and remote_camera_http 2022-11-02 10:06:39 -04:00
Isaac Connor 30bb5d47d7 Implement split out username/password for remote_camera and remote_camera_http 2022-11-02 10:06:26 -04:00
Isaac Connor 2d9bc06170 Set a 1 second timeout one the communications socket, so that our blocking commandQueue check will check zm_terminate every now an then 2022-10-26 13:09:43 -04:00
Isaac Connor de012de198 Add a debug to tell if we got back from joining command_processor 2022-10-25 09:22:17 -04:00
Isaac Connor 37a34a9eb9 Don't list cause:ONVIF when going back into alarm 2022-10-25 09:21:57 -04:00
Isaac Connor c2680f7f77 Turn failure to send into a debug. When running under fpm etc we may not get SIGPIPE. 2022-10-17 17:22:23 -04:00
Isaac Connor 658ca44c32 Don't panic if no font file found. Perhaps we can continue with diminished function 2022-10-14 14:04:06 -04:00
Isaac Connor e49876de53 Bump number of db queue entries before warning to 40. 40 is still a reasonable number and rarely hit in testing. 2022-10-13 17:36:41 -04:00
Isaac Connor a1595c0093 Default to use faststart since we close events in a separate thread we can get away with this now 2022-10-12 19:15:04 -04:00
Isaac Connor 67a399cd1f Include UpdatedOn when updating Monitor_Status 2022-10-12 19:13:52 -04:00
Isaac Connor 619cf1975f Add getting the connection id from mysql and log it in zmDbDo. This is so that when mysql reports a dropped connection, we can figure out which process it was. 2022-10-06 10:28:49 -04:00
Isaac Connor 79026b77a1 Use monitor::Substitute on Event Prefix 2022-09-28 15:53:43 -04:00
Isaac Connor 80f7f43f7c Introduce Monitor::Substitute from code doing timestamping. 2022-09-28 15:53:29 -04:00
Isaac Connor 7c9cb36027 Don't wait for decode in Analyze. 2022-09-28 13:41:23 -04:00
Jonathan Bennett 9cb21dce22 Uses the master Janus secret as the mountpoint secret, detects and restarts mounts if PIN is stale 2022-09-24 16:05:52 -05:00
Isaac Connor e91b11d1db Add IDLE to the states where we will close the event at section length end time. 2022-09-23 14:17:28 -04:00
Isaac Connor 97a791656e Fix log causing idle events to not be closed when close_mode=ALARM. 2022-09-21 13:41:09 -04:00
Isaac Connor 895adcb4c4 put back code to close an event when idle, at section_length when using CLOSE_MODE==idle 2022-09-21 12:32:15 -04:00
Isaac Connor dfbd9f4ed4 Set the rtsp version so that the mandatory s field in the SDP is filled 2022-09-18 14:16:35 -04:00
Isaac Connor abc5ea26d8 Merge branch 'master' into add_janus_rtsp_user 2022-09-18 12:44:25 -04:00
Isaac Connor bdf5b5d202 Use empty() instead of length() which is faster. Add rtsp path to debug 2022-09-18 12:36:29 -04:00
Isaac Connor dd82a01291 Don't encode the user/pass. If they were properly entered in the web ui then we will double encode them. 2022-09-18 12:35:04 -04:00
Isaac Connor 11d6911ad4 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2022-09-17 19:17:02 -04:00
Isaac Connor 67a7c0721a Fix bad merge reverts. Put back code that take username and password from fields in monitor instead of parsing from rtsp path 2022-09-17 18:58:50 -04:00
Isaac Connor ad1a504d53 remove blank line 2022-09-16 18:33:23 -04:00
Isaac Connor b7143a3c84 Add a check for auth timeout and re-adding with a new auth token. 2022-09-14 20:29:33 -04:00
Isaac Connor d1cd7d3f91 Merge branch 'master' into add_janus_rtsp_user 2022-09-14 18:34:07 -04:00
Isaac Connor 319904ab80 When we increment past the event, fix the curr_frame_id so we reference the last image. 2022-09-14 18:30:39 -04:00
Isaac Connor 419a44f8ed Merge branch 'iiot' 2022-09-13 18:23:44 -04:00
Isaac Connor deb35738db Merge branch 'master' into add_janus_rtsp_user 2022-09-13 16:17:15 -04:00
Isaac Connor 4668ffcaa9 rework event stream. Fixes seeking. Fixes event not completing due to not have Frame records for every frame. Adds send_twice to deal with browsers not showing the last sent image. Use locking around anything to do with curr_frame_id as commandQueue is it's own thread now. 2022-09-13 16:16:54 -04:00
Isaac Connor 8549cdf317 Implement a mutex/locks around changing event data, curr_frame_id, etc. also contains a fix for seeking due to > instead of <. In general fixes seeking 2022-09-12 16:17:42 -04:00
Isaac Connor f431ab9e45 Slightly smarted UriEncode, which doens't include numbers and a few other valid characters. Needs more work and tests. 2022-09-12 13:44:18 -04:00
Isaac Connor d079439005 Merge branch 'reports' of http://github.com/ConnorTechnology/zoneminder into reports 2022-09-12 19:40:27 +02:00
Isaac Connor 17df9713b1 Replace Function with Capturing 2022-09-12 11:55:09 -04:00
Isaac Connor 18fb1777ec If in a multi-server env, load the hostname instead of localhost for the server for this camera when using zm_rtsp_server. 2022-09-12 11:54:56 -04:00
Isaac Connor 01bd094899 Rough in a Server class to load Server info 2022-09-12 11:54:02 -04:00
Isaac Connor d2c461bcc9 When using RTSP_Server restream, need to auth as a ZM user. So load user and create an auth token. 2022-09-12 10:34:26 -04:00
Isaac Connor 0f068e2136 Add Janus_RTSP_User loading 2022-09-12 10:34:26 -04:00
Jonathan Bennett c35bbc8c30 Adds the Janus_pin to shared_memory, and a -j to zmu to fetch it 2022-09-07 15:49:47 -05:00
Jonathan Bennett db3017de7d Adds the generateKey() function to zm_crypt 2022-09-07 15:49:47 -05:00
Isaac Connor 594649605c Slightly smarted UriEncode, which doens't include numbers and a few other valid characters. Needs more work and tests. 2022-09-07 09:31:50 -04:00
Isaac Connor 4508940c30 Don't trust zm_packet->packet to not be null 2022-09-01 07:10:44 -04:00
Isaac Connor f610cd5e1b Don't trust zm_packet->packet to not be null 2022-09-01 13:04:40 +02:00
Isaac Connor 35c55a79e0 Use correct format, fix build warnings 2022-08-26 09:54:05 -04:00
Isaac Connor 97e19b78bd Fixup debug logging in ::Decode. It documents the wrong case 2022-08-26 09:33:42 -04:00
Isaac Connor 2bb0db96d8 When adjusting start_time, set end_time as well. 2022-08-26 09:33:42 -04:00
Isaac Connor 64d6dab27e Fix quoting and commas when not built with MQTT 2022-08-26 09:19:28 -04:00
Isaac Connor 429358931b Allow zm to compile without mqtt 2022-08-25 20:56:53 -04:00
Isaac Connor fa39983b69 Merge branch 'master' into add_mqtt 2022-08-25 18:41:59 -04:00
Isaac Connor 29750a56e7 Merge branch 'master' into add_mqtt 2022-08-25 18:37:54 -04:00
Isaac Connor 8558ade8f1
Merge branch 'master' into misc_fixes 2022-08-25 18:33:06 -04:00
Isaac Connor 341021de74 Use a flag to tell whether we have written the snapshot jpeg yet. If image data has been freed from packets, we may not write the snapshot because we already had a packet with a higher score. 2022-08-22 14:56:55 -04:00
Isaac Connor e1d381bc9e Don't set auth_type. It doesn't seem to be support and shouldn't be necessary 2022-08-22 11:46:36 -04:00
Isaac Connor d51a2eb8a5
Merge pull request #3537 from parvit/issue-695
Added configuring of authentication for rstp cameras
2022-08-21 18:08:00 -04:00
parvit (Vittorio Parrella) ef104fcda3
libvlc support for rtsp authentication with special characters 2022-08-20 11:00:51 -04:00
parvit (Vittorio Parrella) a94d74143e
support for ffmpeg type camera authentication with special characters 2022-08-20 10:01:14 -04:00
Isaac Connor fe2452f4c9 Add SetVideoWriterStartTime(starting_packet->timestamp);. We use shared->data->recording.tv_sec etc... but since we don't set it, it is always 0. 2022-08-19 13:33:22 -04:00
Isaac Connor d6ed2f65a1 Don't update notes from this frame on continuous recording. Fixes #3550 2022-08-19 13:33:22 -04:00
Isaac Connor c0da19e8ed Fix crash due to deplicated join. 2022-08-19 13:33:22 -04:00
Isaac Connor 03707ed88e Handle case where time_base is not set in the codec. Fixes h265 not playing right. Don't eek until a significant difference in time. Lots more debug output. Pass codec when initialising codec context. Mostly this fixes playback of h265 2022-08-19 13:33:22 -04:00
Isaac Connor 788bb603e1 Fix crash due to deplicated join. Don't output BOUNDARY unless image loading suceeds 2022-08-19 13:33:22 -04:00
Isaac Connor 7b39b3f7a6 Make checkCommandQueue it's own thread, meaning we use blocking I/O and will still respond when it takes forever to send a jpeg. Make warning about broken stream into a Debug. The signal doesn't set zm_terminate fast enough. 2022-08-19 13:33:22 -04:00
Ratchanan Srirattanamet 27808888a6 db: start the processing thread after all fields are initialized
Initializing `zmDbQueue::mThread` with initializer list makes the thread
start in the middle of object initialization. This means `zmDbQueue::
process()` could start and reach mCondition.wait(lock); before `std::
wait_condition`'s constructor, which causes deadlock.

To make sure thread won't start before object initialize, move
`mThread`'s initialization to constructor's body.

This _at last_ solves the random zmu deadlock issue that has plagued my
setup for almost a year.
2022-08-19 13:33:22 -04:00
Isaac Connor 494077eee7 Don't set AVFMT_TS_NONSTRICT. Crashes on ffmpeg 5. Fixes #3497 2022-08-19 13:33:22 -04:00
Isaac Connor 85795c30ee Remove warning about maxImageBuffer. It will be handled in queuePacket as it was before, only now we actually tell about the keyframe interval. It is entirely common to not get to another keyframe due to locked packets during event writing. 2022-08-19 13:33:22 -04:00
Isaac Connor de3ffa72c8 set decoded=true and notify when deleting packets from queue. Analysing might be waiting on the packet. 2022-08-19 13:33:22 -04:00
Isaac Connor d40ab068e4 Use new packetqueue.stopping() to not wait when the packetqueue is stopping 2022-08-19 13:33:22 -04:00
Isaac Connor f028e764ba Add bool stopping() to packetqueue. 2022-08-19 13:33:22 -04:00
Isaac Connor 765714d976 Keep track of max_keyframe_interval and log it when complaining 2022-08-19 13:33:22 -04:00
Isaac Connor 11846ed208 Don't need max_keyframe_interval. Whether our it is still pointing at the front is enough. Only log the warning if the packetqueue is full and we couldn't find another keyframe. 2022-08-19 13:33:22 -04:00
Isaac Connor 2922202355 Detect out of order packets 2022-08-19 13:33:22 -04:00
Isaac Connor 0fa41c4aae Fix warnings about keyframe interval and maximagebuffer count on jpeg streams. 2022-08-19 13:33:22 -04:00
Jonathan Bennett 71c5339c2b Adds Janus options Profile-ID Override and Use RTSP Restream to work around camera issues 2022-08-19 13:33:22 -04:00
Isaac Connor 7cfa529eb6 keyframe_interval gets reset so can give erroneous logs. Use a second variable to start the actual found keyframe interval. Use a const ref to prevent copying in notify_all 2022-08-19 13:33:22 -04:00
Isaac Connor 1c870d8213 Revert "Fix memleak due to not deleting okpt in VideoStore destructor"
This reverts commit 896a05c65d.
2022-08-19 13:33:22 -04:00
Isaac Connor 3501fa4f8e Fix memleak due to not deleting okpt in VideoStore destructor 2022-08-19 13:33:22 -04:00
ovargasp 17d4d44af1 Modify zmu
Adds option to get monitor triggered status.
2022-08-19 13:33:22 -04:00
Isaac Connor 2240f0813d Provide support for libaom-av1 2022-08-19 13:33:22 -04:00
Isaac Connor d2cf2d5b41 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2022-08-16 16:37:56 -04:00
Isaac Connor f4d77116ea Add SetVideoWriterStartTime(starting_packet->timestamp);. We use shared->data->recording.tv_sec etc... but since we don't set it, it is always 0. 2022-08-16 16:37:45 -04:00
Isaac Connor 82b71d5b12 Don't update notes from this frame on continuous recording. Fixes #3550 2022-08-16 16:32:33 -04:00
Isaac Connor e655cc345f Fix crash due to deplicated join. 2022-08-16 15:16:37 -04:00
Isaac Connor a26c9f0935 Handle case where time_base is not set in the codec. Fixes h265 not playing right. Don't eek until a significant difference in time. Lots more debug output. Pass codec when initialising codec context. Mostly this fixes playback of h265 2022-08-16 15:16:22 -04:00
Isaac Connor b9c97e6795 Fix crash due to deplicated join. Don't output BOUNDARY unless image loading suceeds 2022-08-16 15:15:01 -04:00
Isaac Connor aa030afcb6 Make checkCommandQueue it's own thread, meaning we use blocking I/O and will still respond when it takes forever to send a jpeg. Make warning about broken stream into a Debug. The signal doesn't set zm_terminate fast enough. 2022-08-15 17:58:56 -04:00
parvit (Vittorio Parrella) 3642abd155
typo 2022-08-15 14:35:16 -04:00
parvit (Vittorio Parrella) 408b42edd4
correct regex escaping 2022-08-15 14:30:48 -04:00
parvit (Vittorio Parrella) 603d10a072
janus password integration 2022-08-15 12:55:04 -04:00
parvit (Vittorio Parrella) 6c2291bd22
Merge branch 'master' into issue-695 2022-08-14 12:10:34 -04:00
Isaac Connor 82ff0c1082
Merge pull request #3574 from peat-psuwit/for-upstream/zmdb-thread-init
db: start the processing thread after all fields are initialized
2022-08-13 16:02:14 -04:00
Isaac Connor 1cf0245aca Don't set AVFMT_TS_NONSTRICT. Crashes on ffmpeg 5. Fixes #3497 2022-08-12 18:21:58 -04:00
Isaac Connor 39afe4fd24 Remove warning about maxImageBuffer. It will be handled in queuePacket as it was before, only now we actually tell about the keyframe interval. It is entirely common to not get to another keyframe due to locked packets during event writing. 2022-08-12 11:05:23 -04:00
Isaac Connor 42d8be01ce set decoded=true and notify when deleting packets from queue. Analysing might be waiting on the packet. 2022-08-11 20:40:03 -04:00
Isaac Connor cec9e32a79 Use new packetqueue.stopping() to not wait when the packetqueue is stopping 2022-08-11 15:23:49 -04:00
Isaac Connor 1f9746e6c0 Add bool stopping() to packetqueue. 2022-08-11 15:10:49 -04:00
Isaac Connor cdc356f547 Keep track of max_keyframe_interval and log it when complaining 2022-08-11 13:23:13 -04:00
Isaac Connor 71986a815a Don't need max_keyframe_interval. Whether our it is still pointing at the front is enough. Only log the warning if the packetqueue is full and we couldn't find another keyframe. 2022-08-11 12:56:11 -04:00
Isaac Connor 1f978f0ac2 Detect out of order packets 2022-08-10 17:57:11 -04:00
Isaac Connor 3136f26e40 Fix warnings about keyframe interval and maximagebuffer count on jpeg streams. 2022-08-10 10:31:57 -04:00
Isaac Connor d1222d2fa7
Merge pull request #3572 from jp-bennett/master
Adds Janus Restream and Profile Override
2022-08-09 18:15:39 -04:00
Isaac Connor 165ccf5820 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2022-08-09 15:48:06 -04:00
Isaac Connor 3034636501 Provide support for libaom-av1 2022-08-09 15:47:39 -04:00
Jonathan Bennett d41792ae00 Adds Janus options Profile-ID Override and Use RTSP Restream to work around camera issues 2022-08-09 00:54:41 -05:00
Isaac Connor eb9ccf41f2 keyframe_interval gets reset so can give erroneous logs. Use a second variable to start the actual found keyframe interval. Use a const ref to prevent copying in notify_all 2022-08-08 13:58:22 -04:00
Ratchanan Srirattanamet d0a7b51283 db: start the processing thread after all fields are initialized
Initializing `zmDbQueue::mThread` with initializer list makes the thread
start in the middle of object initialization. This means `zmDbQueue::
process()` could start and reach mCondition.wait(lock); before `std::
wait_condition`'s constructor, which causes deadlock.

To make sure thread won't start before object initialize, move
`mThread`'s initialization to constructor's body.

This _at last_ solves the random zmu deadlock issue that has plagued my
setup for almost a year.
2022-08-08 03:13:08 +07:00
Isaac Connor cad80eb37d Revert "Fix memleak due to not deleting okpt in VideoStore destructor"
This reverts commit 896a05c65d.
2022-08-06 09:54:23 -04:00
Isaac Connor 896a05c65d Fix memleak due to not deleting okpt in VideoStore destructor 2022-08-06 09:47:25 -04:00
ovargasp a0f6ba1455 Modify zmu
Adds option to get monitor triggered status.
2022-08-04 20:31:12 -06:00
Isaac Connor 6e5b9b56ed Only load linked monitors if doing capture 2022-08-03 11:55:44 -04:00
Isaac Connor b40423d720 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2022-08-02 20:57:48 -04:00
Isaac Connor 89631a8531 Fix spelling 2022-08-02 20:47:07 -04:00
Isaac Connor c40cedc15c Simply code about zm_terminate, replace fixed 60 second max sleep time with ZM_WATCH_MAX_DELAY 2022-08-02 20:45:45 -04:00
Isaac Connor 6f02096098 Notify all packets when doing packetqueue:stop so prevent deadlock when waiting for decode 2022-08-02 20:44:45 -04:00
Isaac Connor baf65819cb add notify_all functions 2022-08-02 20:43:20 -04:00
Isaac Connor a03189046e Rename zmc_heartbeat_time to heartbeat_time. Set it during waiting for prime and capturing. 2022-08-02 17:54:27 -04:00
Isaac Connor 30271283ba Make CMD_LIST available to specific monitors as well as all monitors. 2022-08-02 14:19:57 -04:00
Isaac Connor a9cc417a8b Fix logic around warning about keyframe interval being larger than max image buffer count. 2022-08-02 13:02:12 -04:00
Doug Nazar 8c37846c6c Check result of snprintf for errors and truncation. 2022-07-31 16:38:23 -04:00
Doug Nazar 74f8e43b12 Cast operand to larger destination size to avoid possible overflow issues. 2022-07-31 00:48:27 -04:00
Doug Nazar c8895dc06a Fix backtrace addr2line command.
addr2line wants the offset into the object, not the current location in
memory and it will only work with the specified object.

Mention that you might need a debug package installed to get any info.
2022-07-31 00:42:15 -04:00
Doug Nazar 8d2c9c1fd7 Fix warning about Pre Event Image Count setting. 2022-07-30 22:32:48 -04:00
Doug Nazar 9385127b50 Consolidate temp_img_buffer resizing and use correct delete[] operator 2022-07-30 22:27:41 -04:00
Doug Nazar f4dd897ef4 Convert AVFrame* to custom unique_ptr (av_frame_ptr).
Switch all owning AVFrame* variables to av_frame_ptr for
automatic cleanup.

Use AVBufferRef to store frame data in AVFrame where appropriate
so that it can be freed automatically with it's AVFrame.

Handle allocation errors.
2022-07-30 13:21:11 -04:00
Doug Nazar acbdf1854d Add guard to handle resetting AVPacket after use.
Also handle allocation failures.
2022-07-29 14:56:38 -04:00
Doug Nazar 110cc436a3 Switch from av_init_packet() to av_packet_alloc()
Remove all uses of deprecated av_init_packet() and switch any stack
based AVPackets to unique_ptrs allocated with av_packet_alloc().

Ensure that all code paths call av_packet_unref() after use to reset
before next usage.
2022-07-29 14:56:26 -04:00
Isaac Connor 4d31089707 Only decremember warned_count if > 0. Fixes too much logging. Add warning about keyframe interval being > max image buffer setting. 2022-07-29 13:49:34 -04:00