Commit Graph

74 Commits

Author SHA1 Message Date
Isaac Connor 16c24240f7 clean out old threaded code that has been #defined out for a long time. When EOF, after re-opening, continue instead of logging the error 2018-01-28 15:14:38 -05:00
Isaac Connor 50fc4a2d94 Use a memory table called Monitor_Status to store FPS and Status info for Monitors. This is to reduce locking and updates on the main Monitors table. 2018-01-24 11:51:11 -05:00
Isaac 4127aa50f3 simplify logic, improve debugging 2018-01-22 03:26:25 +01:00
Isaac Connor 687d797303 Only log debug message about excluding audio if there is an audio stream 2018-01-17 09:53:03 -05:00
Isaac Connor 7f4deef4a9 Move debug comment about opening audio codec into the part where the audio codec is opened 2018-01-17 09:21:17 -05:00
Isaac Connor a9bbe3e85c remove debug lines 2017-12-12 12:36:35 -05:00
Isaac Connor d73f9e8a73 wip, crashes 2017-11-28 11:11:41 -05:00
Isaac Connor 1e50df741f fix some memleaks 2017-11-28 09:50:09 -05:00
Isaac Connor 159c0a7165 moer cppcheck fixes 2017-11-17 07:52:26 -05:00
APHW2 MFGENG e17bcb9178 updates for mast ffmpeg 2017-11-07 18:21:51 -08:00
Isaac Connor 0a3327e2d2 move test for h264 into the code that opens the stream instead of comparing on every capture 2017-11-05 09:59:27 -05:00
Isaac Connor cab8c4cd5e cleanup Monitor::Capture. Cleanup the return values from Capture and CaptureAndRecord. <0 is error, 0 is things ok, but no video frame. > 0 means we have a frame. Plus google code style 2017-11-03 13:49:42 -04:00
Isaac Connor a8b679e479 set frameCount for audio packets too so that a long period of just audio will return and update lastframesent etc. 2017-11-02 11:45:33 -04:00
Isaac Connor 2a39cf2bcd split videostore opening out of the constructor so that we can test for failure 2017-09-25 15:28:14 -04:00
Isaac Connor a81ff85fbb add ffmpeg decoding of a .mp4 to get the frames 2017-08-23 15:05:44 -04:00
Isaac Connor eb5cee7f3e use ifdef around uses of AV_CODEC_ID_H265 and fix google code style 2017-08-23 10:14:06 -04:00
Isaac Connor e98ea0b891 fix non hwaccel build 2017-08-22 10:47:37 -04:00
Isaac Connor a63d0878b6 remove more hwaccel code 2017-08-16 13:41:44 -04:00
Isaac Connor da5438a6ff detect hardware accel capabilities 2017-08-16 12:16:15 -04:00
Isaac Connor 9e2aa941fc rough in vaapi and qsv decoders. More debugging 2017-08-16 11:31:47 -04:00
Isaac Connor ad0644b906 Merge branch 'storageareas' into vaapi 2017-08-15 16:05:25 -04:00
Isaac Connor 591fdfe68c fix 2017-08-15 13:44:23 -04:00
Isaac Connor adab628af9 fix video speed, various other 2017-08-14 18:22:52 -04:00
Isaac Connor b255414bbb Merge branch 'storageareas' into remove_ffmpeg_thread 2017-08-14 11:15:25 -04:00
Isaac Connor 0f0ab6170b Don't decode video until we have received a keyframe. 2017-08-14 11:15:09 -04:00
Isaac Connor daee5b4450 experiment with no ffmpeg thread 2017-08-11 12:03:37 -04:00
Isaac Connor 536ccc0cec maybe fix memleak, maybe fix crash 2017-08-10 15:44:20 -04:00
Isaac Connor cc28af8ed2 rework things to always start the recording on a video keyframe. Also fix pts/dts of remaining audio frames 2017-08-09 12:50:46 -04:00
Isaac Connor 00533fc624 potentially fix memleaks 2017-08-03 12:41:26 -04:00
Isaac Connor 4f032c8e65 rough in vaapi 2017-08-02 16:15:11 -04:00
Isaac Connor 259b7f7655 fix memleak 2017-07-31 15:49:27 -04:00
Isaac Connor e92974c5d4 fix spacing 2017-07-13 09:41:46 -04:00
Isaac Connor 119f8fc86c Fix version checks to fix build on yaketty 2017-06-15 13:02:54 -04:00
Isaac Connor dd70eb3e5f more deprecation fixes 2017-06-13 17:06:50 -04:00
Isaac Connor 0ac26277e3 debug, fix deprecations, fix audio 2017-06-02 16:52:52 -04:00
Isaac Connor 915450de13 spacing and comments 2017-06-01 17:48:52 -04:00
Isaac Connor 2eabf13eaf handle deprecations, make some logic more clear 2017-05-31 20:44:13 -04:00
Isaac Connor b1f8485969 Fix videostorage (#1885)
* merge relevant c bits to make h264 recording work

* h264 code requires libavresample and boost

* Need libavresample
2017-05-16 12:04:56 -04:00
Isaac Connor c859f7291c Feature h264 videostorage (#1882)
* Moved writing of configure options from Controller to Model.  Fixes #191.

* Initial commit for saving events as videos :)

* Add zm_video.cpp to autotools

* Add zm_video.h to autotools

* Search for MP4V2 header file 3 times: mp4v2/mp4v2.h, mp4v2.h, mp4.h

* Fix serve memory leak

* Few minor code improvements

* Added the ability to override preset, tune, profile and few other improvements

* Correctly write SPS & PPS from x264 encoder headers

* Remove unnessecary SPS & PPS writing code

* Imported missing files from master to feature-h264-videostorage

* Audio support including fixes for dts/pts, split on keyframe and update to mkv extension to prevent ffmpeg problems writing rtsp audio to mp4 containter (header problem)

* Updates to make gcc happy

* Add html5 video control to timeline and event to support mkv playback

* Add zm_videostore.cpp to CMakeLists.txt

* Remove Modern Branch for now

* Fix minor bug

* Option handled added in master, removing duplicate declaration

* Add CaptureandRecord from zm_camera.h

* Putting placeholder in for CaptureAndRecord function

* Removed duplicate code and brackets

* add digest auth file for cmake

Conflicts:
	src/CMakeLists.txt

* Add web dir back into Makefile.am
Revert "Removed web from SUBDIRS in Makefile.am"

This reverts commit d9bbcdf3a9.

* Add CaptureAndRecord to vlc, still need to make it record

* Resolve SegFault on videostore

* Swap to mp4 container

* mp4 changes

* spaces to tabs, hide video stuff if video writer is turned off

* Make timeline open event.mp4 instead of mkv

* Missed mkv in timeline.js

* Fix some issues from the merge conflict

* Resolve post merge build issues with braces

* Fix whitespace

* Update Jpeg and Video options for passthrough options

* Whitespace fix zm_camera.h

* Fix array mkssing comma

* Add support for Jpeg save options for h264 branch snapshot. Might remove altogether if snapshots not needed

* Update VideoStoreData memory size comment

* Change from config.use_mkv_storage to per monitor option VideoWriter from video branch

* Fix bracket issues post merge

* Clean up comments and add av_free_packet

* Convert from event_directory to event file as per Video branch

* Testing videojs for video playback

* Fixed a missing bracket post merge and also SQL_values now used for EventID and Monitors

* bring recent improvements in ffmpeg capture function into captureandrecord

* Remove pict from writeAudioFramePacket as not used

* Add translate options for h264 Storage options in Monitor and update en_gb file

* Cherry-Pick from iconnor - make it compile on ubuntu 15.04.  Which is libav 56.1.0

Conflicts:
	src/zm_ffmpeg.cpp
	src/zm_remote_camera_rtsp.cpp

Conflicts:
	distros/ubuntu1204/changelog

* Clean up videostore code and remove lots of unused code

* proof of concept for dynamic/automatic video rotation using video-js plugin zoomrotate

Conflicts:
	web/skins/classic/views/event.php

* removed redundant field in sql query

Conflicts:
	web/skins/classic/views/event.php

* local storage of video js plugin

* Beautify!

Make the code somewhat readable.

* added missing videojs.zoomrotate.js file

added missing videojs.zoomrotate.js file

* Typo

added missing "

* Added missing brackets

* fix to display thumbnails when only storing snapshot.jpg

* added control for video playback rate

Conflicts:
	web/skins/classic/views/event.php

* dynamically create jpegs from video file for viewing in browser

* fix timeline view for SaveJPEGs monitors (without enabled VideoWriter)

* only expose monitor info which are being used in client

* fix segmentation fault in zma with ubuntu 14.04 and ffmpeg 2.5.8 (gcc 4.8)

when libx264 is not installed

* better way of detecting showing image or video in timeline and event view

instead of Monitor.VideoWriter, Event.DefaultVideo is used, so even if
VideoWriter/SaveJPEG option is changed, a valid image or video will always be
displayed for historical events in both timeline and event view

this also fixes loading videos in timeline view

* Fixes problem of crashing zmc when bad packet arrives causing av_interleaved_write_frame() to return non-zero (-22).  Prefilters common packet issues. Add metadata title to generated video file

* Remove syslog.h

* fixed SaveJPEGs are not working

which is caused in errors introduced when merging with master

* Update README.md

* Fix build warnings specific to h264 branch, unused FrameImg, unused ret and int64_t snprintf issues

* Fix PRId64 issue in travis, builds locally fine, but I can see a gcc version issue here

* Fix PRId64 issue in travis, another try

* Try "STDC_FORMAT_MACROS" to see if that helps Travis on gcc 4.6.3

* Revert space removal around PRId64

* video branch ffmpeg 2.9 fixes

ffmpeg 2.9 patched removed SSE2 CPU

* Add FFMPEGInit back

* use webvvt to overlay timestamp (honoring Monitor.LabelFormat) to videos in timeline and event

also fixed bug which prevented seeking in timeline video preview

* ffmpeg 3.0 API build failure fixes

* Update README.md

* merge all the commits from the messed up iconnor_video branch

* fix whitespace

* revert

* whitespace fixes

* spelling fix

* put back some text

* add these back

* fix spelling mistake

* Steal some packet dumping routines from ffmpeg. Convert them to use our logging routines

* add a test and error message if the codec is not h264

* these have been removed in master

* add a view to check auth and just send the video

* add some comments, and dump filename and AVFormatContext on failure to write header

* add the toggle for RecordAudio so that the checkbox works to turn off Audio

* Must init videoStore in constuctor

* more debug and comments, return checking

* Fix dropped part of sql query.

* fix extra else and some whitespace

* Fix missing } from merge that was preventing building.

