Commit Graph

163 Commits

Author SHA1 Message Date
Selva Nair dd31279ca3 Fix the recorded video start time
The event start time already includes the duration of the
pre_event frames. Do not back track the video by a further
pre_event_count.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2019-11-15 21:55:40 -05:00
Selva Nair 2e7fad68d1 Properly compute video buffer length when analysis fps is set
Currently the number of video frames kept in the buffer is set as the
pre_event_count. This falls short when the capture fps is larger
than the analysis fps. Fix by computing the retained video duration
as pre_event_count/analysis_fps

No change if analysis fps is not set.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2019-11-15 21:55:40 -05:00
Isaac Connor 46991f04e6 better debugging when fail to sws_scale 2019-11-01 09:24:22 -04:00
Isaac Connor 7068769a90 zm_send_packet_receive_frame sends 0 as success 2019-10-18 13:52:07 -04:00
Isaac Connor 1dda79af46 remove debug 2019-09-25 12:00:00 -04:00
Isaac Connor 17e00cec94 Fix setting rtsp_transport when rtsp 2019-09-17 14:58:16 -04:00
Isaac Connor 4509c6a239 Don't set rtsp options unless we are using rtsp. Should prevent everyone from reporting the warning about unsupported options. Note that I removed some extra includs that have no business in zm_ffmpeg_camera. 2019-09-17 10:31:31 -04:00
Isaac Connor 701aa8d924 add flushing the resample buffer to get the remaining samples encoded 2019-09-13 10:55:30 -04:00
Isaac Connor 59940ab675 report pixformat names instead of just #'s on error 2019-08-28 09:19:57 -04:00
Isaac Connor 886a203bf1 Support hwaccel for non-passthrough case as well 2019-08-21 10:11:58 -04:00
Isaac Connor 01e988ffba remove some redundant debugs. Improve some messages 2019-08-20 14:09:47 -04:00
Isaac Connor ed190340b9 fix typo 2019-08-19 11:12:47 -04:00
Isaac Connor c1984ad7cb Fix problem calculating mem_size using an int from ImageSize. With camera resolutions going up, width*height*colour could exceed 32bits. So use a guarnteed 53bit type, which fixes the memsize calculations. Fixes #2682 2019-08-11 20:21:37 -04:00
Isaac Connor 5b62c91cc2 Improve some debugging to try to diagnose recent segfault report 2019-08-10 14:46:05 -04:00
Isaac Connor bb6d2631c9 Fix hwaccel compile on pi 2019-08-08 09:26:40 -04:00
Isaac Connor f3166663a5 unref hw_device_ctx on Close. I think this should release all the other hwaccel related stuff 2019-07-19 12:51:31 -04:00
Isaac Connor 542d88b6a4 fix compile without HWCONTEXT 2019-07-17 21:10:24 -04:00
Isaac Connor 75af397223 hwFrame isn't defined unless we have HWCONTEXT_H 2019-07-17 20:33:23 -04:00
Isaac Connor ef9fe2dbd6 Free up hwFrame, preventing memleak 2019-07-17 10:06:30 -04:00
Isaac Connor 94cc85aa36 Sorta fix pts on encoded audio packets. Sync is off, but at least it is close 2019-07-07 08:57:22 -04:00
Isaac Connor 726e5c6dd5 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2019-07-03 09:50:49 -04:00
Isaac Connor a9579484b8 gracefully handle failure to config hw pix fmt and debug a bit more 2019-07-03 09:49:53 -04:00
Isaac Connor 2dc60196c5 Code cleanup and cpplint 2019-07-02 11:14:24 -04:00
Isaac Connor dd57fd95ce Clean up cruft from videostore api. Fix packetqueue clear_unwanted_packets to take a pre_event_count and take it into consideration when finding the right spot in the queue to start recording. 2019-06-27 11:11:14 -04:00
Isaac Connor 0686f487ac %s => %d for error count 2019-06-27 04:18:25 -04:00
Isaac Connor d26286a170 fix test for hwtransfer needed 2019-06-27 03:40:18 -04:00
Isaac Connor 2a65b339c1 init hw_pix_fmt in constructor 2019-06-25 22:19:09 -04:00
Isaac Connor 7389bbcb25 better debug in selecting hw_format, add CUDA, add setting device for hwaccel 2019-06-25 21:47:19 -04:00
Isaac Connor a44631a59d rough in support for ffmpeg 3.4 2019-06-25 16:35:07 -04:00
Isaac Connor 5ab4414b11 Only include hwaccel support if LIBAVUTIL_HWCONTEXT_H is deifned 2019-06-25 15:58:55 -04:00
Isaac Connor 679b6b1b2d remove old qsv code 2019-06-25 15:47:23 -04:00
Isaac Connor cf7f3e8a88 add passing hwaccel name and device. use av_make_error_string(ret).c_str() to reduce code and increase consistency 2019-06-25 15:33:54 -04:00
Isaac Connor 2cbcaeebbc clean out old hwdecode stuff. refactor common code out 2019-06-25 14:11:59 -04:00
Isaac Connor 246b4cb9d1 working hwdecode 2019-06-24 17:22:59 -04:00
Isaac Connor dab9544845
Revert audio sync fixes (#2646)
* Reference /run/zm instead of /var/run/zm because systemd-tmpfiles complains about it

* Spacing, google code style and tabs to spaces

* Revert the work I did to srt packets by dts after changing their time_base.  It doesn't work.  Instead since dts doesn't actually matter to playback, only ffmpeg storing, munge it to whatever is neccessary to make ffmpeg happy.
2019-06-24 11:27:47 -04:00
Isaac Connor 470da03322 Merge sync fixes from storageareas 2019-06-20 15:14:20 -04:00
Isaac Connor 30a210f68f also need to adjust dts of last packet when switching events 2019-06-12 10:05:08 -04:00
Isaac Connor 0a9ae1d4f9 Include pixdesc.h to get av_get_pix_fmt_name(AVPixelFormat) 2019-06-11 13:55:57 -04:00
Isaac Connor acb95709e6 Fix issues with too much audio in events by storing packets in the queue with their timestamps converted to AV_TIME_BASE_Q, so that we can sort video and audio packets together. 2019-06-11 10:19:42 -04:00
Isaac Connor 7671f59d2f Add error counting on decoding 2019-04-09 12:27:40 -04:00
Isaac Connor accaeadb18 code cleanup. dump_codecs 2019-04-08 13:51:41 -04:00
Isaac Connor 9faaba9300 Merge branch 'master' of github.com:ZoneMinder/ZoneMinder 2019-04-05 15:18:39 -04:00
Isaac Connor 9ae6acf532 Fix for opening audio_in_codec 2019-04-04 17:20:21 -04:00
Isaac Connor d97dd6cdd9 Should close videostore before closing input codecs/streams. 2019-04-04 14:11:56 -04:00
Isaac Connor bd412fa9ca Merge branch 'master' of github.com:ZoneMinder/ZoneMinder 2019-04-02 14:25:50 -04:00
Isaac Connor 036560e3e9 Allow packets with pts=AV_NOPTS_VALUE 2019-04-02 14:23:49 -04:00
Isaac Connor a6998cbc9e Use FFMPEGDeInit instead of avformat_network_deinit 2019-04-01 13:39:11 -04:00
Isaac Connor 6c8eac1ac8 Merge branch 'storageareas' into h265 2019-03-06 11:10:01 -05:00
Isaac Connor 5029d7214a Merge branch 'master' into storageareas 2019-02-18 17:00:45 -05:00
Isaac Connor 9996b3e718 Merge branch 'master' into break_videostorage 2019-02-17 12:10:32 -05:00