diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index b90820362..7c0225e9f 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -286,8 +286,8 @@ Monitor::Monitor( storage_id( p_storage_id ), function( (Function)p_function ), enabled( p_enabled ), - width( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Height():p_camera->Width() ), - height( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Width():p_camera->Height() ), + width( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Height():p_camera->Width() ), + height( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Width():p_camera->Height() ), orientation( (Orientation)p_orientation ), deinterlacing( p_deinterlacing ), savejpegspref( p_savejpegs ), @@ -2182,9 +2182,6 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose col++; bool embed_exif = (*dbrow[col] != '0'); col++; - int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); - int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); - int extras = (deinterlacing>>24)&0xff; Camera *camera = new LocalCamera( @@ -2195,8 +2192,8 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose v4l_multi_buffer, v4l_captures_per_frame, method, - cam_width, - cam_height, + width, + height, colours, palette, brightness, @@ -2349,9 +2346,6 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c int track_motion = atoi(dbrow[col]); col++; bool embed_exif = (*dbrow[col] != '0'); col++; - int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); - int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); - Camera *camera = 0; if ( protocol == "http" ) { camera = new RemoteCameraHttp( @@ -2360,8 +2354,8 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c host, // Host port, // Port path, // Path - cam_width, - cam_height, + width, + height, colours, brightness, contrast, @@ -2379,8 +2373,8 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c host, // Host port, // Port path, // Path - cam_width, - cam_height, + width, + height, rtsp_describe, colours, brightness, @@ -2531,14 +2525,11 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu int track_motion = atoi(dbrow[col]); col++; bool embed_exif = (*dbrow[col] != '0'); col++; - int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); - int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); - Camera *camera = new FileCamera( id, path, // File - cam_width, - cam_height, + width, + height, colours, brightness, contrast, @@ -2688,16 +2679,13 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose int track_motion = atoi(dbrow[col]); col++; bool embed_exif = (*dbrow[col] != '0'); col++; - int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); - int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); - Camera *camera = new FfmpegCamera( id, path, // File method, options, - cam_width, - cam_height, + width, + height, colours, brightness, contrast, @@ -2869,9 +2857,6 @@ Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) { col++; bool embed_exif = (*dbrow[col] != '0'); col++; - int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); - int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); - int extras = (deinterlacing>>24)&0xff; Camera *camera = 0; @@ -2885,8 +2870,8 @@ Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) { v4l_multi_buffer, v4l_captures_per_frame, method, - cam_width, - cam_height, + width, + height, colours, palette, brightness, @@ -2908,8 +2893,8 @@ Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) { host.c_str(), port.c_str(), path.c_str(), - cam_width, - cam_height, + width, + height, colours, brightness, contrast, @@ -2926,8 +2911,8 @@ Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) { host.c_str(), port.c_str(), path.c_str(), - cam_width, - cam_height, + width, + height, rtsp_describe, colours, brightness, @@ -2947,8 +2932,8 @@ Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) { camera = new FileCamera( id, path.c_str(), - cam_width, - cam_height, + width, + height, colours, brightness, contrast, @@ -2964,8 +2949,8 @@ Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) { path.c_str(), method, options, - cam_width, - cam_height, + width, + height, colours, brightness, contrast, @@ -2984,8 +2969,8 @@ Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) { path.c_str(), method, options, - cam_width, - cam_height, + width, + height, colours, brightness, contrast, @@ -3004,8 +2989,8 @@ Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) { path.c_str(), user.c_str(), pass.c_str(), - cam_width, - cam_height, + width, + height, colours, brightness, contrast, diff --git a/src/zm_monitor.h b/src/zm_monitor.h index e00490d7f..8cd237abf 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -417,8 +417,8 @@ public: return( embed_exif ); } - unsigned int Width() const { return( width ); } - unsigned int Height() const { return( height ); } + unsigned int Width() const { return ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); } + unsigned int Height() const { return ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); } unsigned int Colours() const { return( camera->Colours() ); } unsigned int SubpixelOrder() const { return( camera->SubpixelOrder() ); } diff --git a/src/zm_remote_camera_rtsp.cpp b/src/zm_remote_camera_rtsp.cpp index 2f3f50214..5256b1de2 100644 --- a/src/zm_remote_camera_rtsp.cpp +++ b/src/zm_remote_camera_rtsp.cpp @@ -304,24 +304,6 @@ int RemoteCameraRtsp::Capture( Image &image ) { if ( !buffer.size() ) return( -1 ); -int avResult = av_read_frame( mFormatContext, &packet ); - if ( avResult < 0 ) { - char errbuf[AV_ERROR_MAX_STRING_SIZE]; - av_strerror(avResult, errbuf, AV_ERROR_MAX_STRING_SIZE); - if ( - // Check if EOF. - (avResult == AVERROR_EOF || (mFormatContext->pb && mFormatContext->pb->eof_reached)) || - // Check for Connection failure. - (avResult == -110) - ) { - Info( "av_read_frame returned \"%s\". Reopening stream.", errbuf); - //ReopenFfmpeg(); - } - - Error( "Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, avResult, errbuf ); - return( -1 ); - } - if(mCodecContext->codec_id == AV_CODEC_ID_H264) { // SPS and PPS frames should be saved and appended to IDR frames int nalType = (buffer.head()[3] & 0x1f); @@ -344,6 +326,8 @@ int avResult = av_read_frame( mFormatContext, &packet ); buffer += lastSps; buffer += lastPps; } + } else { + Debug(3, "Not an h264 packet"); } av_init_packet( &packet ); diff --git a/web/skins/classic/js/classic.js b/web/skins/classic/js/classic.js index 6ce2e21bb..729d4121c 100644 --- a/web/skins/classic/js/classic.js +++ b/web/skins/classic/js/classic.js @@ -48,7 +48,7 @@ var popupSizes = { 'log': { 'width': 1080, 'height': 720 }, 'login': { 'width': 720, 'height': 480 }, 'logout': { 'width': 260, 'height': 100 }, - 'monitor': { 'width': 450, 'height': 440 }, + 'monitor': { 'width': 700, 'height': 640 }, 'monitorpreset':{ 'width': 440, 'height': 200 }, 'monitorprobe': { 'width': 500, 'height': 240 }, 'monitorselect':{ 'width': 160, 'height': 200 }, diff --git a/web/skins/classic/js/flat.js b/web/skins/classic/js/flat.js index 143bbfce6..d9cf43dc5 100644 --- a/web/skins/classic/js/flat.js +++ b/web/skins/classic/js/flat.js @@ -48,7 +48,7 @@ var popupSizes = { 'log': { 'width': 1080, 'height': 720 }, 'login': { 'width': 720, 'height': 480 }, 'logout': { 'width': 260, 'height': 150 }, - 'monitor': { 'width': 600, 'height': 780 }, + 'monitor': { 'width': 800, 'height': 780 }, 'monitorpreset':{ 'width': 440, 'height': 200 }, 'monitorprobe': { 'width': 500, 'height': 240 }, 'monitorselect':{ 'width': 160, 'height': 200 }, diff --git a/web/skins/classic/views/event.php b/web/skins/classic/views/event.php index f4f205502..3a9e36be6 100644 --- a/web/skins/classic/views/event.php +++ b/web/skins/classic/views/event.php @@ -27,7 +27,7 @@ if ( !canView( 'Events' ) ) $eid = validInt( $_REQUEST['eid'] ); $fid = !empty($_REQUEST['fid'])?validInt($_REQUEST['fid']):1; -$sql = 'SELECT E.*,M.Name AS MonitorName,M.Width,M.Height,M.DefaultRate,M.DefaultScale,M.VideoWriter,M.SaveJPEGs,M.Orientation,M.LabelFormat FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?'; +$sql = 'SELECT E.*,M.Name AS MonitorName,E.Width,E.Height,M.DefaultRate,M.DefaultScale,M.VideoWriter,M.SaveJPEGs,M.Orientation,M.LabelFormat FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?'; $sql_values = array( $eid ); if ( $user['MonitorIds'] ) {