* fix tabs

* get rid of use of separator, just use \n

* Restore lost fixes for deprecation

* Why are these failing

* Respect record_audio flag when setting up video file so dont try and initiliase mp4 with unsupported audio

* Forgot that I was trying to solve case of stream is true and record_audio
is false.

* Pass swscale_ctx back in to getCachedContext or it will create new
context every frame and leak memory like a mofo.

* Add libx264-dev and libmp4v2-dev to build requires to save hassle of
ensuring they are installed before build.

* Merge my Rotation/Orientation work and fixes for bad h264 streams

* need arpa/inet for reverse lookups

* pull in the new byte range code for viewing videos

* Move our recording flag deeper into closeevent

* add braces and only call closeEvent if there is an event

* deprecate the z_frame_rate stuff which is deprecated in ffmpeg

* remark out some debugging

* fix for video on stream 1

* fix audio_stream to audio_st

* Ignore bad decodes

* fix problems with content-length causing viewing to not work in chrome/android

* change logic of sending file contents to handle an off by one and be more readable

* Some fixes pointed out by Maxim Romanov.  Also simply the loading of events to not join the Monitors table

* fix to sql for timeline

* added RecordAudio to sql in README

* Use sub queries instead of joins to fix errors when using new mysql defaults.

* fix sql queries

