Commit Graph

39 Commits

Author SHA1 Message Date
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
Andrew Bauer f289b84901 move VIDEO_MAX_FRAME up 2016-06-06 19:04:02 -05:00
Andy Bauer 06923d44ba Set VIDEO_MAX_FRAME if it is not defined 2016-06-06 16:27:13 -05:00
Isaac Connor 03b1ced568 tabs to spaces and use 2space indenting 2016-04-04 10:11:48 -04:00
SteveGilvarry bc5ef6c599 Handle PixelFormat to AVPixelFormat change using _AVPIXELFORMAT and version
check to define correctly. Also at same time define all AV_PIX_FMT_* to
PIX_FMT_*
2015-11-04 12:46:26 +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
Andrew Bauer 549d7fd426 include libv4l1-videodev headers 2015-04-03 18:24:51 -05:00
Isaac Connor 9385471392 move v4l_multibuffer and v4l_captures_per_frame from Config to Monitor and Local Camera 2014-07-13 16:39:27 -04:00
Kfir Itzhak f27b424503 Much more progress!
1) Removed the V4L2_CAPTURE_FIELDS option.
2) V4L2 Interlacing control options added to the new per-monitor deinterlacing option.
3) Fixed the 32bit version of Linear.
4) Added Blend (50%) and Blend (25%).
5) Completed the grayscale version of the Four Field Motion Adaptive deinterlacing algorithm.
2012-07-13 20:11:16 +03:00
Kfir Itzhak 066fe89718 Added automatic capture palette selection. 2012-02-01 07:33:21 +02:00
Kfir Itzhak ea3a1a9072 1) Removed the mmap file removal at shutdown.
2) ZoneMinder should now compile cleanly wihout swscale
3) Fixed multiple monitors capturing from the same device and channel.
Current code allows for multiple monitors sharing the same device, each on a different channel
Or, multiple monitors sharing the same device, all on the same channel.
In both cases, capture method, width, height and palette must be identical on all monitors.
However, target colorspace can be different because each monitor handles the format conversion separately.
2012-02-01 07:33:20 +02:00
Kfir Itzhak c3ecdd00e0 1) Relocated conversion functions and tables to zm_image.cpp
2) SSE2 aligned memcpy now functional
3) Fixed fill functions bug from an earlier commit
4) Many changes to zm_local_camera.cpp format selection
5) Fixed memory leak in AssignDirect()
6) Fixed Target Colorspace webinterface issues
7) Small other changes
2012-02-01 07:33:20 +02:00
Kfir Itzhak 5c418133bf Lots accomplished!
1) Delta and blend SSE and standard alogirthms inside
2) Changed event streaming to use sendfile() syscall if available
3) Direct memory capture (Less memcpys required)
4) Added macros for BGR24 and RGB32(and its variants) formats
5) Modified Monitors database table to add a target colorspace option
6) Changed most image buffer allocations to be on 16 byte boundary, work still in progress
7) Added Target colorspace instead of the old colours selection. this one also visible to local cameras
8) Replacing Y deltas option with ZM_CPU_EXTENSIONS
9) Added SSE detection code
10) Changed some code to make linking success with inlining enabled.
11) Some other changes and work still in progress for some listed above
2012-02-01 07:33:20 +02:00
stan 8048c1c355 Updated to allow the versions of video4linux to existed independently of each other. Ubuntu 11.04 oalyn has V4L2.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3302 e3e1d417-86f3-4887-817a-d78f3d33393f
2011-02-15 21:59:06 +00:00
stan afe253b71a Added V4L2 query
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2827 e3e1d417-86f3-4887-817a-d78f3d33393f
2009-03-31 12:57:34 +00:00
stan 20580582b3 Minor header file reorg
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2811 e3e1d417-86f3-4887-817a-d78f3d33393f
2009-03-23 21:56:30 +00:00
stan 28692c1b28 Fixed greyscale issue and don't do format conversion if not required.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2777 e3e1d417-86f3-4887-817a-d78f3d33393f
2009-02-18 12:30:43 +00:00
stan 3a86651627 Reworked multi-buffering etc for V4L multi-sources.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2775 e3e1d417-86f3-4887-817a-d78f3d33393f
2009-02-17 21:23:27 +00:00
stan 1195e8e27c More multi-cam tweaks.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2757 e3e1d417-86f3-4887-817a-d78f3d33393f
2009-02-12 22:26:28 +00:00
stan 98b648bfc1 Fixes to multiple cameras on one device.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2756 e3e1d417-86f3-4887-817a-d78f3d33393f
2009-02-12 21:33:05 +00:00
stan a941e28b37 Updated for latest ffmpeg.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2750 e3e1d417-86f3-4887-817a-d78f3d33393f
2009-02-09 14:54:09 +00:00
stan dde584a12a Restructured camera capture methods somewhat and revamped V4L stuff a bit.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2724 e3e1d417-86f3-4887-817a-d78f3d33393f
2009-01-28 09:48:06 +00:00
stan e6041e24a7 Uppdated copyright headers
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2611 e3e1d417-86f3-4887-817a-d78f3d33393f
2008-07-25 09:33:23 +00:00
stan d598f54210 Merged in V4L2 initial changes.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2582 e3e1d417-86f3-4887-817a-d78f3d33393f
2008-07-21 15:20:52 +00:00
stan aa26ab7b18 git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2532 e3e1d417-86f3-4887-817a-d78f3d33393f 2008-07-16 08:35:59 +00:00
stan ed0626492f Bug 374 - Multiple monitors can now share the same video device source without penalty.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2030 e3e1d417-86f3-4887-817a-d78f3d33393f
2006-10-24 14:37:34 +00:00
stan 7ad5388fc3 Bug 265 - Fixed memory access errors due to pointers to free'd mysql query data.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1849 e3e1d417-86f3-4887-817a-d78f3d33393f
2006-01-21 17:58:46 +00:00
stan 235dde1a80 Updated copyright statement.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1829 e3e1d417-86f3-4887-817a-d78f3d33393f
2006-01-17 10:56:30 +00:00
stan 74e4bd5737 Bug 73 - Made video devices use paths rather than numbers
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1519 e3e1d417-86f3-4887-817a-d78f3d33393f
2005-10-17 10:58:25 +00:00
stan c643b81627 Bug 45: Added lazyleoppard deinterlacing patch.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1459 e3e1d417-86f3-4887-817a-d78f3d33393f
2005-06-13 10:21:54 +00:00
stan 264c23d687 Updated copyright statement
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1360 e3e1d417-86f3-4887-817a-d78f3d33393f
2005-02-24 14:40:14 +00:00
stan aff2ef8430 Added persistent brightness etc feature.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1114 e3e1d417-86f3-4887-817a-d78f3d33393f
2004-09-25 16:37:41 +00:00
stan 626d91fd29 Merged in fast deltas and other optimisations.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@854 e3e1d417-86f3-4887-817a-d78f3d33393f
2004-02-15 19:53:10 +00:00
stan d543323c9a Added ability to control camera settings.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@576 e3e1d417-86f3-4887-817a-d78f3d33393f
2003-06-25 09:47:09 +00:00
stan b5d6859bd4 Added orientation and tidied up a bit.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@529 e3e1d417-86f3-4887-817a-d78f3d33393f
2003-05-02 15:03:16 +00:00
stan d1fd5c0828 Changed colours to palettes and now supports YUV420P.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@471 e3e1d417-86f3-4887-817a-d78f3d33393f
2003-04-12 16:17:17 +00:00
stan 0767828431 News files created as a result of breaking out the classes to support
the use of remote cameras.


git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@409 e3e1d417-86f3-4887-817a-d78f3d33393f
2003-03-26 11:57:29 +00:00