Repository navigation
media sdk camera blocking
Camera blocking is a Security Center access control that hides live or recorded video from specific users or security levels. When a camera is blocked for a user, the Media SDK still delivers an event for each frame, but the frame content is not available to that user.
Camera blocking is configured outside the Media SDK. The Media SDK exposes APIs that evaluate blocking state and react to it. Each Media SDK component provides different blocking information, and an integration must handle blocking on every component it uses.
| SDK type or member | Question it answers | Use |
|---|---|---|
LiveBlockingConfiguration.IsLiveBlocked |
Is live video blocked for this camera and user, right now? | Pre-flight check before starting a live-video action |
MediaPlayer.StreamingConnectionStatus |
Is the stream the player is showing blocked right now? | Check for StreamingConnectionStatus.Blocked; subscribe to StreamingConnectionStatusChanged
|
FrameDecodedEventArgs.IsBlocked |
Did a decoded frame arrive without content because video is blocked? | Inside a VideoSourceFilter or AudioVideoSourceFilter frame handler |
BlockCameraUpdated event + MediaBlockingConfiguration
|
Did the blocking configuration change while the source filter was running? | Subscribe on the source filter |
MediaBlockingConfiguration.IsBlocked(DateTime, byte) |
Is video blocked at a specific time for a given security level? | Inside the BlockCameraUpdated handler |
MediaBlockingConfiguration.CanBlockUnblock(DateTime, byte) |
Can this security level block or unblock video at this time? | Gate block/unblock UI commands |
AnalogMonitorController.BlockedCameraRequested |
Did the analog monitor try to display a blocked camera? | Subscribe on AnalogMonitorController
|
Each of these is independent. An integration can run a pre-flight IsLiveBlocked check, subscribe to BlockCameraUpdated while playing back, and still need to handle IsBlocked on individual frames.
Use LiveBlockingConfiguration for a one-shot live-video blocking decision against a specific user.
using Genetec.Sdk.Media;
var blocking = new LiveBlockingConfiguration(engine);
bool isBlocked = blocking.IsLiveBlocked(cameraGuid, userGuid);IsLiveBlocked returns true when live video is blocked for the camera and user. If an existing LiveBlockingConfiguration is used after the engine disconnects from the Directory, IsLiveBlocked also returns true; the integration cannot prove the camera is unblocked, so the API treats it as blocked. If LiveBlockingConfiguration is created while the engine is not connected to a Directory, the constructor can fail before IsLiveBlocked runs.
IsLiveBlocked requires a camera identifier and a user identifier that resolve to entities the logged-on user can access. Resolve the camera and user entities before calling IsLiveBlocked.
Run this check before starting a live workflow that should not begin when video is blocked. It does not subscribe to changes; for ongoing blocking awareness during a session, use BlockCameraUpdated on the source filter.
MediaPlayer reports blocking through StreamingConnectionStatus: the value is StreamingConnectionStatus.Blocked while video is blocked for the logged-on user. Read the property for a point-in-time check, or subscribe to StreamingConnectionStatusChanged to react while the player is running. VideoSourceFilter and AudioVideoSourceFilter expose the same property and event.
When VideoSourceFilter or AudioVideoSourceFilter is running and the camera becomes blocked for the current user, frames continue to arrive but e.IsBlocked is true and e.DecodedFrameContent is null.
private static void OnFrameDecoded(
object sender,
FrameDecodedEventArgs e)
{
using (e)
{
if (e.IsBlocked)
{
ShowBlockedVideoState(e.FrameTime);
return;
}
ProcessFrame(e.DecodedFrameContent);
}
}A blocked frame is an access decision, not a missing image. Show a message that explains the video is blocked instead of leaving the area empty.
VideoSourceFilter raises BlockCameraUpdated when the camera's blocking configuration changes during playback. AudioVideoSourceFilter inherits this behavior. The event argument carries a MediaBlockingConfiguration that can evaluate blocking rules for a UTC timestamp and a security level.
VideoSourceFilter filter = new VideoSourceFilter();
filter.Initialize(engine, cameraGuid);
filter.BlockCameraUpdated += OnBlockCameraUpdated;
filter.PlayLive();Set userLevel to the security level you want to evaluate. For a specific Security Center user and camera, get the value from the user entity with user.GetSecurityLevelForCamera(cameraGuid).
For the blocking range at the requested timestamp, IsBlocked returns true when the user's security-level number is greater than the blocking-level number. For example, with a blocking level of 10, user level 10 is not blocked and user level 11 is blocked.
private static void OnBlockCameraUpdated(
object sender,
BlockCameraUpdatedEventArgs e)
{
bool isBlocked = e.Configuration.IsBlocked(
DateTime.UtcNow,
userLevel);
UpdateBlockedState(isBlocked);
}
MediaBlockingConfiguration member |
Description |
|---|---|
IsBlocked(DateTime timestamp, byte userLevel) |
Returns true when video is blocked at the given UTC time for the given security level. |
CanBlockUnblock(DateTime timestamp, byte userLevel) |
Returns true when the security level is allowed to block or unblock video at the given UTC time. |
Merge(MediaBlockingConfiguration other) |
Combines two configurations into one. Use when the integration subscribes to BlockCameraUpdated on multiple filters and needs a single evaluation. |
Analog monitor playback runs through AnalogMonitorController, not through MediaPlayer or a source filter. Blocking on that path shows up as a separate event:
| Event | Args |
|---|---|
AnalogMonitorController.BlockedCameraRequested |
CameraBlockedEventArgs carries AnalogMonitorId, CameraId, UserId, and BlockLevel. |
Set AnalogMonitorController.CameraBlockingUserId to choose which Security Center user's blocking rules the controller evaluates against. For the rest of the analog-monitor workflow, see AnalogMonitorController.
- About MediaPlayer: MediaPlayer WPF control for live, recorded, and local-file playback.
- About VideoSourceFilter: Headless playback that delivers decoded video and audio frames to your code.
- About AnalogMonitorController: Observing analog monitor stream activity and blocked-camera requests.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- ASP.NET hosting
- SDK compatibility
- Migrating to modern .NET
- Entities
- Entity cache
- Entity loading, cache, and query options
- Detecting entity changes
- Entity change event reference
- Transactions
- Security Center events
- Actions
- Security Desk
- Custom events
- Event-to-actions
- Managing macros
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- Entity write restrictions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Ingesting third-party video
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- About incidents
- Maps
- Logging
- Overview
- Localization
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- Modern .NET support
- Overview
- Localization
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Custom actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- Media file formats
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Endpoints
- Constants
- Enumerations
- Under the hood
- Troubleshooting