The drone industry has opened its market to ordinary people, making drones prevalent in daily life. However, safety and security issues have been raised as the number of accidents rises (e.g., losing control and colliding with people or invading secured properties). For safety and security purposes, observers and surveillance systems must be aware of UAVs invading aerial spaces. This paper introduces a UAV tracking system with ROI-based video coding capabilities that can efficiently encode videos with a dynamic coding rate. The proposed system initially uses deep learning-based UAV detection to locate the UAV and determine the ROI surrounding the detected UAVs. Afterward, the ROI is tracked using optical flow, which is relatively light in computational load. Furthermore, our devised module for effective compression, XROI-DCT, is applied to non-ROI regions, so a different coding rate is applied depending on the region during encoding. The proposed UAV tracking system is implemented and evaluated by utilizing videos from YouTube, Kaggle, and a video of 3DR Solo2 taken by the authors. The evaluation verifies that the proposed system can detect and track UAVs significantly faster than YOLOv7 and efficiently encode a video, compressing 70% of the video based on the ROI. Additionally, it can successfully identify the UAV model with a high accuracy of 0.9869 ROC–AUC score.