With the proliferation of cloud-based video storage and real-time streaming, ensuring confidentiality without compromising compression efficiency is a significant challenge. Traditional full encryption of video bitstreams destroys the compression structure, making streams unplayable without decryption. This paper introduces Jigsaw x264 , a selective encryption scheme integrated into the x264 encoder. By treating each frame as a puzzle, the algorithm applies a pseudo-random permutation of macroblock slices, akin to reassembling jigsaw pieces, while leaving critical headers intact for decoder compatibility. Experimental results show that Jigsaw x264 achieves 98% perceptual degradation with only 8% overhead in encoding time and negligible bitrate increase.