Commit Graph

5465 Commits (ee0776c9708f9088b2fdb22f65d30de9b72f8ad4)

Author SHA1 Message Date
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
Isaac Connor 7f192c4e47 Merge pull request #3551 from dougnazar/fix_crash
Fix zmc Segfault on 1.36.20
2022-07-28 16:28:32 -04:00
Isaac Connor 33943acbc4 Code style, spacing. Move check for trailing slash into the if specified janus_path part 2022-07-28 16:27:28 -04:00
Isaac Connor f463246e43 Log reorder_queue_size 2022-07-28 15:46:01 -04:00
Isaac Connor 5cb5132bf7 Fix crash due to double delete of Janus_Manager 2022-07-28 15:26:32 -04:00
Isaac Connor b2bcd9bc25
Merge pull request #3545 from dougnazar/misc_fixes
Misc fixes
2022-07-27 12:42:44 -04:00
Doug Nazar 590697bd80 Add padding to shared_data to re-align fields on 32bit 2022-07-27 12:25:47 -04:00
Isaac Connor bd304ecbec include ffmpeg.h. Fixes #3539 2022-07-26 19:09:16 -04:00
Isaac Connor 8a8a5fd5c0 rename Onvif_Alarm_Txt to ONVIF_Alarm_Text 2022-07-23 16:09:01 -04:00
Doug Nazar c030416500 Fix truncation warning. 2022-07-22 19:52:09 -04:00
Doug Nazar 3b69a51ff8 Try to fix warning again that printf might exceed buffer.
The last fix worked on GCC 11 & 12 but broke GCC 8.
2022-07-22 12:00:42 -04:00
parvit (Vittorio Parrella) e4a8017b6b
added configuring of authentication for rstp cameras 2022-07-22 07:08:22 -04:00
Isaac Connor 95530a4f7d
Merge pull request #3529 from dougnazar/fix_printf_formats
Fix printf formats & enable large file support for 32-bit
2022-07-20 11:44:26 -07:00
ovargasp 981769b9db
Allows users to set an specific "Onvif alarm text" for each monitor (#3535)
* Allows users to set an specific "Onvif alarm text" for each monitor

With this personalization the cameras that use strings different to "MotionAlarm"
such as Dahua, will be able to process their Onvif alarms. To make it easier, the change
sets a default "Alarm Text"  value for it to work out of the box and then allows to
modify it according to the particular necessities of each brand. It consists of
a new column on table Monitors, changes on Monitors.h, Monitors.cpp and a change
on UI to manage the value of Alarm Text per camera.

Updated es_la.php language file.

Co-authored-by: ovargasp <ovargasp@hoitmail.com>
2022-07-20 12:51:13 -05:00
Doug Nazar 5b44ee729d Fix sendfile calling convention taking into account possible null offset parameter. 2022-07-16 10:05:46 +00:00
Doug Nazar df414fc028 Need to cast duration to system_clock resolution. 2022-07-16 10:03:54 +00:00
Doug Nazar 3c5e44dfe5 Need unistd.h for getpid(). 2022-07-16 10:03:16 +00:00
Doug Nazar 0db4a18ff6 Switch to unsigned int for loop to restrict size of printf.
GCC 12 incorrectly detects a format truncation.

src/zm_logger.cpp:86:39: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 2 [-Wformat-truncation=]
   86 |       snprintf(code, sizeof(code), "DB%d", i);
      |                                       ^~
src/zm_logger.cpp:86:36: note: directive argument in the range [-2147483647, 9]
   86 |       snprintf(code, sizeof(code), "DB%d", i);
      |                                    ^~~~~~
2022-07-16 03:21:25 -04:00
Doug Nazar 3b21153757 Fix various printf formats for 32bit, 32bit w/_FILE_OFFSET_BITS=64 and 64-bit 2022-07-16 03:18:18 -04:00
Isaac Connor 1798d95b8b Have working monitorlink expressions 2022-07-14 17:25:51 -04:00
Isaac Connor e4bd2d351a Merge branch 'master' into monitorlink_expressions 2022-07-14 14:42:56 -04:00
Isaac Connor 54a0f5d8df Fixup verifyToken to use refs for strings 2022-07-14 13:53:23 -04:00
Isaac Connor 4caffe4674 Include iostream since we use it 2022-07-14 13:42:54 -04:00
Isaac Connor 576448e906 Fix memleak when not doing passthrough 2022-07-14 13:10:43 -04:00
Isaac Connor d0ca677207 Fix %u instead of %d for id which is unsigned. Pass string instead of c_str 2022-07-14 12:07:26 -04:00
Isaac Connor 9db65f5c5f Remove unneeded = assignments 2022-07-14 12:03:49 -04:00
Isaac Connor 66f5b9b93d Remove zm_rtsp_server_thread as it isn't used anymore 2022-07-14 12:01:10 -04:00
Isaac Connor fbe70df1b6 use const and just pass string 2022-07-14 11:57:35 -04:00
Isaac Connor 129e712692 Remove redundant assignment 2022-07-14 11:53:05 -04:00
Isaac Connor 61fcd60a40 initialize all members and make lostInterval an int since we can get negative numbers when doing subtraction 2022-07-14 10:58:42 -04:00
Isaac Connor fd566b2212 Pass std::strings by ref 2022-07-14 10:53:47 -04:00
Isaac Connor b29e61b30e Don't need to check for mAuthenticator, can just delete it 2022-07-14 10:52:14 -04:00
Isaac Connor eb8646f1de Pass std::strings by ref 2022-07-14 10:51:49 -04:00
Isaac Connor 90e27e9d3a Just pass the std::string not c_str() 2022-07-14 10:51:39 -04:00
Isaac Connor 774adcf7cc Use nullptr instead of 0 when initialising hp 2022-07-14 10:44:00 -04:00
Isaac Connor 64a9120ea7 packet_counts is always true here 2022-07-14 10:42:01 -04:00
Isaac Connor 4f2dc894d5 get rid of got_packet to quiet cppcheck 2022-07-14 10:35:22 -04:00
Isaac Connor 4ab8166665 Init Janus_Healthy although it is never used 2022-07-14 10:29:10 -04:00
Isaac Connor 0cd315c6a4 reduce scope of CurlMsg m 2022-07-14 10:26:55 -04:00
Isaac Connor 43649e1e36 Don't need to test for event 2022-07-14 10:25:19 -04:00
Isaac Connor b4c832c789 Code style, initialize Amcrest_Alarmed to false in constructor 2022-07-14 10:25:05 -04:00
Isaac Connor e589171138 mFormatContext is already in Camera 2022-07-14 10:18:53 -04:00
Isaac Connor f96e5e526d MOptArgV points into opVect so it needs to stick around. 2022-07-14 10:14:29 -04:00