Welcome to the next stage of practical development! In the previous chapters, we have successfully displayed the video smoothly on the canvas and mastered the device status and snapshot features through Callbacks. But what if we want to completely preserve this dynamic video and audio process? This brings us to another core area of the NexVDO SDK: "Record".
Recording high-quality videos (such as 1080p60) typically consumes a significant amount of CPU resources, leading to system stuttering. To perfectly solve this problem, we will call upon the SDK's underlying magic in the upcoming implementation: GPU Hardware Encoding Acceleration. Through the NVENC engine on the NVIDIA Jetson platform, we can compress raw video into high-quality H.264 + AAC MP4 files in real-time with extremely low CPU usage!

To achieve perfect hardware-accelerated recording, we don't need to delve into complex codec algorithms. Once a signal is detected, simply call the following 4 core APIs in sequence to set the "encoding properties" and issue the "start/stop" commands:

QCAP_SET_VIDEO_RECORD_PROPERTY:Set video recording properties.QCAP_SET_AUDIO_RECORD_PROPERTY:Set audio recording properties.QCAP_START_RECORD:Start recording.QCAP_STOP_RECORD:Stop recording.
Before starting to set detailed parameters, we must first understand the two core advantages of the NexVDO SDK recording engine:
1. Rich Audio/Video Container Formats and Encoding Matrix Whether your project requires standard MP4, TS streams used in professional broadcasting, or web-friendly M3U8/FLV formats, the SDK has already cleared the path for you at the underlying level! Based on the following formats, developers can freely combine video and audio codecs with extreme flexibility:

2. Multi-Stream Recording In application scenarios like security surveillance or high-end broadcasting, we often need to record a "high-resolution archive file" and a "low-resolution preview file" simultaneously. Through the SDK's exclusive multi-stream technology, the same capture card supports opening up to 4 independent recording channels simultaneously (corresponding to iRecNum 0~3 in the parameters later). For example, you can apply different settings to the same signal simultaneously via the API:
iRecNum = 0): Record in 1920x1080 high quality (24Mbps) for local high-definition storage.