2008-07-14 21:54:50 +08:00
< ? php
//
// ZoneMinder web monitor view file, $Date$, $Revision$
2014-05-18 04:05:57 +08:00
// Copyright (C) 2001-2008 Philip Coombes
2008-07-14 21:54:50 +08:00
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
2016-12-26 23:23:16 +08:00
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2008-07-14 21:54:50 +08:00
//
2015-09-17 02:51:05 +08:00
require_once ( 'includes/Server.php' );
2008-07-14 21:54:50 +08:00
if ( ! canView ( 'Monitors' ) )
{
2008-09-26 17:47:20 +08:00
$view = " error " ;
2008-07-14 21:54:50 +08:00
return ;
}
$tabs = array ();
2015-05-10 21:10:30 +08:00
$tabs [ " general " ] = translate ( 'General' );
$tabs [ " source " ] = translate ( 'Source' );
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 d9bbcdf3a94cba4d8955fcd03bd965ed2772f34d.
* 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-16 10:02:48 +08:00
$tabs [ " storage " ] = translate ( 'Storage' );
2015-05-10 21:10:30 +08:00
$tabs [ " timestamp " ] = translate ( 'Timestamp' );
$tabs [ " buffers " ] = translate ( 'Buffers' );
2008-07-14 21:54:50 +08:00
if ( ZM_OPT_CONTROL && canView ( 'Control' ) )
2015-05-10 21:10:30 +08:00
$tabs [ " control " ] = translate ( 'Control' );
2008-07-14 21:54:50 +08:00
if ( ZM_OPT_X10 )
2015-05-10 21:10:30 +08:00
$tabs [ " x10 " ] = translate ( 'X10' );
$tabs [ " misc " ] = translate ( 'Misc' );
2008-07-14 21:54:50 +08:00
2008-09-26 17:47:20 +08:00
if ( isset ( $_REQUEST [ 'tab' ]) )
$tab = validHtmlStr ( $_REQUEST [ 'tab' ]);
else
$tab = " general " ;
2008-07-14 21:54:50 +08:00
2016-04-15 01:53:10 +08:00
$Server = null ;
2015-07-17 22:09:22 +08:00
if ( defined ( 'ZM_SERVER_ID' ) ) {
2015-07-09 23:41:46 +08:00
$Server = dbFetchOne ( 'SELECT * FROM Servers WHERE Id=?' , NULL , array ( ZM_SERVER_ID ) );
2016-04-15 01:53:10 +08:00
}
if ( ! $Server ) {
2015-08-04 23:48:04 +08:00
$Server = array ( 'Id' => '' );
2015-07-09 23:41:46 +08:00
}
2014-07-14 04:39:27 +08:00
if ( ! empty ( $_REQUEST [ 'mid' ]) ) {
2008-07-14 21:54:50 +08:00
$monitor = dbFetchMonitor ( $_REQUEST [ 'mid' ] );
if ( ZM_OPT_X10 )
2014-07-14 04:39:27 +08:00
$x10Monitor = dbFetchOne ( 'SELECT * FROM TriggersX10 WHERE MonitorId = ?' , NULL , array ( $_REQUEST [ 'mid' ]) );
} else {
2015-07-09 23:41:46 +08:00
2016-04-15 01:53:10 +08:00
$nextId = getTableAutoInc ( 'Monitors' );
$monitor = getMonitorObject ( $_REQUEST [ 'dupId' ]);
$clonedName = $monitor [ 'Name' ];
$monitor [ 'Name' ] = translate ( 'Monitor' ) . '-' . $nextId ;
$monitor [ 'Id' ] = '0' ;
2008-07-14 21:54:50 +08:00
}
2008-07-16 16:40:21 +08:00
if ( ZM_OPT_X10 && empty ( $x10Monitor ) )
{
$x10Monitor = array (
'Activation' => '' ,
'AlarmInput' => '' ,
'AlarmOutput' => '' ,
);
}
2016-04-15 01:53:10 +08:00
function getMonitorObject ( $mid = null )
{
if ( $mid !== null )
{
$monitor = dbFetchMonitor ( $mid );
}
else
{
$monitor = array (
'Id' => 0 ,
'Name' => " willbereplaced " ,
'Function' => " Monitor " ,
'Enabled' => true ,
'LinkedMonitors' => " " ,
'Type' => " " ,
'Device' => " /dev/video0 " ,
'Channel' => " 0 " ,
'Format' => 0x000000ff ,
'Protocol' => " " ,
'Method' => " " ,
'Host' => " " ,
'Path' => " " ,
'Options' => " " ,
'Port' => " 80 " ,
'User' => " " ,
'Pass' => " " ,
'Colours' => 3 ,
'Palette' => 0 ,
'Width' => " 320 " ,
'Height' => " 240 " ,
'Orientation' => " 0 " ,
'Deinterlacing' => 0 ,
'RTSPDescribe' => 0 ,
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 d9bbcdf3a94cba4d8955fcd03bd965ed2772f34d.
* 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-16 10:02:48 +08:00
'SaveJPEGs' => " 3 " ,
'VideoWriter' => " 0 " ,
'EncoderParameters' => " # Lines beginning with # are a comment \n # For changing quality, use the crf option \n # 1 is best, 51 is worst quality \n #crf=23 \n " ,
'RecordAudio' => " 0 " ,
2016-04-15 01:53:10 +08:00
'LabelFormat' => '%N - %d/%m/%y %H:%M:%S' ,
'LabelX' => 0 ,
'LabelY' => 0 ,
'LabelSize' => 1 ,
'ImageBufferCount' => 50 ,
'WarmupCount' => 25 ,
'PreEventCount' => 25 ,
'PostEventCount' => 25 ,
'StreamReplayBuffer' => 1000 ,
'AlarmFrameCount' => 1 ,
'Controllable' => 0 ,
'ControlId' => " " ,
'ControlType' => 0 ,
'ControlDevice' => " " ,
'ControlAddress' => " " ,
'AutoStopTimeout' => " " ,
'TrackMotion' => 0 ,
'TrackDelay' => " " ,
'ReturnLocation' => - 1 ,
'ReturnDelay' => " " ,
'SectionLength' => 600 ,
'FrameSkip' => 0 ,
'MotionFrameSkip' => 0 ,
'EventPrefix' => 'Event-' ,
'AnalysisFPS' => " " ,
'AnalysisUpdateDelay' => 0 ,
'MaxFPS' => " " ,
'AlarmMaxFPS' => " " ,
'FPSReportInterval' => 1000 ,
'RefBlendPerc' => 6 ,
'AlarmRefBlendPerc' => 6 ,
'DefaultView' => 'Events' ,
'DefaultRate' => '100' ,
'DefaultScale' => '100' ,
'SignalCheckColour' => '#0000c0' ,
'WebColour' => 'red' ,
'Exif' => '0' ,
'Triggers' => " " ,
'V4LMultiBuffer' => '' ,
'V4LCapturesPerFrame' => 1 ,
'ServerId' => $Server [ 'Id' ],
);
}
return ( $monitor );
}
2009-03-31 21:00:49 +08:00
function fourcc ( $a , $b , $c , $d )
{
return ( ord ( $a ) | ( ord ( $b ) << 8 ) | ( ord ( $c ) << 16 ) | ( ord ( $d ) << 24 ) );
}
2008-07-16 16:40:21 +08:00
if ( isset ( $_REQUEST [ 'newMonitor' ] ) )
{
$newMonitor = $_REQUEST [ 'newMonitor' ];
if ( ZM_OPT_X10 )
$newX10Monitor = $_REQUEST [ 'newX10Monitor' ];
}
else
2008-07-14 21:54:50 +08:00
{
$newMonitor = $monitor ;
2010-02-16 01:11:17 +08:00
$newMonitor [ 'Triggers' ] = explode ( ',' , isset ( $monitor [ 'Triggers' ]) ? $monitor [ 'Triggers' ] : " " );
2008-07-16 16:40:21 +08:00
if ( ZM_OPT_X10 )
$newX10Monitor = $x10Monitor ;
2008-07-14 21:54:50 +08:00
}
2008-07-16 16:40:21 +08:00
2016-03-29 17:40:14 +08:00
$newMonitor [ 'Name' ] = trim ( $newMonitor [ 'Name' ]);
2015-07-24 06:27:47 +08:00
if ( $newMonitor [ 'AnalysisFPS' ] == '0.00' )
$newMonitor [ 'AnalysisFPS' ] = '' ;
2008-07-22 05:28:50 +08:00
if ( $newMonitor [ 'MaxFPS' ] == '0.00' )
$newMonitor [ 'MaxFPS' ] = '' ;
if ( $newMonitor [ 'AlarmMaxFPS' ] == '0.00' )
$newMonitor [ 'AlarmMaxFPS' ] = '' ;
2014-07-14 04:39:27 +08:00
if ( ! empty ( $_REQUEST [ 'preset' ]) )
{
2013-12-18 01:53:15 +08:00
$preset = dbFetchOne ( 'SELECT Type, Device, Channel, Format, Protocol, Method, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale FROM MonitorPresets WHERE Id = ?' , NULL , array ( $_REQUEST [ 'preset' ]) );
2008-07-14 21:54:50 +08:00
foreach ( $preset as $name => $value )
{
if ( isset ( $value ) )
{
$newMonitor [ $name ] = $value ;
}
}
}
2009-03-31 21:00:49 +08:00
if ( ! empty ( $_REQUEST [ 'probe' ]) )
{
2011-05-22 17:25:33 +08:00
$probe = unserialize ( base64_decode ( $_REQUEST [ 'probe' ]));
2009-03-31 21:00:49 +08:00
foreach ( $probe as $name => $value )
{
if ( isset ( $value ) )
{
$newMonitor [ $name ] = $value ;
}
}
2011-02-16 05:59:06 +08:00
if ( ZM_HAS_V4L && $newMonitor [ 'Type' ] == 'Local' )
2009-03-31 21:00:49 +08:00
{
$newMonitor [ 'Palette' ] = fourCC ( substr ( $newMonitor [ 'Palette' ], 0 , 1 ), substr ( $newMonitor [ 'Palette' ], 1 , 1 ), substr ( $newMonitor [ 'Palette' ], 2 , 1 ), substr ( $newMonitor [ 'Palette' ], 3 , 1 ) );
if ( $newMonitor [ 'Format' ] == 'PAL' )
$newMonitor [ 'Format' ] = 0x000000ff ;
elseif ( $newMonitor [ 'Format' ] == 'NTSC' )
$newMonitor [ 'Format' ] = 0x0000b000 ;
}
}
2008-07-14 21:54:50 +08:00
2008-07-16 16:40:21 +08:00
$sourceTypes = array (
2015-05-10 21:10:30 +08:00
'Local' => translate ( 'Local' ),
'Remote' => translate ( 'Remote' ),
'File' => translate ( 'File' ),
'Ffmpeg' => translate ( 'Ffmpeg' ),
'Libvlc' => translate ( 'Libvlc' ),
2014-04-23 17:12:41 +08:00
'cURL' => " cURL (HTTP(S) only) "
2008-07-16 16:40:21 +08:00
);
2011-02-16 05:59:06 +08:00
if ( ! ZM_HAS_V4L )
unset ( $sourceTypes [ 'Local' ]);
2008-07-16 16:40:21 +08:00
2008-12-06 02:45:01 +08:00
$localMethods = array (
'v4l2' => " Video For Linux version 2 " ,
'v4l1' => " Video For Linux version 1 " ,
);
2011-02-16 05:59:06 +08:00
if ( ! ZM_HAS_V4L2 )
2008-12-06 02:45:01 +08:00
unset ( $localMethods [ 'v4l2' ]);
2011-02-16 05:59:06 +08:00
if ( ! ZM_HAS_V4L1 )
unset ( $localMethods [ 'v4l1' ]);
2008-10-28 22:25:12 +08:00
2008-07-16 16:40:21 +08:00
$remoteProtocols = array (
2008-07-21 23:19:25 +08:00
" http " => " HTTP " ,
" rtsp " => " RTSP "
2008-07-16 16:40:21 +08:00
);
$rtspMethods = array (
2008-07-21 23:19:25 +08:00
" rtpUni " => " RTP/Unicast " ,
" rtpMulti " => " RTP/Multicast " ,
" rtpRtsp " => " RTP/RTSP " ,
" rtpRtspHttp " => " RTP/RTSP/HTTP "
2008-07-16 16:40:21 +08:00
);
2017-02-05 12:34:06 +08:00
$rtspFFMpegMethods = array (
" rtpRtsp " => " TCP " ,
" rtpUni " => " UDP " ,
" rtpMulti " => " UDP Multicast " ,
" rtpRtspHttp " => " HTTP Tunnel "
);
2008-07-16 16:40:21 +08:00
$httpMethods = array (
2008-07-21 23:19:25 +08:00
" simple " => " Simple " ,
" regexp " => " Regexp " ,
" jpegTags " => " JPEG Tags "
2008-07-16 16:40:21 +08:00
);
2008-12-06 02:45:01 +08:00
if ( ! ZM_PCRE )
unset ( $httpMethods [ 'regexp' ]);
// Currently unsupported
unset ( $httpMethods [ 'jpegTags' ]);
2008-07-16 16:40:21 +08:00
2011-02-16 05:59:06 +08:00
if ( ZM_HAS_V4L1 )
{
$v4l1DeviceFormats = array (
" PAL " => 0 ,
" NTSC " => 1 ,
" SECAM " => 2 ,
" AUTO " => 3 ,
" FMT4 " => 4 ,
" FMT5 " => 5 ,
" FMT6 " => 6 ,
" FMT7 " => 7
);
2008-07-16 16:40:21 +08:00
2011-02-16 05:59:06 +08:00
$v4l1MaxChannels = 15 ;
$v4l1DeviceChannels = array ();
for ( $i = 0 ; $i <= $v4l1MaxChannels ; $i ++ )
$v4l1DeviceChannels [ " $i " ] = $i ;
2008-07-16 16:40:21 +08:00
2011-02-16 05:59:06 +08:00
$v4l1LocalPalettes = array (
2015-05-10 21:10:30 +08:00
translate ( 'Grey' ) => 1 ,
2011-05-05 17:52:00 +08:00
" BGR32 " => 5 ,
" BGR24 " => 4 ,
2011-07-01 23:01:24 +08:00
" *YUYV " => 8 ,
2011-05-05 17:52:00 +08:00
" *RGB565 " => 3 ,
" *RGB555 " => 6 ,
" *YUV422 " => 7 ,
" *YUV422P " => 13 ,
" *YUV420P " => 15
2011-02-16 05:59:06 +08:00
);
}
2008-07-16 16:40:21 +08:00
2011-02-16 05:59:06 +08:00
if ( ZM_HAS_V4L2 )
2009-01-27 19:07:24 +08:00
{
$v4l2DeviceFormats = array (
2009-03-30 20:00:14 +08:00
" PAL " => 0x000000ff ,
" NTSC " => 0x0000b000 ,
2009-01-27 19:07:24 +08:00
" PAL B " => 0x00000001 ,
" PAL B1 " => 0x00000002 ,
" PAL G " => 0x00000004 ,
" PAL H " => 0x00000008 ,
" PAL I " => 0x00000010 ,
" PAL D " => 0x00000020 ,
" PAL D1 " => 0x00000040 ,
" PAL K " => 0x00000080 ,
" PAL M " => 0x00000100 ,
" PAL N " => 0x00000200 ,
" PAL Nc " => 0x00000400 ,
" PAL 60 " => 0x00000800 ,
" NTSC M " => 0x00001000 ,
" NTSC M JP " => 0x00002000 ,
" NTSC 443 " => 0x00004000 ,
" NTSC M KR " => 0x00008000 ,
" SECAM B " => 0x00010000 ,
" SECAM D " => 0x00020000 ,
" SECAM G " => 0x00040000 ,
" SECAM H " => 0x00080000 ,
" SECAM K " => 0x00100000 ,
" SECAM K1 " => 0x00200000 ,
" SECAM L " => 0x00400000 ,
" SECAM LC " => 0x00800000 ,
" ATSC 8 VSB " => 0x01000000 ,
" ATSC 16 VSB " => 0x02000000 ,
);
$v4l2MaxChannels = 31 ;
$v4l2DeviceChannels = array ();
for ( $i = 0 ; $i <= $v4l2MaxChannels ; $i ++ )
$v4l2DeviceChannels [ " $i " ] = $i ;
$v4l2LocalPalettes = array (
2011-07-02 20:32:16 +08:00
" Auto " => 0 , /* Automatic palette selection */
2009-01-27 19:07:24 +08:00
/* Pixel format FOURCC depth Description */
2015-05-10 21:10:30 +08:00
translate ( 'Grey' ) => fourcc ( 'G' , 'R' , 'E' , 'Y' ), /* 8 Greyscale */
2011-05-05 17:52:00 +08:00
" BGR32 " => fourcc ( 'B' , 'G' , 'R' , '4' ), /* 32 BGR-8-8-8-8 */
" RGB32 " => fourcc ( 'R' , 'G' , 'B' , '4' ), /* 32 RGB-8-8-8-8 */
" BGR24 " => fourcc ( 'B' , 'G' , 'R' , '3' ), /* 24 BGR-8-8-8 */
" RGB24 " => fourcc ( 'R' , 'G' , 'B' , '3' ), /* 24 RGB-8-8-8 */
2011-07-01 23:01:24 +08:00
" *YUYV " => fourcc ( 'Y' , 'U' , 'Y' , 'V' ), /* 16 YUV 4:2:2 */
/* compressed formats */
" *JPEG " => fourcc ( 'J' , 'P' , 'E' , 'G' ), /* JFIF JPEG */
" *MJPEG " => fourcc ( 'M' , 'J' , 'P' , 'G' ), /* Motion-JPEG */
//"DV" => fourcc('d','v','s','d'), /* 1394 */
//"MPEG" => fourcc('M','P','E','G'), /* MPEG-1/2/4 */
2009-01-28 20:50:58 +08:00
//"RGB332" => fourcc('R','G','B','1'), /* 8 RGB-3-3-2 */
2011-05-05 17:52:00 +08:00
" *RGB444 " => fourcc ( 'R' , '4' , '4' , '4' ), /* 16 xxxxrrrr ggggbbbb */
" *RGB555 " => fourcc ( 'R' , 'G' , 'B' , 'O' ), /* 16 RGB-5-5-5 */
" *RGB565 " => fourcc ( 'R' , 'G' , 'B' , 'P' ), /* 16 RGB-5-6-5 */
2009-01-28 20:50:58 +08:00
//"RGB555X" => fourcc('R','G','B','Q'), /* 16 RGB-5-5-5 BE */
//"RGB565X" => fourcc('R','G','B','R'), /* 16 RGB-5-6-5 BE */
//"Y16" => fourcc('Y','1','6',''), /* 16 Greyscale */
//"PAL8" => fourcc('P','A','L','8'), /* 8 8-bit palette */
//"YVU410" => fourcc('Y','V','U','9'), /* 9 YVU 4:1:0 */
//"YVU420" => fourcc('Y','V','1','2'), /* 12 YVU 4:2:0 */
2011-07-01 23:01:24 +08:00
2013-12-10 21:13:48 +08:00
" *UYVY " => fourcc ( 'U' , 'Y' , 'V' , 'Y' ), /* 16 YUV 4:2:2 */
2011-05-05 17:52:00 +08:00
" *YUV422P " => fourcc ( '4' , '2' , '2' , 'P' ), /* 16 YVU422 planar */
" *YUV411P " => fourcc ( '4' , '1' , '1' , 'P' ), /* 16 YVU411 planar */
2009-01-28 20:50:58 +08:00
//"Y41P" => fourcc('Y','4','1','P'), /* 12 YUV 4:1:1 */
2011-05-05 17:52:00 +08:00
" *YUV444 " => fourcc ( 'Y' , '4' , '4' , '4' ), /* 16 xxxxyyyy uuuuvvvv */
2009-01-28 20:50:58 +08:00
//"YUV555" => fourcc('Y','U','V','O'), /* 16 YUV-5-5-5 */
//"YUV565" => fourcc('Y','U','V','P'), /* 16 YUV-5-6-5 */
//"YUV32" => fourcc('Y','U','V','4'), /* 32 YUV-8-8-8-8 */
2009-01-27 19:07:24 +08:00
/* two planes -- one Y, one Cr + Cb interleaved */
2009-01-28 20:50:58 +08:00
//"NV12" => fourcc('N','V','1','2'), /* 12 Y/CbCr 4:2:0 */
//"NV21" => fourcc('N','V','2','1'), /* 12 Y/CrCb 4:2:0 */
2009-01-27 19:07:24 +08:00
/* The following formats are not defined in the V4L2 specification */
2011-05-05 17:52:00 +08:00
" *YUV410 " => fourcc ( 'Y' , 'U' , 'V' , '9' ), /* 9 YUV 4:1:0 */
" *YUV420 " => fourcc ( 'Y' , 'U' , '1' , '2' ), /* 12 YUV 4:2:0 */
2009-01-28 20:50:58 +08:00
//"YYUV" => fourcc('Y','Y','U','V'), /* 16 YUV 4:2:2 */
//"HI240" => fourcc('H','I','2','4'), /* 8 8-bit color */
//"HM12" => fourcc('H','M','1','2'), /* 8 YUV 4:2:0 16x16 macroblocks */
2009-01-27 19:07:24 +08:00
/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
2009-01-28 20:50:58 +08:00
//"SBGGR8" => fourcc('B','A','8','1'), /* 8 BGBG.. GRGR.. */
//"SGBRG8" => fourcc('G','B','R','G'), /* 8 GBGB.. RGRG.. */
//"SBGGR16" => fourcc('B','Y','R','2'), /* 16 BGBG.. GRGR.. */
2009-01-27 19:07:24 +08:00
/* Vendor-specific formats */
2009-01-28 20:50:58 +08:00
//"WNVA" => fourcc('W','N','V','A'), /* Winnov hw compress */
//"SN9C10X" => fourcc('S','9','1','0'), /* SN9C10x compression */
//"PWC1" => fourcc('P','W','C','1'), /* pwc older webcam */
//"PWC2" => fourcc('P','W','C','2'), /* pwc newer webcam */
//"ET61X251" => fourcc('E','6','2','5'), /* ET61X251 compression */
//"SPCA501" => fourcc('S','5','0','1'), /* YUYV per line */
//"SPCA505" => fourcc('S','5','0','5'), /* YYUV per line */
//"SPCA508" => fourcc('S','5','0','8'), /* YUVY per line */
//"SPCA561" => fourcc('S','5','6','1'), /* compressed GBRG bayer */
//"PAC207" => fourcc('P','2','0','7'), /* compressed BGGR bayer */
//"PJPG" => fourcc('P','J','P','G'), /* Pixart 73xx JPEG */
//"YVYU" => fourcc('Y','V','Y','U'), /* 16 YVU 4:2:2 */
2009-01-27 19:07:24 +08:00
);
}
2011-05-05 17:52:00 +08:00
$Colours = array (
2015-05-10 21:10:30 +08:00
translate ( '8BitGrey' ) => 1 ,
translate ( '24BitColour' ) => 3 ,
translate ( '32BitColour' ) => 4
2008-07-16 16:40:21 +08:00
);
$orientations = array (
2015-05-10 21:10:30 +08:00
translate ( 'Normal' ) => '0' ,
translate ( 'RotateRight' ) => '90' ,
translate ( 'Inverted' ) => '180' ,
translate ( 'RotateLeft' ) => '270' ,
translate ( 'FlippedHori' ) => 'hori' ,
translate ( 'FlippedVert' ) => 'vert'
2008-07-16 16:40:21 +08:00
);
2008-07-14 21:54:50 +08:00
2012-01-25 22:59:56 +08:00
$deinterlaceopts = array (
2012-01-30 14:00:22 +08:00
" Disabled " => 0x00000000 ,
2012-07-15 22:30:37 +08:00
" Four field motion adaptive - Soft " => 0x00001E04 , /* 30 change */
" Four field motion adaptive - Medium " => 0x00001404 , /* 20 change */
" Four field motion adaptive - Hard " => 0x00000A04 , /* 10 change */
2012-01-30 14:00:22 +08:00
" Discard " => 0x00000001 ,
" Linear " => 0x00000002 ,
" Blend " => 0x00000003 ,
" Blend (25%) " => 0x00000205
);
$deinterlaceopts_v4l2 = array (
" Disabled " => 0x00000000 ,
2012-07-15 22:30:37 +08:00
" Four field motion adaptive - Soft " => 0x00001E04 , /* 30 change */
" Four field motion adaptive - Medium " => 0x00001404 , /* 20 change */
" Four field motion adaptive - Hard " => 0x00000A04 , /* 10 change */
2012-01-30 14:00:22 +08:00
" Discard " => 0x00000001 ,
" Linear " => 0x00000002 ,
" Blend " => 0x00000003 ,
" Blend (25%) " => 0x00000205 ,
2012-02-09 18:33:54 +08:00
" V4L2: Capture top field only " => 0x02000000 ,
" V4L2: Capture bottom field only " => 0x03000000 ,
" V4L2: Alternate fields (Bob) " => 0x07000000 ,
2012-01-30 14:00:22 +08:00
" V4L2: Progressive " => 0x01000000 ,
2013-11-03 16:26:04 +08:00
" V4L2: Interlaced " => 0x04000000
);
$fastblendopts = array (
" No blending " => 0 ,
" 1.5625% " => 1 ,
" 3.125% " => 3 ,
" 6.25% (Indoor) " => 6 ,
" 12.5% (Outdoor) " => 12 ,
" 25% " => 25 ,
" 50% " => 50
2012-01-25 22:59:56 +08:00
);
2013-11-04 18:10:53 +08:00
$fastblendopts_alarm = array (
" No blending (Alarm lasts forever) " => 0 ,
" 1.5625% " => 1 ,
" 3.125% " => 3 ,
" 6.25% " => 6 ,
" 12.5% " => 12 ,
" 25% " => 25 ,
" 50% (Alarm lasts a moment) " => 50
2012-01-25 22:59:56 +08:00
);
2015-08-10 19:00:18 +08:00
$label_size = array (
" Default " => 1 ,
" Large " => 2
);
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 d9bbcdf3a94cba4d8955fcd03bd965ed2772f34d.
* 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-16 10:02:48 +08:00
$savejpegopts = array (
" Disabled " => 0 ,
" Frames only " => 1 ,
" Analysis images only (if available) " => 2 ,
" Frames + Analysis images (if available) " => 3 ,
" Snapshot Only " => 4
);
$videowriteropts = array (
" Disabled " => 0 ,
" X264 Encode " => 1 ,
" H264 Camera Passthrough " => 2
);
2015-05-10 21:10:30 +08:00
xhtmlHeaders ( __FILE__ , translate ( 'Monitor' ) . " - " . validHtmlStr ( $monitor [ 'Name' ]) );
2008-07-14 21:54:50 +08:00
?>
< body >
< div id = " page " >
< div id = " header " >
< ? php
if ( canEdit ( 'Monitors' ) )
{
?>
2016-04-15 01:53:10 +08:00
< ? php
if ( isset ( $_REQUEST [ 'dupId' ]))
{
$dupId = $_REQUEST [ 'dupId' ];
?>
< div class = " alert alert-info " >
Configuration cloned from Monitor : < ? php echo $clonedName ?>
</ div >
< ? php
}
?>
2008-07-14 21:54:50 +08:00
< div id = " headerButtons " >
2015-05-10 21:10:30 +08:00
< a href = " # " onclick = " createPopup( '?view=monitorprobe&mid=<?php echo $monitor['Id'] ?>', 'zmMonitorProbe<?php echo $monitor['Id'] ?>', 'monitorprobe' ); return( false ); " >< ? php echo translate ( 'Probe' ) ?> </a>
2016-04-15 01:53:10 +08:00
< ? php
if ( ZM_HAS_ONVIF )
{
?>
< a href = " # " onclick = " createPopup( '?view=onvifprobe&mid=<?php echo $monitor['Id'] ?>', 'zmOnvifProbe<?php echo $monitor['Id'] ?>', 'onvifprobe' ); return( false ); " >< ? php echo translate ( 'OnvifProbe' ) ?> </a>
< ? php
}
?>
2015-05-10 21:10:30 +08:00
< a href = " # " onclick = " createPopup( '?view=monitorpreset&mid=<?php echo $monitor['Id'] ?>', 'zmMonitorPreset<?php echo $monitor['Id'] ?>', 'monitorpreset' ); return( false ); " >< ? php echo translate ( 'Presets' ) ?> </a>
2008-07-14 21:54:50 +08:00
</ div >
< ? php
}
?>
2015-05-10 21:10:30 +08:00
< h2 >< ? php echo translate ( 'Monitor' ) ?> - <?php echo validHtmlStr($monitor['Name']) ?><?php if ( !empty($monitor['Id']) ) { ?> (<?php echo $monitor['Id'] ?>)<?php } ?></h2>
2008-07-14 21:54:50 +08:00
</ div >
< div id = " content " >
< ul class = " tabList " >
< ? php
foreach ( $tabs as $name => $value )
{
2008-09-26 17:47:20 +08:00
if ( $tab == $name )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< li class = " active " >< ? php echo $value ?> </li>
2008-07-14 21:54:50 +08:00
< ? php
}
else
{
?>
2014-12-05 07:44:23 +08:00
< li >< a href = " # " onclick = " submitTab( '<?php echo $name ?>' ); return( false ); " >< ? php echo $value ?> </a></li>
2008-07-14 21:54:50 +08:00
< ? php
}
}
?>
</ ul >
2008-07-18 22:53:44 +08:00
< div class = " clear " ></ div >
2014-12-05 07:44:23 +08:00
< form name = " contentForm " id = " contentForm " method = " post " action = " <?php echo $_SERVER['PHP_SELF'] ?> " onsubmit = " return validateForm( this ) " >
< input type = " hidden " name = " view " value = " <?php echo $view ?> " />
< input type = " hidden " name = " tab " value = " <?php echo $tab ?> " />
2008-07-14 21:54:50 +08:00
< input type = " hidden " name = " action " value = " monitor " />
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " mid " value = " <?php echo $monitor['Id'] ?> " />
< input type = " hidden " name = " newMonitor[LinkedMonitors] " value = " <?php echo isset( $newMonitor['LinkedMonitors'] )? $newMonitor['LinkedMonitors'] :'' ?> " />
< input type = " hidden " name = " origMethod " value = " <?php echo isset( $newMonitor['Method'] )? $newMonitor['Method'] :'' ?> " />
2008-07-14 21:54:50 +08:00
< ? php
2008-09-26 17:47:20 +08:00
if ( $tab != 'general' )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[Name] " value = " <?php echo validHtmlStr( $newMonitor['Name'] ) ?> " />
2015-07-09 23:41:46 +08:00
< input type = " hidden " name = " newMonitor[ServerId] " value = " <?php echo validHtmlStr( $newMonitor['ServerId'] ) ?> " />
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[Type] " value = " <?php echo validHtmlStr( $newMonitor['Type'] ) ?> " />
< input type = " hidden " name = " newMonitor[Function] " value = " <?php echo validHtmlStr( $newMonitor['Function'] ) ?> " />
< input type = " hidden " name = " newMonitor[Enabled] " value = " <?php echo validHtmlStr( $newMonitor['Enabled'] ) ?> " />
< input type = " hidden " name = " newMonitor[RefBlendPerc] " value = " <?php echo validHtmlStr( $newMonitor['RefBlendPerc'] ) ?> " />
< input type = " hidden " name = " newMonitor[AlarmRefBlendPerc] " value = " <?php echo validHtmlStr( $newMonitor['AlarmRefBlendPerc'] ) ?> " />
2015-07-23 03:38:35 +08:00
< input type = " hidden " name = " newMonitor[AnalysisFPS] " value = " <?php echo validHtmlStr( $newMonitor['AnalysisFPS'] ) ?> " />
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[MaxFPS] " value = " <?php echo validHtmlStr( $newMonitor['MaxFPS'] ) ?> " />
< input type = " hidden " name = " newMonitor[AlarmMaxFPS] " value = " <?php echo validHtmlStr( $newMonitor['AlarmMaxFPS'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
if ( isset ( $newMonitor [ 'Triggers' ]) )
{
foreach ( $newMonitor [ 'Triggers' ] as $newTrigger )
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[Triggers][] " value = " <?php echo validHtmlStr( $newTrigger ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
}
}
2011-02-16 05:59:06 +08:00
if ( ZM_HAS_V4L && ( $tab != 'source' || $newMonitor [ 'Type' ] != 'Local' ) )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[Device] " value = " <?php echo validHtmlStr( $newMonitor['Device'] ) ?> " />
< input type = " hidden " name = " newMonitor[Channel] " value = " <?php echo validHtmlStr( $newMonitor['Channel'] ) ?> " />
< input type = " hidden " name = " newMonitor[Format] " value = " <?php echo validHtmlStr( $newMonitor['Format'] ) ?> " />
< input type = " hidden " name = " newMonitor[Palette] " value = " <?php echo validHtmlStr( $newMonitor['Palette'] ) ?> " />
< input type = " hidden " name = " newMonitor[V4LMultiBuffer] " value = " <?php echo validHtmlStr( $newMonitor['V4LMultiBuffer'] ) ?> " />
< input type = " hidden " name = " newMonitor[V4LCapturesPerFrame] " value = " <?php echo validHtmlStr( $newMonitor['V4LCapturesPerFrame'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
2008-09-26 17:47:20 +08:00
if ( $tab != 'source' || $newMonitor [ 'Type' ] != 'Remote' )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[Protocol] " value = " <?php echo validHtmlStr( $newMonitor['Protocol'] ) ?> " />
< input type = " hidden " name = " newMonitor[Host] " value = " <?php echo validHtmlStr( $newMonitor['Host'] ) ?> " />
< input type = " hidden " name = " newMonitor[Port] " value = " <?php echo validHtmlStr( $newMonitor['Port'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
2014-05-18 02:41:22 +08:00
if ( $tab != 'source' || ( $newMonitor [ 'Type' ] != 'Local' && $newMonitor [ 'Type' ] != 'Remote' && $newMonitor [ 'Type' ] != 'Ffmpeg' && $newMonitor [ 'Type' ] != 'Libvlc' ) )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[Method] " value = " <?php echo validHtmlStr( $newMonitor['Method'] ) ?> " />
2008-10-28 22:25:12 +08:00
< ? php
}
2014-05-05 19:29:12 +08:00
if ( $tab != 'source' || ( $newMonitor [ 'Type' ] != 'Ffmpeg' && $newMonitor [ 'Type' ] != 'Libvlc' ))
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[Options] " value = " <?php echo validHtmlStr( $newMonitor['Options'] ) ?> " />
2014-05-05 19:29:12 +08:00
< ? php
}
2013-12-28 00:02:32 +08:00
if ( $tab != 'source' || ( $newMonitor [ 'Type' ] != 'Remote' && $newMonitor [ 'Type' ] != 'File' && $newMonitor [ 'Type' ] != 'Ffmpeg' && $newMonitor [ 'Type' ] != 'Libvlc' && $newMonitor [ 'Type' ] != 'cURL' ) )
2008-10-28 22:25:12 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[Path] " value = " <?php echo validHtmlStr( $newMonitor['Path'] ) ?> " />
< input type = " hidden " name = " newMonitor[User] " value = " <?php echo validHtmlStr( $newMonitor['User'] ) ?> " />
< input type = " hidden " name = " newMonitor[Pass] " value = " <?php echo validHtmlStr( $newMonitor['Pass'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
2008-09-26 17:47:20 +08:00
if ( $tab != 'source' )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[Colours] " value = " <?php echo validHtmlStr( $newMonitor['Colours'] ) ?> " />
< input type = " hidden " name = " newMonitor[Width] " value = " <?php echo validHtmlStr( $newMonitor['Width'] ) ?> " />
< input type = " hidden " name = " newMonitor[Height] " value = " <?php echo validHtmlStr( $newMonitor['Height'] ) ?> " />
< input type = " hidden " name = " newMonitor[Orientation] " value = " <?php echo validHtmlStr( $newMonitor['Orientation'] ) ?> " />
< input type = " hidden " name = " newMonitor[Deinterlacing] " value = " <?php echo validHtmlStr( $newMonitor['Deinterlacing'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
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 d9bbcdf3a94cba4d8955fcd03bd965ed2772f34d.
* 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-16 10:02:48 +08:00
if ( $tab != 'storage' )
{
?>
< input type = " hidden " name = " newMonitor[SaveJPEGs] " value = " <?php echo validHtmlStr( $newMonitor['SaveJPEGs'] ) ?> " />
< input type = " hidden " name = " newMonitor[VideoWriter] " value = " <?php echo validHtmlStr( $newMonitor['VideoWriter'] ) ?> " />
< input type = " hidden " name = " newMonitor[EncoderParameters] " value = " <?php echo validHtmlStr( $newMonitor['EncoderParameters'] ) ?> " />
< input type = " hidden " name = " newMonitor[RecordAudio] " value = " <?php echo validHtmlStr( $newMonitor['RecordAudio'] ) ?> " />
< ? php
}
2015-08-21 23:32:50 +08:00
if ( $tab != 'source' || ( $newMonitor [ 'Type' ] != 'Remote' && $newMonitor [ 'Protocol' ] != 'RTSP' ))
{
?>
< input type = " hidden " name = " newMonitor[RTSPDescribe] " value = " <?php echo validHtmlStr( $newMonitor['RTSPDescribe'] ) ?> " />
< ? php
}
2008-09-26 17:47:20 +08:00
if ( $tab != 'timestamp' )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[LabelFormat] " value = " <?php echo validHtmlStr( $newMonitor['LabelFormat'] ) ?> " />
< input type = " hidden " name = " newMonitor[LabelX] " value = " <?php echo validHtmlStr( $newMonitor['LabelX'] ) ?> " />
< input type = " hidden " name = " newMonitor[LabelY] " value = " <?php echo validHtmlStr( $newMonitor['LabelY'] ) ?> " />
2015-08-10 19:00:18 +08:00
< input type = " hidden " name = " newMonitor[LabelSize] " value = " <?php echo validHtmlStr( $newMonitor['LabelSize'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
2008-09-26 17:47:20 +08:00
if ( $tab != 'buffers' )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[ImageBufferCount] " value = " <?php echo validHtmlStr( $newMonitor['ImageBufferCount'] ) ?> " />
< input type = " hidden " name = " newMonitor[WarmupCount] " value = " <?php echo validHtmlStr( $newMonitor['WarmupCount'] ) ?> " />
< input type = " hidden " name = " newMonitor[PreEventCount] " value = " <?php echo validHtmlStr( $newMonitor['PreEventCount'] ) ?> " />
< input type = " hidden " name = " newMonitor[PostEventCount] " value = " <?php echo validHtmlStr( $newMonitor['PostEventCount'] ) ?> " />
< input type = " hidden " name = " newMonitor[StreamReplayBuffer] " value = " <?php echo validHtmlStr( $newMonitor['StreamReplayBuffer'] ) ?> " />
< input type = " hidden " name = " newMonitor[AlarmFrameCount] " value = " <?php echo validHtmlStr( $newMonitor['AlarmFrameCount'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
2008-09-26 17:47:20 +08:00
if ( ZM_OPT_CONTROL && $tab != 'control' )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[Controllable] " value = " <?php echo validHtmlStr( $newMonitor['Controllable'] ) ?> " />
< input type = " hidden " name = " newMonitor[ControlId] " value = " <?php echo validHtmlStr( $newMonitor['ControlId'] ) ?> " />
< input type = " hidden " name = " newMonitor[ControlDevice] " value = " <?php echo validHtmlStr( $newMonitor['ControlDevice'] ) ?> " />
< input type = " hidden " name = " newMonitor[ControlAddress] " value = " <?php echo validHtmlStr( $newMonitor['ControlAddress'] ) ?> " />
< input type = " hidden " name = " newMonitor[AutoStopTimeout] " value = " <?php echo validHtmlStr( $newMonitor['AutoStopTimeout'] ) ?> " />
< input type = " hidden " name = " newMonitor[TrackMotion] " value = " <?php echo validHtmlStr( $newMonitor['TrackMotion'] ) ?> " />
< input type = " hidden " name = " newMonitor[TrackDelay] " value = " <?php echo validHtmlStr( $newMonitor['TrackDelay'] ) ?> " />
< input type = " hidden " name = " newMonitor[ReturnLocation] " value = " <?php echo validHtmlStr( $newMonitor['ReturnLocation'] ) ?> " />
< input type = " hidden " name = " newMonitor[ReturnDelay] " value = " <?php echo validHtmlStr( $newMonitor['ReturnDelay'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
2008-09-26 17:47:20 +08:00
if ( ZM_OPT_X10 && $tab != 'x10' )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newX10Monitor[Activation] " value = " <?php echo validHtmlStr( $newX10Monitor['Activation'] ) ?> " />
< input type = " hidden " name = " newX10Monitor[AlarmInput] " value = " <?php echo validHtmlStr( $newX10Monitor['AlarmInput'] ) ?> " />
< input type = " hidden " name = " newX10Monitor[AlarmOutput] " value = " <?php echo validHtmlStr( $newX10Monitor['AlarmOutput'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
2008-09-26 17:47:20 +08:00
if ( $tab != 'misc' )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[EventPrefix] " value = " <?php echo validHtmlStr( $newMonitor['EventPrefix'] ) ?> " />
< input type = " hidden " name = " newMonitor[SectionLength] " value = " <?php echo validHtmlStr( $newMonitor['SectionLength'] ) ?> " />
< input type = " hidden " name = " newMonitor[FrameSkip] " value = " <?php echo validHtmlStr( $newMonitor['FrameSkip'] ) ?> " />
< input type = " hidden " name = " newMonitor[MotionFrameSkip] " value = " <?php echo validHtmlStr( $newMonitor['MotionFrameSkip'] ) ?> " />
2015-07-24 04:36:30 +08:00
< input type = " hidden " name = " newMonitor[AnalysisUpdateDelay] " value = " <?php echo validHtmlStr( $newMonitor['AnalysisUpdateDelay'] ) ?> " />
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[FPSReportInterval] " value = " <?php echo validHtmlStr( $newMonitor['FPSReportInterval'] ) ?> " />
< input type = " hidden " name = " newMonitor[DefaultView] " value = " <?php echo validHtmlStr( $newMonitor['DefaultView'] ) ?> " />
< input type = " hidden " name = " newMonitor[DefaultRate] " value = " <?php echo validHtmlStr( $newMonitor['DefaultRate'] ) ?> " />
< input type = " hidden " name = " newMonitor[DefaultScale] " value = " <?php echo validHtmlStr( $newMonitor['DefaultScale'] ) ?> " />
< input type = " hidden " name = " newMonitor[WebColour] " value = " <?php echo validHtmlStr( $newMonitor['WebColour'] ) ?> " />
2015-08-17 06:56:03 +08:00
< input type = " hidden " name = " newMonitor[Exif] " value = " <?php echo validHtmlStr( $newMonitor['Exif'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
2011-02-16 05:59:06 +08:00
if ( ZM_HAS_V4L && ( $tab != 'misc' || $newMonitor [ 'Type' ] != 'Local' ) )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< input type = " hidden " name = " newMonitor[SignalCheckColour] " value = " <?php echo validHtmlStr( $newMonitor['SignalCheckColour'] ) ?> " />
2008-07-14 21:54:50 +08:00
< ? php
}
?>
< table id = " contentTable " class = " major " cellspacing = " 0 " >
< tbody >
< ? php
2008-09-26 17:47:20 +08:00
switch ( $tab )
2008-07-14 21:54:50 +08:00
{
case 'general' :
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'Name' ) ?> </td><td><input type="text" name="newMonitor[Name]" value="<?php echo validHtmlStr($newMonitor['Name']) ?>" size="16"/></td></tr>
2015-07-09 23:41:46 +08:00
< tr >< td >< ? php echo translate ( 'Server' ) ?> </td><td>
< ? php
2016-04-15 01:53:10 +08:00
$servers = array ( '' => 'None' );
$result = dbQuery ( 'SELECT * FROM Servers ORDER BY Name' );
$results = $result -> fetchALL ( PDO :: FETCH_CLASS | PDO :: FETCH_PROPS_LATE , 'Server' );
foreach ( $results as $row => $server_obj ) {
$servers [ $server_obj -> Id ] = $server_obj -> Name ();
}
?>
< ? php echo buildSelect ( " newMonitor[ServerId] " , $servers ); ?>
2015-07-09 23:41:46 +08:00
</ td ></ tr >
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'SourceType' ) ?> </td><td><?php echo buildSelect( "newMonitor[Type]", $sourceTypes ); ?></td></tr>
< tr >< td >< ? php echo translate ( 'Function' ) ?> </td><td><select name="newMonitor[Function]">
2008-07-14 21:54:50 +08:00
< ? php
2008-07-16 16:40:21 +08:00
foreach ( getEnumValues ( 'Monitors' , 'Function' ) as $optFunction )
2008-07-14 21:54:50 +08:00
{
?>
2016-09-09 18:32:54 +08:00
< option value = " <?php echo $optFunction ?> " < ? php if ( $optFunction == $newMonitor [ 'Function' ] ) { ?> selected="selected"<?php } ?>><?php echo translate('Fn'.$optFunction) ?></option>
2008-07-14 21:54:50 +08:00
< ? php
}
?>
</ select ></ td ></ tr >
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'Enabled' ) ?> </td><td><input type="checkbox" name="newMonitor[Enabled]" value="1"<?php if ( !empty($newMonitor['Enabled']) ) { ?> checked="checked"<?php } ?>/></td></tr>
2008-07-14 21:54:50 +08:00
< tr >
2015-05-10 21:10:30 +08:00
< td >< ? php echo translate ( 'LinkedMonitors' ) ?> </td>
2008-07-14 21:54:50 +08:00
< td >
2008-09-02 00:43:34 +08:00
< select name = " monitorIds " size = " 4 " multiple = " multiple " onchange = " updateLinkedMonitors( this ) " >
2008-07-14 21:54:50 +08:00
< ? php
$monitors = dbFetchAll ( " select Id,Name from Monitors order by Sequence asc " );
2008-07-16 16:40:21 +08:00
if ( ! empty ( $newMonitor [ 'LinkedMonitors' ]) )
2010-02-16 01:11:17 +08:00
$monitorIds = array_flip ( explode ( ',' , $newMonitor [ 'LinkedMonitors' ] ) );
2008-07-16 16:40:21 +08:00
else
$monitorIds = array ();
2008-07-14 21:54:50 +08:00
foreach ( $monitors as $monitor )
{
2008-09-02 00:43:34 +08:00
if ( ( empty ( $newMonitor [ 'Id' ]) || ( $monitor [ 'Id' ] != $newMonitor [ 'Id' ])) && visibleMonitor ( $monitor [ 'Id' ] ) )
2008-07-14 21:54:50 +08:00
{
?>
2014-12-05 07:44:23 +08:00
< option value = " <?php echo $monitor['Id'] ?> " < ? php if ( array_key_exists ( $monitor [ 'Id' ], $monitorIds ) ) { ?> selected="selected"<?php } ?>><?php echo validHtmlStr($monitor['Name']) ?></option>
2008-07-14 21:54:50 +08:00
< ? php
}
}
?>
</ select >
</ td >
</ tr >
2015-07-23 03:38:35 +08:00
< tr >< td >< ? php echo translate ( 'AnalysisFPS' ) ?> </td><td><input type="text" name="newMonitor[AnalysisFPS]" value="<?php echo validHtmlStr($newMonitor['AnalysisFPS']) ?>" size="6"/></td></tr>
2013-11-03 16:26:04 +08:00
< ? php
2015-08-23 01:36:49 +08:00
if ( $newMonitor [ 'Type' ] != " Local " && $newMonitor [ 'Type' ] != " File " )
{
?>
< tr >< td >< ? php echo translate ( 'MaximumFPS' ) ?> (<?php echo makePopupLink('?view=optionhelp&option=OPTIONS_MAXFPS', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" onclick="document.getElementById('newMonitor[MaxFPS]').innerHTML= ' CAUTION: See the help text'" name="newMonitor[MaxFPS]" value="<?php echo validHtmlStr($newMonitor['MaxFPS']) ?>" size="5"/><span id="newMonitor[MaxFPS]" style="color:red"></span></td></tr>
< tr >< td >< ? php echo translate ( 'AlarmMaximumFPS' ) ?> (<?php echo makePopupLink('?view=optionhelp&option=OPTIONS_MAXFPS', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" onclick="document.getElementById('newMonitor[AlarmMaxFPS]').innerHTML= ' CAUTION: See the help text'" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="5"/><span id="newMonitor[AlarmMaxFPS]" style="color:red"></span></td></tr>
< ? php
} else {
?>
< tr >< td >< ? php echo translate ( 'MaximumFPS' ) ?> </td><td><input type="text" name="newMonitor[MaxFPS]" value="<?php echo validHtmlStr($newMonitor['MaxFPS']) ?>" size="5"/></td></tr>
< tr >< td >< ? php echo translate ( 'AlarmMaximumFPS' ) ?> </td><td><input type="text" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="5"/></td></tr>
< ? php
}
2016-04-15 01:53:10 +08:00
if ( ZM_FAST_IMAGE_BLENDS )
2013-11-03 16:26:04 +08:00
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'RefImageBlendPct' ) ?> </td><td><select name="newMonitor[RefBlendPerc]"><?php foreach ( $fastblendopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['RefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
2017-02-18 01:37:58 +08:00
< tr >< td >< ? php echo translate ( 'AlarmRefImageBlendPct' ) ?> </td><td><select name="newMonitor[AlarmRefBlendPerc]"><?php foreach ( $fastblendopts_alarm as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['AlarmRefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
2013-11-03 16:26:04 +08:00
< ? php
2016-04-15 01:53:10 +08:00
} else {
2013-11-03 16:26:04 +08:00
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'RefImageBlendPct' ) ?> </td><td><input type="text" name="newMonitor[RefBlendPerc]" value="<?php echo validHtmlStr($newMonitor['RefBlendPerc']) ?>" size="4"/></td></tr>
< tr >< td >< ? php echo translate ( 'AlarmRefImageBlendPct' ) ?> </td><td><input type="text" name="newMonitor[AlarmRefBlendPerc]" value="<?php echo validHtmlStr($newMonitor['AlarmRefBlendPerc']) ?>" size="4"/></td></tr>
2013-11-03 16:26:04 +08:00
< ? php
}
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'Triggers' ) ?> </td><td>
2008-07-14 21:54:50 +08:00
< ? php
2008-07-16 16:40:21 +08:00
$optTriggers = getSetValues ( 'Monitors' , 'Triggers' );
$breakCount = ( int )( ceil ( count ( $optTriggers )));
$breakCount = min ( 3 , $breakCount );
$optCount = 0 ;
foreach ( $optTriggers as $optTrigger )
2008-07-14 21:54:50 +08:00
{
2008-07-16 16:40:21 +08:00
if ( ! ZM_OPT_X10 && $optTrigger == 'X10' )
2008-07-14 21:54:50 +08:00
continue ;
2008-07-16 16:40:21 +08:00
if ( $optCount && ( $optCount % $breakCount == 0 ) )
2008-07-14 21:54:50 +08:00
echo " </br> " ;
?>
2014-12-05 07:44:23 +08:00
< input type = " checkbox " name = " newMonitor[Triggers][] " value = " <?php echo $optTrigger ?> " < ? php if ( isset ( $newMonitor [ 'Triggers' ]) && in_array ( $optTrigger , $newMonitor [ 'Triggers' ] ) ) { ?> checked="checked"<?php } ?>/> <?php echo $optTrigger ?>
2008-07-14 21:54:50 +08:00
< ? php
2008-07-16 16:40:21 +08:00
$optCount ++ ;
2008-07-14 21:54:50 +08:00
}
2008-07-16 16:40:21 +08:00
if ( ! $optCount )
2008-07-14 21:54:50 +08:00
{
?>
2015-05-10 21:10:30 +08:00
< em >< ? php echo translate ( 'NoneAvailable' ) ?> </em>
2008-07-14 21:54:50 +08:00
< ? php
}
?>
2008-07-16 16:40:21 +08:00
</ td ></ tr >
2008-07-14 21:54:50 +08:00
< ? php
break ;
}
case 'source' :
{
2011-02-16 05:59:06 +08:00
if ( ZM_HAS_V4L && $newMonitor [ 'Type' ] == " Local " )
2008-07-14 21:54:50 +08:00
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'DevicePath' ) ?> </td><td><input type="text" name="newMonitor[Device]" value="<?php echo validHtmlStr($newMonitor['Device']) ?>" size="24"/></td></tr>
< tr >< td >< ? php echo translate ( 'CaptureMethod' ) ?> </td><td><?php echo buildSelect( "newMonitor[Method]", $localMethods, "submitTab( '$tab' )" ); ?></td></tr>
2009-01-27 19:07:24 +08:00
< ? php
2011-03-02 20:04:52 +08:00
if ( ZM_HAS_V4L1 && $newMonitor [ 'Method' ] == 'v4l1' )
2009-01-27 19:07:24 +08:00
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'DeviceChannel' ) ?> </td><td><select name="newMonitor[Channel]"><?php foreach ( $v4l1DeviceChannels as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Channel'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
< tr >< td >< ? php echo translate ( 'DeviceFormat' ) ?> </td><td><select name="newMonitor[Format]"><?php foreach ( $v4l1DeviceFormats as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Format'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
< tr >< td >< ? php echo translate ( 'CapturePalette' ) ?> </td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l1LocalPalettes as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
2009-01-27 19:07:24 +08:00
< ? php
}
2011-05-10 18:50:54 +08:00
else
2009-01-27 19:07:24 +08:00
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'DeviceChannel' ) ?> </td><td><select name="newMonitor[Channel]"><?php foreach ( $v4l2DeviceChannels as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Channel'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
< tr >< td >< ? php echo translate ( 'DeviceFormat' ) ?> </td><td><select name="newMonitor[Format]"><?php foreach ( $v4l2DeviceFormats as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Format'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
< tr >< td >< ? php echo translate ( 'CapturePalette' ) ?> </td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l2LocalPalettes as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
2009-01-27 19:07:24 +08:00
}
2014-07-14 04:39:27 +08:00
?>
2016-04-15 01:53:10 +08:00
< tr >< td >< ? php echo translate ( 'V4LMultiBuffer' ) ?> </td><td>
< input type = " radio " name = " newMonitor[V4LMultiBuffer] " id = " newMonitor[V4LMultiBuffer]1 " value = " 1 " < ? php echo ( $newMonitor [ 'V4LMultiBuffer' ] == 1 ? 'checked="checked"' : '' ) ?> />
< label for = " newMonitor[V4LMultiBuffer]1 " > Yes </ label >
< input type = " radio " name = " newMonitor[V4LMultiBuffer] " id = " newMonitor[V4LMultiBuffer]0 " value = " 0 " < ? php echo ( $newMonitor [ 'V4LMultiBuffer' ] == 0 ? 'checked="checked"' : '' ) ?> />
< label for = " newMonitor[V4LMultiBuffer]0 " > No </ label >
< input type = " radio " name = " newMonitor[V4LMultiBuffer] " id = " newMonitor[V4LMultiBuffer] " value = " " < ? php echo ( empty ( $newMonitor [ 'V4LMultiBuffer' ]) ? 'checked="checked"' : '' ) ?> />
< label for = " newMonitor[V4LMultiBuffer] " > Use Config Value </ label >
</ td ></ tr >
< tr >< td >< ? php echo translate ( 'V4LCapturesPerFrame' ) ?> </td><td><input type="number" name="newMonitor[V4LCapturesPerFrame]" value="<?php echo $newMonitor['V4LCapturesPerFrame'] ?>"/></td></tr>
2014-07-14 04:39:27 +08:00
< ? php
2008-07-14 21:54:50 +08:00
}
elseif ( $newMonitor [ 'Type' ] == " Remote " )
{
?>
2016-05-25 21:08:28 +08:00
< tr >< td >< ? php echo translate ( 'RemoteProtocol' ) ?> </td><td><?php echo buildSelect( "newMonitor[Protocol]", $remoteProtocols, "updateMethods( this );if(this.value=='rtsp'){\$('RTSPDescribe').setStyle('display','table-row');}else{\$('RTSPDescribe').hide();}" ); ?></td></tr>
2008-09-01 22:59:02 +08:00
< ? php
if ( empty ( $newMonitor [ 'Protocol' ]) || $newMonitor [ 'Protocol' ] == " http " )
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'RemoteMethod' ) ?> </td><td><?php echo buildSelect( "newMonitor[Method]", $httpMethods ); ?></td></tr>
2008-09-01 22:59:02 +08:00
< ? php
}
else
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'RemoteMethod' ) ?> </td><td><?php echo buildSelect( "newMonitor[Method]", $rtspMethods ); ?></td></tr>
2008-09-01 22:59:02 +08:00
< ? php
}
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'RemoteHostName' ) ?> </td><td><input type="text" name="newMonitor[Host]" value="<?php echo validHtmlStr($newMonitor['Host']) ?>" size="36"/></td></tr>
< tr >< td >< ? php echo translate ( 'RemoteHostPort' ) ?> </td><td><input type="text" name="newMonitor[Port]" value="<?php echo validHtmlStr($newMonitor['Port']) ?>" size="6"/></td></tr>
< tr >< td >< ? php echo translate ( 'RemoteHostPath' ) ?> </td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
}
2014-05-05 19:29:12 +08:00
elseif ( $newMonitor [ 'Type' ] == " File " )
2008-07-14 21:54:50 +08:00
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'SourcePath' ) ?> </td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
2013-11-04 22:52:21 +08:00
< ? php
}
elseif ( $newMonitor [ 'Type' ] == " cURL " )
{
?>
2014-12-05 07:44:23 +08:00
< tr >< td >< ? php echo " URL " ?> </td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
< tr >< td >< ? php echo " Username " ?> </td><td><input type="text" name="newMonitor[User]" value="<?php echo validHtmlStr($newMonitor['User']) ?>" size="12"/></td></tr>
< tr >< td >< ? php echo " Password " ?> </td><td><input type="text" name="newMonitor[Pass]" value="<?php echo validHtmlStr($newMonitor['Pass']) ?>" size="12"/></td></tr>
2014-05-05 19:29:12 +08:00
< ? php
}
elseif ( $newMonitor [ 'Type' ] == " Ffmpeg " || $newMonitor [ 'Type' ] == " Libvlc " )
{
?>
2016-04-15 01:53:10 +08:00
< tr >< td >< ? php echo translate ( 'SourcePath' ) ?> </td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
2017-02-05 15:43:47 +08:00
< tr >< td >< ? php echo translate ( 'RemoteMethod' ) ?> (<?php echo makePopupLink('?view=optionhelp&option=OPTIONS_RTSPTrans', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><?php echo buildSelect( "newMonitor[Method]", $rtspFFMpegMethods ); ?></td></tr>
2016-04-15 01:53:10 +08:00
< tr >< td >< ? php echo translate ( 'Options' ) ?> (<?php echo makePopupLink( '?view=optionhelp&option=OPTIONS_'.strtoupper($newMonitor['Type']), 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" name="newMonitor[Options]" value="<?php echo validHtmlStr($newMonitor['Options']) ?>" size="36"/></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
}
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'TargetColorspace' ) ?> </td><td><select name="newMonitor[Colours]"><?php foreach ( $Colours as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Colours'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
< tr >< td >< ? php echo translate ( 'CaptureWidth' ) ?> (<?php echo translate('Pixels') ?>)</td><td><input type="text" name="newMonitor[Width]" value="<?php echo validHtmlStr($newMonitor['Width']) ?>" size="4" onkeyup="updateMonitorDimensions(this);"/></td></tr>
< tr >< td >< ? php echo translate ( 'CaptureHeight' ) ?> (<?php echo translate('Pixels') ?>)</td><td><input type="text" name="newMonitor[Height]" value="<?php echo validHtmlStr($newMonitor['Height']) ?>" size="4" onkeyup="updateMonitorDimensions(this);"/></td></tr>
< tr >< td >< ? php echo translate ( 'PreserveAspect' ) ?> </td><td><input type="checkbox" name="preserveAspectRatio" value="1"/></td></tr>
< tr >< td >< ? php echo translate ( 'Orientation' ) ?> </td><td><select name="newMonitor[Orientation]"><?php foreach ( $orientations as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Orientation'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
2012-01-30 14:00:22 +08:00
< ? php
if ( $newMonitor [ 'Type' ] == " Local " )
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'Deinterlacing' ) ?> </td><td><select name="newMonitor[Deinterlacing]"><?php foreach ( $deinterlaceopts_v4l2 as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Deinterlacing'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
2012-01-30 14:00:22 +08:00
< ? php
} else {
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'Deinterlacing' ) ?> </td><td><select name="newMonitor[Deinterlacing]"><?php foreach ( $deinterlaceopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Deinterlacing'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
2012-01-30 14:00:22 +08:00
< ? php
}
?>
2015-08-21 23:32:50 +08:00
< ? php
if ( $newMonitor [ 'Type' ] == " Remote " )
{
?>
2016-05-25 00:19:31 +08:00
< tr id = " RTSPDescribe " < ? php if ( $newMonitor [ 'Protocol' ] != 'rtsp' ) { echo ' style="display:none;"' ; } ?> ><td><?php echo translate('RTSPDescribe') ?> (<?php echo makePopupLink( '?view=optionhelp&option=OPTIONS_RTSPDESCRIBE', 'zmOptionHelp', 'optionhelp', '?' ) ?>) </td><td><input type="checkbox" name="newMonitor[RTSPDescribe]" value="1"<?php if ( !empty($newMonitor['RTSPDescribe']) ) { ?> checked="checked"<?php } ?>/></td></tr>
2015-08-21 23:32:50 +08:00
< ? php
}
?>
2008-07-14 21:54:50 +08:00
< ? php
break ;
}
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 d9bbcdf3a94cba4d8955fcd03bd965ed2772f34d.
* 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-16 10:02:48 +08:00
case 'storage' :
?>
< tr >< td >< ? php echo translate ( 'SaveJPEGs' ) ?> </td><td><select name="newMonitor[SaveJPEGs]"><?php foreach ( $savejpegopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['SaveJPEGs'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
< tr >< td >< ? php echo translate ( 'VideoWriter' ) ?> </td><td><select name="newMonitor[VideoWriter]"><?php foreach ( $videowriteropts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['VideoWriter'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
< tr >< td >< ? php echo translate ( 'OptionalEncoderParam' ) ?> </td><td><textarea name="newMonitor[EncoderParameters]" rows="4" cols="36"><?php echo validHtmlStr($newMonitor['EncoderParameters']) ?></textarea></td></tr>
< tr >< td >< ? php echo translate ( 'RecordAudio' ) ?> </td><td><input type="checkbox" name="newMonitor[RecordAudio]" value="1"<?php if ( !empty($newMonitor['RecordAudio']) ) { ?> checked="checked"<?php } ?>/></td></tr>
< ? php
break ;
2008-07-14 21:54:50 +08:00
case 'timestamp' :
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'TimestampLabelFormat' ) ?> </td><td><input type="text" name="newMonitor[LabelFormat]" value="<?php echo validHtmlStr($newMonitor['LabelFormat']) ?>" size="32"/></td></tr>
< tr >< td >< ? php echo translate ( 'TimestampLabelX' ) ?> </td><td><input type="text" name="newMonitor[LabelX]" value="<?php echo validHtmlStr($newMonitor['LabelX']) ?>" size="4"/></td></tr>
< tr >< td >< ? php echo translate ( 'TimestampLabelY' ) ?> </td><td><input type="text" name="newMonitor[LabelY]" value="<?php echo validHtmlStr($newMonitor['LabelY']) ?>" size="4"/></td></tr>
2015-08-10 19:00:18 +08:00
< tr >< td >< ? php echo translate ( 'TimestampLabelSize' ) ?> </td><td><select name="newMonitor[LabelSize]"><?php foreach ( $label_size as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['LabelSize'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
break ;
}
case 'buffers' :
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'ImageBufferSize' ) ?> </td><td><input type="text" name="newMonitor[ImageBufferCount]" value="<?php echo validHtmlStr($newMonitor['ImageBufferCount']) ?>" size="6"/></td></tr>
< tr >< td >< ? php echo translate ( 'WarmupFrames' ) ?> </td><td><input type="text" name="newMonitor[WarmupCount]" value="<?php echo validHtmlStr($newMonitor['WarmupCount']) ?>" size="4"/></td></tr>
< tr >< td >< ? php echo translate ( 'PreEventImageBuffer' ) ?> </td><td><input type="text" name="newMonitor[PreEventCount]" value="<?php echo validHtmlStr($newMonitor['PreEventCount']) ?>" size="4"/></td></tr>
< tr >< td >< ? php echo translate ( 'PostEventImageBuffer' ) ?> </td><td><input type="text" name="newMonitor[PostEventCount]" value="<?php echo validHtmlStr($newMonitor['PostEventCount']) ?>" size="4"/></td></tr>
< tr >< td >< ? php echo translate ( 'StreamReplayBuffer' ) ?> </td><td><input type="text" name="newMonitor[StreamReplayBuffer]" value="<?php echo validHtmlStr($newMonitor['StreamReplayBuffer']) ?>" size="6"/></td></tr>
< tr >< td >< ? php echo translate ( 'AlarmFrameCount' ) ?> </td><td><input type="text" name="newMonitor[AlarmFrameCount]" value="<?php echo validHtmlStr($newMonitor['AlarmFrameCount']) ?>" size="4"/></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
break ;
}
case 'control' :
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'Controllable' ) ?> </td><td><input type="checkbox" name="newMonitor[Controllable]" value="1"<?php if ( !empty($newMonitor['Controllable']) ) { ?> checked="checked"<?php } ?>/></td></tr>
< tr >< td >< ? php echo translate ( 'ControlType' ) ?> </td><td><?php echo buildSelect( "newMonitor[ControlId]", $controlTypes, 'loadLocations( this )' ); ?><?php if ( canEdit( 'Control' ) ) { ?> <a href="#" onclick="createPopup( '?view=controlcaps', 'zmControlCaps', 'controlcaps' );"><?php echo translate('Edit') ?></a><?php } ?></td></tr>
< tr >< td >< ? php echo translate ( 'ControlDevice' ) ?> </td><td><input type="text" name="newMonitor[ControlDevice]" value="<?php echo validHtmlStr($newMonitor['ControlDevice']) ?>" size="32"/></td></tr>
< tr >< td >< ? php echo translate ( 'ControlAddress' ) ?> </td><td><input type="text" name="newMonitor[ControlAddress]" value="<?php echo validHtmlStr($newMonitor['ControlAddress']) ?>" size="32"/></td></tr>
< tr >< td >< ? php echo translate ( 'AutoStopTimeout' ) ?> </td><td><input type="text" name="newMonitor[AutoStopTimeout]" value="<?php echo validHtmlStr($newMonitor['AutoStopTimeout']) ?>" size="4"/></td></tr>
< tr >< td >< ? php echo translate ( 'TrackMotion' ) ?> </td><td><input type="checkbox" name="newMonitor[TrackMotion]" value="1"<?php if ( !empty($newMonitor['TrackMotion']) ) { ?> checked="checked"<?php } ?>/></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
$return_options = array (
2015-05-10 21:10:30 +08:00
'-1' => translate ( 'None' ),
'0' => translate ( 'Home' ),
'1' => translate ( 'Preset' ) . " 1 " ,
2008-07-14 21:54:50 +08:00
);
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'TrackDelay' ) ?> </td><td><input type="text" name="newMonitor[TrackDelay]" value="<?php echo validHtmlStr($newMonitor['TrackDelay']) ?>" size="4"/></td></tr>
< tr >< td >< ? php echo translate ( 'ReturnLocation' ) ?> </td><td><?php echo buildSelect( "newMonitor[ReturnLocation]", $return_options ); ?></td></tr>
< tr >< td >< ? php echo translate ( 'ReturnDelay' ) ?> </td><td><input type="text" name="newMonitor[ReturnDelay]" value="<?php echo validHtmlStr($newMonitor['ReturnDelay']) ?>" size="4"/></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
break ;
}
case 'x10' :
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'X10ActivationString' ) ?> </td><td><input type="text" name="newX10Monitor[Activation]" value="<?php echo validHtmlStr($newX10Monitor['Activation']) ?>" size="20"/></td></tr>
< tr >< td >< ? php echo translate ( 'X10InputAlarmString' ) ?> </td><td><input type="text" name="newX10Monitor[AlarmInput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmInput']) ?>" size="20"/></td></tr>
< tr >< td >< ? php echo translate ( 'X10OutputAlarmString' ) ?> </td><td><input type="text" name="newX10Monitor[AlarmOutput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmOutput']) ?>" size="20"/></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
break ;
}
case 'misc' :
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'EventPrefix' ) ?> </td><td><input type="text" name="newMonitor[EventPrefix]" value="<?php echo validHtmlStr($newMonitor['EventPrefix']) ?>" size="24"/></td></tr>
< tr >< td >< ? php echo translate ( 'Sectionlength' ) ?> </td><td><input type="text" name="newMonitor[SectionLength]" value="<?php echo validHtmlStr($newMonitor['SectionLength']) ?>" size="6"/></td></tr>
< tr >< td >< ? php echo translate ( 'FrameSkip' ) ?> </td><td><input type="text" name="newMonitor[FrameSkip]" value="<?php echo validHtmlStr($newMonitor['FrameSkip']) ?>" size="6"/></td></tr>
< tr >< td >< ? php echo translate ( 'MotionFrameSkip' ) ?> </td><td><input type="text" name="newMonitor[MotionFrameSkip]" value="<?php echo validHtmlStr($newMonitor['MotionFrameSkip']) ?>" size="6"/></td></tr>
2015-07-24 04:36:30 +08:00
< tr >< td >< ? php echo translate ( 'AnalysisUpdateDelay' ) ?> </td><td><input type="text" name="newMonitor[AnalysisUpdateDelay]" value="<?php echo validHtmlStr($newMonitor['AnalysisUpdateDelay']) ?>" size="6"/></td></tr>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'FPSReportInterval' ) ?> </td><td><input type="text" name="newMonitor[FPSReportInterval]" value="<?php echo validHtmlStr($newMonitor['FPSReportInterval']) ?>" size="6"/></td></tr>
< tr >< td >< ? php echo translate ( 'DefaultView' ) ?> </td><td><select name="newMonitor[DefaultView]">
2008-07-14 21:54:50 +08:00
< ? php
foreach ( getEnumValues ( 'Monitors' , 'DefaultView' ) as $opt_view )
{
if ( $opt_view == 'Control' && ( ! ZM_OPT_CONTROL || ! $monitor [ 'Controllable' ] ) )
continue ;
?>
2014-12-05 07:44:23 +08:00
< option value = " <?php echo $opt_view ?> " < ? php if ( $opt_view == $newMonitor [ 'DefaultView' ] ) { ?> selected="selected"<?php } ?>><?php echo $opt_view ?></option>
2008-07-14 21:54:50 +08:00
< ? php
}
?>
</ select ></ td ></ tr >
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'DefaultRate' ) ?> </td><td><?php echo buildSelect( "newMonitor[DefaultRate]", $rates ); ?></td></tr>
< tr >< td >< ? php echo translate ( 'DefaultScale' ) ?> </td><td><?php echo buildSelect( "newMonitor[DefaultScale]", $scales ); ?></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
2011-02-16 05:59:06 +08:00
if ( ZM_HAS_V4L && $newMonitor [ 'Type' ] == " Local " )
2008-07-14 21:54:50 +08:00
{
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'SignalCheckColour' ) ?> </td><td><input type="text" name="newMonitor[SignalCheckColour]" value="<?php echo validHtmlStr($newMonitor['SignalCheckColour']) ?>" size="10" onchange="$('SignalCheckSwatch').setStyle( 'backgroundColor', this.value )"/><span id="SignalCheckSwatch" class="swatch" style="background-color: <?php echo $newMonitor['SignalCheckColour'] ?>;"> </span></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
}
?>
2015-05-10 21:10:30 +08:00
< tr >< td >< ? php echo translate ( 'WebColour' ) ?> </td><td><input type="text" name="newMonitor[WebColour]" value="<?php echo validHtmlStr($newMonitor['WebColour']) ?>" size="10" onchange="$('WebSwatch').setStyle( 'backgroundColor', this.value )"/><span id="WebSwatch" class="swatch" style="background-color: <?php echo validHtmlStr($newMonitor['WebColour']) ?>;"> </span></td></tr>
2015-08-17 06:56:03 +08:00
< tr >< td >< ? php echo translate ( 'Exif' ) ?> (<?php echo makePopupLink( '?view=optionhelp&option=OPTIONS_EXIF', 'zmOptionHelp', 'optionhelp', '?' ) ?>) </td><td><input type="checkbox" name="newMonitor[Exif]" value="1"<?php if ( !empty($newMonitor['Exif']) ) { ?> checked="checked"<?php } ?>/></td></tr>
2008-07-14 21:54:50 +08:00
< ? php
break ;
}
}
?>
</ tbody >
</ table >
< div id = " contentButtons " >
2015-05-10 21:10:30 +08:00
< input type = " submit " value = " <?php echo translate('Save') ?> " < ? php if ( ! canEdit ( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/><input type="button" value="<?php echo translate('Cancel') ?>" onclick="closeWindow()"/>
2008-07-14 21:54:50 +08:00
</ div >
2016-04-15 01:53:10 +08:00
2008-07-14 21:54:50 +08:00
</ form >
</ div >
2016-04-15 01:53:10 +08:00
</ div >
2008-07-14 21:54:50 +08:00
</ body >
</ html >