# Default Record on Motion Rule > [!info] REF: [Actions and stop actions - XProtect VMS products | Milestone Documentation 2025 R1](https://doc.milestonesys.com/2025R1/en-US/standard_features/sf_mc/sf_ui/mc_actionsandstopactionsoverview_rulesandevents.htm?Highlight=set%20recording%20rate%20on%20rule) - XProtect Management Client > Rules & Events > Rules ![[z_img/651c9d5f8fc6b62b5a2ce76a2efff4ae_MD5.jpg]] - XProtect Smart Client > Playback ![[z_img/3c1a177b550e78e32d782fc7647eb144_MD5.jpg]] Here the XProtect Recording Server is buffering recordings from a camera and is waiting for Motion events to trigger recordings to be written to disk. The buffer also means that we can go back in time to write to disk a couple of seconds before an event then do the same for the stop event post motion. ![[z_img/cd226ec7398cfb65600920aba54f3a2e_MD5.jpg]] In the time line you can see the rule play out. - Dark Red indicates recordings with Motion. This is where the Motion Stated event has occurred at the start of the dark red block and Motion Stop is ant the end of the dark red block. - Light red indicates the pre and post recordings in this rule we have 3 second. The color codes legend shows what these and other colors indicate. ![[z_img/5fb5bafb4ecf29bd79a7e22b9ed9afae_MD5.jpg|200]] - XProtect Management Client > Recording Servers > `<REC>` > `<HARDWARE>` > `<CAM>` >Motion Tab ![[z_img/66000fcd8d53e207883311e010488773_MD5.jpg]] For the rule to work **Motion detection** need to be enabled for each camera. This is the default option. Motion has many factors and will be covered in another KB item. For now here are Milestone references; [Motion detection (explained) - XProtect VMS products | Milestone Documentation 2025 R2](https://doc.milestonesys.com/latest/en-US/standard_features/sf_mc/sf_mcnodes/sf_3devices/mc_motiondetectionexplained_devices.htm) [XProtect VMS](https://www.milestonesys.com/globalassets/techcomm/ltsb/provms/english-united-states/index.htm?toc.htm?4136.htm?srsltid=AfmBOooq1tIIk-jLscSDP5Go4Y9Ch0Ih-CZAiOpCYjpX6dVsBU_esr7t) # Record Always Create a new Rule; - **Name:** Record Always - **Type of rule:** Perform an action in a time interval - **Conditions:** Always - **Actions:** Start recording on `<devices>` [Add the camera or camera groups here] - **Stop criteria:** Default - **Stop actions:** Default ![[z_img/f459520da95af707746aaea50b8e5e66_MD5.jpg]] In the XProtect Smart Client we now see constant recording. ![[z_img/9d21ceaea907477feedd12b86e12d3fc_MD5.jpg]] The timeline will show light red to indicate recordings are on the system. Using playback controls you can see the frames recorded. Press the **Next frame** button and looking at the center time line shown time you can count how many frames have been recorded per second. For this example I have **8FPS**, this should match the camera settings. If you still have the motion rule enabled they both work together you will see dark red where motion is triggered. ![[z_img/9d6a8aa9876d4670038d3189c521c64b_MD5.jpg]] This is a good setup, however can be a burden on storage as you are recording all frames all of the time regardless of motion. Another option is speed-up on motion. See the next section for setup. # Keyframe Record plus speed-up on Motion This rule differs to the last rule in that we will record keyframes constantly then then speed-up to all frames on motion. Most cameras default to 1 keyframe per second, however this can be up to once every 4 seconds so double check the camera stream settings. In simple terms the keyframe or I-Frame is your full JPEG image the frames that follow are the differences in the image till the next keyframe comes. We are recording all keyframes then only recording the other frames if there is motion. For this rule I make a copy of the default motion rule, update the title and add the below option in Actions. `Set recording frame rate to all frames for MPEG-4/H.264/H.265 on <devices>` If you do not wish to apply to all cameras, create a camera group and set this as the `from <group>`. ![[z_img/9cd7c27887d85504b1ce2622d15787b7_MD5.jpg]] As default this will record all frames all of the time same as the last rule. For this to work how we want we need to change a camera setting. Select the camera and go to the Record tab. You need to tick `Record keyframes only` ![[z_img/cffe532581fa83593138c732daa91f34_MD5.jpg]] What this does is switches the constant record rule to keyframe record, then on motion the second rule kicks in speed-up the frame rate while motion is detected. Now when you look at recordings, use the **Next frame** button to confirm this. - **Light Red** - Frames increment in seconds. - **Dark red (motion)** - All frames 8 frames per second in my example. ![[z_img/346e2326f6e9ba5c38379358edc23ac5_MD5.jpg]]