* Dockerfile to build feature-h264-videostorage

* Must cast codec

* add php-acpu as a dependency

* require php5-acpu

* fix typo

* remove extra /

* Add a line for out-of-tree builds to do api/lib/Cake/bootstrap.php

* delete merge conflict files

* delete merge conflict files
2017-05-15 22:02:48 -04:00
Andy Bauer 254fcbcef7 update gpl 2 mailing address in source files 2016-12-26 09:23:16 -06:00
Steve Gilvarry 1a684b7709 Remove whitespace 2016-07-28 23:22:34 +10:00
Steve Gilvarry 71e3789bd0 Use av_dict_parse_string to split ffmpeg options, and remove creating strings to split them in next step for rtsp_transport 2016-07-28 23:15:01 +10:00
Steve Gilvarry 8452c4bce5 Fix tab to spaces merge issues 2016-04-29 21:27:28 +10:00
Isaac Connor 03b1ced568 tabs to spaces and use 2space indenting 2016-04-04 10:11:48 -04:00
Jon Burgess bfd846bbff Add more logging to diagnose problems with applying ffmpeg options 2016-03-20 21:44:58 +00:00
SteveGilvarry 2122d6e443 Fix all the av_picture related deprecations 2016-03-03 01:03:55 +11:00
SteveGilvarry e70d037895 Start avpicture deprecation 2016-02-27 01:23:20 +11:00
SteveGilvarry 5ba13f1a76 ffmpeg 2.9 patched removed SSE2 CPU flags as these are automatically detected
for all ffmpeg versions circa 2010. This commit removes the if statement on
duplicated functions.
2015-11-04 16:24:39 +11:00
SteveGilvarry 51914994f7 Migrating from av_free/av_freep to av_frame_free using libavcodec version
check. Also replaced recently deprecated av_free_packet with av_packet_unref.
2015-11-04 15:30:14 +11:00
Dmitry Smirnov 0ff7a4e616 Replace deprecated FFmpeg API
Fixes FTBFS with ffmpeg-2.9; compatible with ffmpeg-2.8.

Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803850
2015-11-03 11:58:23 +11:00