# Efficient Transcoding and Encryption for Live 360 CCTV System
## 1 Introduction  
Nowadays, closed-circuit television (CCTV) is widely deployed in the video surveillance systems and video analysis is a key factor to provide intelligent services. Previously, analog CCTV systems were used to search for intruders in the pre-recorded video by human. Currently, digital CCTV can process automatically using video analytic technologies in a computer system. To meet the necessity of CCTV systems video analytic, improving quality of service (QoS) of video CCTV is one indispensable element. Especially, the existing 2D CCTV system cannot provide high-resolution such as Ultra-HD 4K, or has difficulty adopting new video codec such as High-Efficiency Video Coding (HEVC) [1]. The video converting method is necessary to adapt the various requirements of CCTV systems. Compared to the H.264/MPEG (Moving Picture Experts Group)-4 Advanced Video Coding (AVC), the HEVC video encoding has achieved approximately twice the compression [2]. It was developed and standardized by a joint team of MPEG known as the Joint Collaborative Team on Video Coding (JCT-VC) [3]. H.264/AVC standard (ITU-T Rec. H.264 | ISO/IEC 14496-10) is reviewed in [4]. HEVC is also standardized as ITU-T H.265 | ISO/IEC 23008-2 (MPEG-H Part 2). HEVC has quickly been deployed in many video services due to its high-performance in compression. Because of a large amount of existing video content encoded with the H.264/AVC format, transcoding H.264/AVC bitstream to HEVC bitstream is very demanding. In addition, most current 2D/3D CCTV systems only support H.264/AVC, thus a transcoder would help upgrade these CCTV systems at a lowest cost. The computational complexity of HEVC coding is extremely high compared to the H.264 standard. This makes it difficult to implement real-time high-quality HEVC encoder software in multimedia encoding and transcoding systems. The emergence of 360 videos has brought new trends in video research. It promotes the change of the video experience of users. Moreover, it also opens up more opportunities for video processing area such as efficient encoding, high bandwidth transmission, high-resolution, real-time video interaction, etc. Due to above factors, 360 video technology is promising in changing the surveillance of CCTV systems in the near future. By using the 360 CCTV, the surveillance system will have many changes in monitoring methods as well as surveillance video analysis. However, 360 video streaming requires high bandwidth with low latency, so it is hardly compatible with existing systems. Therefore, a transcoder with the ability to change the bitrate, resolution, and codec is needed to meet the various demands of the terminals. Encryption is an important factor to ensure user information is secure in security systems. There are many different methods to implement security features in CCTV systems. For example, the encryption can be performed at the Network Abstract Layer (NAL) unit level and affect all NAL units in whole bitstream file. The performance of the encoder is not significant as it will increase the complexity of the encoder and the transcoder. Therefore, in this paper, we propose a transcoding method for multi-core platforms. Moreover, the proposed system encrypts the Video Parameter Set (VPS), Picture Parameter Set (PPS) and Sequence Parameter Set (SPS) NAL units of the HEVC bitstream during transcoding process. The NAL encryption step occurs after NAL encoding step in a serial process. Based on Big O notation theory, the encryption process for each transcoding thread does not increase the complexity of the system. The experimental results show that the proposed system provided significant speed, corresponding to a bit rate for H.264 to HEVC real-time transcoding of 36.4 frames/s for 1080p with six simultaneous threads and 33.6 frames/s for 4K with two simultaneous threads.