Watermark processing method and device for digital media file

The invention provides a watermark processing method and device for a digital media file. The method comprises the steps that discrete cosine transform (DCT) and quantization are performed on a video frame in the digital media file in units of macro blocks so that DCT coefficients of all the macro blocks after quantization can be obtained; the binarized least significant bit is obtained according to the DCT coefficients; corresponding watermark information is inserted according to the least significant bit and corresponding watermark information bits in a watermark information bit sequence. The device comprises a macro block processing module, a least significant bit acquiring module and a watermark processing module, wherein the macro block processing module is used for performing DCT and quantization on the video frame in the digital media file in units of the macro blocks so that the DCT coefficients of all the macro blocks after the quantization can be obtained; the least significant bit acquiring module is used for obtaining the binarized least significant bit according to the DCT coefficients; the watermark processing module is used for inserting the corresponding watermark information according to the least significant bit and the corresponding watermark information bits in the watermark information bit sequence. By the adoption of the watermark processing method and device, consideration can be given to the real-time performance requirement of watermark processing in the digital media file.