CN100581249C - Encoding and decoding method in copyright protection of streaming video content - Google Patents
Encoding and decoding method in copyright protection of streaming video content Download PDFInfo
- Publication number
- CN100581249C CN100581249C CN 200810119360 CN200810119360A CN100581249C CN 100581249 C CN100581249 C CN 100581249C CN 200810119360 CN200810119360 CN 200810119360 CN 200810119360 A CN200810119360 A CN 200810119360A CN 100581249 C CN100581249 C CN 100581249C
- Authority
- CN
- China
- Prior art keywords
- video
- file
- frame
- matrix
- video content
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000013139 quantization Methods 0.000 claims abstract description 8
- 239000011159 matrix material Substances 0.000 claims description 35
- 230000005540 biological transmission Effects 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 claims description 6
- 238000012856 packing Methods 0.000 claims description 5
- 230000009466 transformation Effects 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 101100070542 Podospora anserina het-s gene Proteins 0.000 claims 1
- 230000003993 interaction Effects 0.000 abstract description 2
- 230000008569 process Effects 0.000 description 18
- 230000008859 change Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000005728 strengthening Methods 0.000 description 1
- 230000009897 systematic effect Effects 0.000 description 1
Images
Landscapes
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
本发明涉及一种流媒体视频内容版权保护中的编码和解码方法,属于视频内容版权保护技术领域。对采集到的视频内容进行编码、DCT、量化、置乱、熵编码,生成并加密3GP文件;通过添加加密算法名称、视频内容标识符、视频内容权限发布者地址信息和索引盒子得到PDCF文件以及SDP文件,并以RTP数据包方式发送。流媒体客户端解析RTP包获取并解密视频帧,通过熵解码、反置乱、反量化和反DCT,得到可播放的RGB或YUV数据。本发明方法的优点是通过对DCT系数置乱变换再加密,使得视频内容解密后依然处于信息模糊状态,加强了视频内容的版权保护,通过自定义信息增强了系统中流媒体与应用端的交互性,提高了系统的安全性。
The invention relates to an encoding and decoding method in copyright protection of streaming media video content, and belongs to the technical field of copyright protection of video content. Encoding, DCT, quantization, scrambling, and entropy encoding are performed on the collected video content to generate and encrypt a 3GP file; the PDCF file is obtained by adding the encryption algorithm name, video content identifier, address information of the video content authority publisher, and the index box and SDP file and send it in RTP packet. The streaming media client parses the RTP packet to obtain and decrypt the video frame, and obtain playable RGB or YUV data through entropy decoding, anti-scrambling, anti-quantization and anti-DCT. The advantage of the method of the present invention is that by scrambling and re-encrypting the DCT coefficients, the video content is still in an information-fuzzy state after being decrypted, the copyright protection of the video content is strengthened, and the interaction between the streaming media and the application end in the system is enhanced through custom information. Improved system security.
Description
技术领域 technical field
本发明涉及一种流媒体视频内容版权保护中的编码和解码方法,属于视频内容版权保护技术领域。The invention relates to an encoding and decoding method in copyright protection of streaming media video content, and belongs to the technical field of copyright protection of video content.
背景技术 Background technique
对视频内容进行加密保护是对流媒体应用进行版权保护的一种有效手段。然而,视频流媒体应用系统由多个模块组成,目前的视频内容保护方式单一,一般只对某个模块提供保护,而没有针对整个系统进行考虑。视频流媒体应用系统中每个模块的保护措施也还不够完善,出现这些问题主要是由以下几个困难所造成:Encryption and protection of video content is an effective means of copyright protection for streaming media applications. However, the video streaming application system is composed of multiple modules, and the current video content protection method is single, and generally only provides protection for a certain module, without considering the entire system. The protection measures for each module in the video streaming application system are not perfect, and these problems are mainly caused by the following difficulties:
(1)目前对视频内容进行加密保护都采用高级加密解密标准(以下简称AES)加密算法,主要是因为AES算法对穷举攻击、已知明文攻击和选择明文攻击具有很高强度,使得视频加密系统具有较高的安全性。但是AES要求加密数据块是其基本加密单位的整数倍,而帧内容大小是不固定的,因而现有的视频内容保护方法都采用安全等级低一些的部分加密算法。(1) At present, the encryption and protection of video content adopts the Advanced Encryption and Decryption Standard (hereinafter referred to as AES) encryption algorithm, mainly because the AES algorithm has a high strength against exhaustive attacks, known plaintext attacks and chosen plaintext attacks, making video encryption The system has high security. However, AES requires that the encrypted data block be an integer multiple of its basic encryption unit, and the size of the frame content is not fixed, so the existing video content protection methods all use partial encryption algorithms with lower security levels.
(2)由于流媒体服务器发送到应用端的视频帧数据解密后是标准的视频编码数据,如果存在于内存中的应用端数据被非法用户拷贝,非法用户将可以拷贝的标准视频帧数据解码播放。(2) Since the video frame data sent by the streaming media server to the application end is standard video coded data after decryption, if the application end data stored in the memory is copied by an illegal user, the illegal user will decode and play the standard video frame data that can be copied.
由于上述原因,流媒体视频应用系统中对视频内容的保护是个系统过程,任何一个保护模块的安全性都可能成为系统安全性的瓶颈,而且片面强调单个模块的安全性并不能提供整个系统的安全。只有系统中各个模块的安全性得到保证,对流媒体视频应用系统中对视频内容的保护才算是成功的。而现有的解决方案都是考虑视频内容保护系统中某个模块的安全性,而且保护方法方案也不完善,存有安全隐患。Due to the above reasons, the protection of video content in the streaming video application system is a systematic process, and the security of any protection module may become the bottleneck of system security, and one-sided emphasis on the security of a single module cannot provide the security of the entire system . Only when the security of each module in the system is guaranteed, the protection of video content in the streaming video application system can be regarded as successful. However, the existing solutions all consider the security of a certain module in the video content protection system, and the protection method scheme is not perfect, and there are potential safety hazards.
发明内容 Contents of the invention
本发明的目的是提出一种流媒体视频内容版权保护中的编码和解码方法,对视频内容从帧编码、帧加密、RTP包发送、应用端解密以及帧解码整个过程进行有效的控制,最终达到对原始视频内容进行保护的目的。The purpose of the present invention is to propose a coding and decoding method in the copyright protection of streaming media video content, which can effectively control the entire process of video content from frame coding, frame encryption, RTP packet transmission, application side decryption and frame decoding, and finally achieve The purpose of protecting the original video content.
本发明提出的流媒体视频内容版权保护中的编码和解码方法,包括以下步骤:The encoding and decoding method in the stream media video content copyright protection that the present invention proposes comprises the following steps:
(1)对采集到的视频内容进行编码,得到离散余弦变换系数矩阵A,并对矩阵A进行量化操作得到矩阵B,对矩阵B进行置乱变换得到矩阵C,对矩阵C进行熵编码,生成视频帧H,将先后生成的多个视频帧按照3GP容器标准生成3GP文件T;(1) Encode the collected video content to obtain discrete cosine transform coefficient matrix A, and perform quantization operation on matrix A to obtain matrix B, perform scrambling transformation on matrix B to obtain matrix C, perform entropy encoding on matrix C, and generate The video frame H generates a 3GP file T by successively generating a plurality of video frames according to the 3GP container standard;
(2)根据上述3GP文件T中的控制信息,分别计算出各视频帧H的大小s,对s进行模b运算,b为高级加密解密标准算法中加密块的大小,若计算结果w不为0,则在相应视频帧结尾填充b-w+b个字节,若计算结果w为0,则填充b个字节,填充字节初始化为0,并在最后b字节中记录填充的字节数b-w+b或b,得到3GP文件T’,填充字节后的视频帧为H’;(2) According to the control information in the above-mentioned 3GP file T, calculate the size s of each video frame H respectively, carry out the modulo b operation to s, b is the size of the encryption block in the Advanced Encryption and Decryption Standard Algorithm, if the calculation result w is not 0, b-w+b bytes are filled at the end of the corresponding video frame, if the calculation result w is 0, b bytes are filled, the filling bytes are initialized to 0, and the filled words are recorded in the last b bytes The number of sections b-w+b or b, the 3GP file T' is obtained, and the video frame after filling bytes is H';
(3)采用高级加密解密标难算法对视频帧H’进行加密,得到3GP文件T”,视频帧H’加密后转化为H”;(3) The video frame H' is encrypted using the advanced encryption and decryption algorithm to obtain the 3GP file T ", and the video frame H' is encrypted and converted into H";
(4)向上述3GP文件T”中加入加密算法名称、视频内容标识符和视频内容权限发布者地址信息,得到打包的数字权限管理内容格式文件P,在文件P中添加自定义指令,以构成说明流媒体实时传输协议格式数据包的传输方式的索引盒子,得到支持流媒体应用的打包的数字权限管理内容格式文件P’;(4) Add encryption algorithm name, video content identifier and video content rights issuer address information to above-mentioned 3GP file T ", obtain the digital rights management content format file P of packing, add self-defined instruction in file P, to form Illustrate the index box of the transmission mode of the streaming media real-time transmission protocol format data packet, and obtain the packaged digital rights management content format file P' supporting the streaming media application;
(5)将上述打包的数字权限管理内容格式文件P’输入到流媒体服务器,流媒体服务器从上述文件P’中取出相关字段,得到会话描述协议文件,流媒体服务器在接收到用户的播放视频内容请求后,对上述文件P’进行打包,得到符合实时传输协议格式的第一种数据包,同时对上述会话描述协议文件打包,得到符合实时传输协议格式的第二种数据包,并将第一种数据包和第二种数据包发送到流媒体客户端;(5) The above-mentioned packaged digital rights management content format file P' is input to the streaming server, and the streaming server takes out relevant fields from the above-mentioned file P' to obtain the session description protocol file, and the streaming server receives the user's playing video After the content is requested, the above-mentioned file P' is packaged to obtain the first type of data packet conforming to the format of the real-time transport protocol, and at the same time, the above-mentioned session description protocol file is packaged to obtain the second type of data packet conforming to the format of the real-time transport protocol, and the second type of data packet is obtained One type of data packet and the second type of data packet are sent to the streaming media client;
(6)流媒体客户端对上述接收到的数据包进行解包,得到上述加密的视频帧H”和上述加密算法名称,根据加密算法名称对H”解密,得到视频帧H’,根据视频帧H’的最后b个字节中包含的填充字节数,去除填充字节,得到视频帧H;(6) The streaming media client unpacks the above-mentioned received data packet, obtains the above-mentioned encrypted video frame H" and the above-mentioned encryption algorithm name, decrypts H" according to the encryption algorithm name, and obtains the video frame H', according to the video frame The number of padding bytes contained in the last b bytes of H', remove the padding bytes, and obtain video frame H;
(7)对上述视频帧H进行与上述熵编码相对应的熵解码,得到矩阵C,对矩阵C进行反置乱变换,得到矩阵B,对矩阵B进行反量化,得到矩阵A’,对矩阵A’进行反离散余弦变换,得到视频数据,用于视频播放。(7) Carry out entropy decoding corresponding to the above-mentioned entropy coding to above-mentioned video frame H, obtain matrix C, carry out anti-scrambling transformation to matrix C, obtain matrix B, carry out inverse quantization to matrix B, obtain matrix A ', matrix A' performs an inverse discrete cosine transform to obtain video data for video playback.
本发明提出的流媒体视频内容版权保护中的编码和解码方法,具有以下优点:The encoding and decoding method in the stream media video content copyright protection that the present invention proposes has the following advantages:
(1)通过一种基于离散余弦变换(以下简称DCT)系数置乱的加密技术,采用本方法的流媒体视频应用系统中视频内容解密后依然处于信息模糊状态,因此对视频内容起到了保护的作用,加强了视频内容的版权保护。而传统的视频加密算法只采用AES算法对视频内容进行加密,视频解密后数据仍然受到非法盗版的威胁。(1) Through a kind of encryption technology based on Discrete Cosine Transform (hereinafter referred to as DCT) coefficient scrambling, the video content in the streaming video application system adopting this method is still in the information fuzzy state after decryption, so the video content has been protected. Function, strengthening the copyright protection of video content. However, the traditional video encryption algorithm only uses the AES algorithm to encrypt the video content. After the video is decrypted, the data is still threatened by illegal piracy.
(2)本方法中,通过高级数据加密解密标准对视频帧内容进行完全加密后,视频内容具有可靠的安全性。由于打包的数字权限管理内容格式(以下简称PDCF)中包含了可以指定多种加密算法的自定义信息,使得系统加密策略选择多样化,增强了系统中流媒体与应用端的交互性,同时提高了系统的安全性。(2) In this method, after the content of the video frame is fully encrypted by the Advanced Data Encryption and Decryption Standard, the video content has reliable security. Since the packaged digital rights management content format (hereinafter referred to as PDCF) contains custom information that can specify multiple encryption algorithms, the selection of system encryption strategies is diversified, and the interaction between streaming media and application terminals in the system is enhanced. security.
附图说明 Description of drawings
图1是本发明方法的原理框图。Fig. 1 is a functional block diagram of the method of the present invention.
图2是本发明方法中编码的流程框图。Fig. 2 is a block flow diagram of encoding in the method of the present invention.
图3是本发明方法中解码的流程框图。Fig. 3 is a flowchart of decoding in the method of the present invention.
具体实施方式 Detailed ways
本发明提出的流媒体视频内容版权保护中的编码和解码方法,其原理框图如图1所示,包括以下步骤:Encoding and decoding method in the stream media video content copyright protection that the present invention proposes, its block diagram as shown in Figure 1, comprises the following steps:
1、对采集到的视频内容进行编码,生成离散余弦变换系数矩阵A,并对矩阵A进行量化操作得到矩阵B,对矩阵B以固定大小的宏块数据进行置乱变换得到矩阵C,按照标准熵编码表对C进行熵编码,生成视频帧H,使用开源工具Yamb MP4Tools将先后生成的多个视频帧按照3GP容器标准生成3GP文件T。1. Encode the collected video content, generate discrete cosine transform coefficient matrix A, and perform quantization operation on matrix A to obtain matrix B, perform scrambling transformation on matrix B with fixed-size macroblock data to obtain matrix C, according to the standard The entropy encoding table performs entropy encoding on C to generate video frame H, and uses the open source tool Yamb MP4Tools to generate 3GP file T from multiple video frames successively generated according to the 3GP container standard.
2、根据上述3GP文件T中的控制信息,分别计算出各视频帧H的大小s,对s进行模b运算,b为高级加密解密标准(AES)算法中加密块的大小,若计算结果w不为0,则在相应视频帧结尾填充b-w+b个字节,若计算结果w为0,则填充b个字节。填充字节初始化为0,并在最后b字节的第一个字节记录填充的字节数b-w+b或b,得到3GP文件T’,填充字节后的视频帧为H’。2. According to the control information in the above-mentioned 3GP file T, calculate the size s of each video frame H respectively, carry out modulo b operation to s, and b is the size of the encryption block in the Advanced Encryption Decryption Standard (AES) algorithm, if the calculation result w If it is not 0, fill b-w+b bytes at the end of the corresponding video frame, and if the calculation result w is 0, fill b bytes. The filling byte is initialized to 0, and the number of filled bytes b-w+b or b is recorded in the first byte of the last b byte to obtain the 3GP file T', and the video frame after the filling byte is H'.
在本发明的一个实施例中,计算各视频帧H的大小的过程如下:sfopen打开文件T,先后读入4个字节到变量boxsize和变量boxname中,比较变量boxname中的内容与字符串moov,如果不匹配,则将文件指针向前移动boxsize-8个字节,再先后读入4个字节到变量boxsize和变量boxname中,一直循环这个过程直到变量boxname和字符串moov匹配。此时文件指针指向了moov盒子(以下简称Box)在文件中的绝对位置。先后读入4个字节到变量boxsize和变量boxname中,比较变量boxname中的内容与字符串trak,如果不匹配,则将文件指针向前移动boxsize-8个字节,再先后读入4个字节到变量boxsize和变量boxname中,一直循环这个过程直到变量boxname和字符串trak匹配。此时文件指针指向了文件T中第一个轨道(以下简称track)的物理地址,并将其保存到长整型变量track_loc中,同时将变量boxsize的内容复制到变量track_size中。将此寻找指定Box的过程应用到寻找mdia、hdlr Box中。此过程结束后,指针将指向hdlr Box,将文件指针前移8个字节,以跳过hdlr Box中的字段version和字段pre_defined,其中字段version和字段pre_defined分别占4字节。读入4个字节到变量trak_type。并比较变量trak_type和vide字符串。如果相等,则说明找到了视频track,把当前文件指针赋给变量track_loc,否则将文件指针移到此track_loc指定的文件位置,跳过track_size-8个字节,并进行下一轮比对,直到找到视频track,此时文件指针将定位在视频track位置上。In one embodiment of the present invention, the process of calculating the size of each video frame H is as follows: sfopen opens the file T, reads 4 bytes into variable boxsize and variable boxname successively, compares the content in the variable boxname and the character string moov , if it does not match, move the file pointer forward by boxsize-8 bytes, and then read 4 bytes into the variable boxsize and the variable boxname, and repeat this process until the variable boxname matches the string moov. At this time, the file pointer points to the absolute position of the moov box (hereinafter referred to as Box) in the file. Read 4 bytes into the variable boxsize and the variable boxname successively, compare the content in the variable boxname with the string trak, if they do not match, move the file pointer forward by boxsize-8 bytes, and then read 4 bytes successively The bytes are stored in the variable boxsize and the variable boxname, and this process is repeated until the variable boxname matches the string trak. At this time, the file pointer points to the physical address of the first track (hereinafter referred to as track) in the file T, and saves it in the long integer variable track_loc, and copies the content of the variable boxsize to the variable track_size at the same time. Apply this process of finding a specified Box to finding mdia and hdlr Boxes. After this process ends, the pointer will point to the hdlr Box, and the file pointer will be moved forward by 8 bytes to skip the field version and field pre_defined in the hdlr Box, where the field version and field pre_defined occupy 4 bytes respectively. Read 4 bytes into the variable trak_type. And compare the variable trak_type with the vide string. If they are equal, it means that the video track is found, assign the current file pointer to the variable track_loc, otherwise move the file pointer to the file location specified by this track_loc, skip track_size-8 bytes, and perform the next round of comparison until Find the video track, and the file pointer will be positioned at the position of the video track.
在定位了视频track后,按照定位视频track的方法,可以定位stco Box,只不过将定位视频track过程中的Box嵌套trak、mdia和hdlr改成mdia、minf、stbl和stco,当变量boxname内容与字符串stco匹配时,返回指向stco Box位置的文件指针。After locating the video track, you can locate the stco Box according to the method of locating the video track, but change the nested trak, mdia, and hdlr of the Box in the process of locating the video track to mdia, minf, stbl, and stco, when the content of the variable boxname When matched against the string stco, returns a file pointer to the location of the stco Box.
先后读入4个字节到变量conversion和变量cocount中,创建cocount个chunkoffset类实例。其中chunkoffset类包含整型字段chunkID以及chunk中第1段(以下简称sample)在文件中的长整型绝对位置chunkloc。读入4个字节到第1个chunkoffset实例的chunkID字段,然后读入4字节的文件位置信息到第1个chunkoffset实例的成员变量chunkloc中。将上述的读入变量chunkID和变量chunkloc的过程循环cocount遍,则文件中8*cocount字节的数据块(以下简称chunk)信息都存入了cocount个chunkoffset实例中。Read 4 bytes into the variable conversion and the variable cocount successively, and create cocount instances of the chunkoffset class. The chunkoffset class includes the integer field chunkID and the long integer absolute position chunkloc of the first segment in the chunk (hereinafter referred to as sample) in the file. Read 4 bytes into the chunkID field of the first chunkoffset instance, and then read 4 bytes of file location information into the member variable chunkloc of the first chunkoffset instance. The above process of reading the variable chunkID and the variable chunkloc is repeated cocount times, and the information of the 8*cocount byte data block (hereinafter referred to as chunk) in the file is stored in cocount chunkoffset instances.
按照定位stco Box的方法,可以定位stsz Box。只不过将定位视频stco过程中的Box嵌套mdia、minf、stbl和stco改成mdia、minf、stbl和stsz,当变量boxname内容与字符串stsz匹配时,返回指向stsz Box位置的文件指针。然后分别读入4个字节到变量szversion、变量szsize和变量szcount中,并创建大小为szcount的长整型数组frame。读入4个字节的内容到数组frame的第1个元素中,并将此过程循环szcount次。过程结束后,frame数组中按序存储了此3GP文件中所有视频帧的大小信息。According to the method of locating stco Box, you can locate stsz Box. Just change the box nested mdia, minf, stbl and stco in the process of locating the video stco to mdia, minf, stbl and stsz, and when the variable boxname content matches the string stsz, return the file pointer pointing to the location of the stsz Box. Then read 4 bytes into the variables szversion, szsize and szcount respectively, and create a long integer array frame with the size of szcount. Read the content of 4 bytes into the first element of the array frame, and loop this process for szcount times. After the process ends, the frame array stores the size information of all video frames in the 3GP file in sequence.
按照定位stco Box的方法,可以定位stsd Box。只不过将定位视频stco过程中的Box嵌套mdia、minf、stbl和stco改成mdia、minf、stbl和stsd,当变量boxname内容与字符串stsd匹配时,返回指向stsd Box位置的文件指针。分别读入4字节到变量version和变量entry_count。创建entry_count个类SampleEntry对象。SampleEntry对象主要包括表示分辨率大小的成员变量width和成员变量height、表示每个sample中有多少帧的成员变量frame_count。将文件指针前移12字节,以跳过保留字节。再分别读入2字节到第1个SampleEntry对象的成员变量width和成员变量height中。将文件指针前移12字节,然后读入2字节内容到第1个SampleEntry对象的成员变量frame_count中,再将文件指针前移8字节以跳过无关信息,并将此读取信息过程循环entry_count遍,则文件中每个sample中包含有多少视频帧的信息就保存在SampleEntry对象数组中。According to the method of locating stco Box, you can locate stsd Box. Just change the box nested mdia, minf, stbl and stco in the process of locating the video stco to mdia, minf, stbl and stsd, and when the variable boxname content matches the string stsd, return the file pointer pointing to the location of the stsd Box. Read 4 bytes into the variable version and variable entry_count respectively. Create entry_count class SampleEntry objects. The SampleEntry object mainly includes the member variable width and member variable height indicating the resolution size, and the member variable frame_count indicating how many frames are in each sample. Advance the file pointer by 12 bytes, skipping reserved bytes. Then read 2 bytes into the member variable width and member variable height of the first SampleEntry object. Move the file pointer forward by 12 bytes, then read 2 bytes into the member variable frame_count of the first SampleEntry object, then move the file pointer forward by 8 bytes to skip irrelevant information, and read this information process If the entry_count is looped, the information about how many video frames are contained in each sample in the file will be stored in the SampleEntry object array.
按照定位stco Box的方法,可以定位stsc Box。只不过将定位视频stco过程中的Box嵌套mdia、minf、stbl和stco改成mdia、minf、stbl和stsc,当变量boxname内容与字符串stsc匹配时,返回指向stsc位置的文件指针。先后读入4个字节到变量scversion、变量sccount中并创建sccount个chunk_sample_frame类型的实例。类型chunk_sample_frame有个字段,分别存储chunk在文件中的绝对位置和每个chunk中含有sample的帧数目。先后读入4个字节的信息到第1个chunk_sample_frame对象的成员变量first_chunk和成员变量samples_per_chunk中,并将此过程循环sccount次。过程结束后,chunk_sample_frame实例中按序存储了此3GP文件中chunk的绝对位置以及每个sample包含的帧数信息。创建新的类型Chunk_frame。Chunk_frame类中包含3个字段,分别为chunk的ID号,chunk的起始物理地址、chunk中包含的帧数目。根据SampleEntry类型数组中存有的每个sample中包含的帧个数信息以及chunk_sample_frame数组中存有的每个chunk含有的sample个数信息,可以计算出每个chunk中有多少个帧,并将数据保存在chunk_frame的frameNum字段中。至此,chunk_frame数组中保存了chunk的所有信息,包括chunk的ID号,chunk的起始物理地址、chunk中包含的帧数。通过chunk_frame数组以及数组frame就能够准确定位每一帧在文件中的绝对位置。According to the method of locating stco Box, you can locate stsc Box. Just change the box nested mdia, minf, stbl and stco in the process of locating the video stco to mdia, minf, stbl and stsc, and when the content of the variable boxname matches the string stsc, return the file pointer pointing to the location of stsc. Read 4 bytes into variable scversion and variable sccount successively and create sccount instances of chunk_sample_frame type. The type chunk_sample_frame has a field that stores the absolute position of the chunk in the file and the number of frames containing the sample in each chunk. Read 4 bytes of information successively into the member variable first_chunk and member variable samples_per_chunk of the first chunk_sample_frame object, and loop this process sccount times. After the process ends, the chunk_sample_frame instance stores the absolute position of the chunk in the 3GP file and the number of frames contained in each sample in sequence. Create a new type Chunk_frame. The Chunk_frame class contains 3 fields, which are the ID number of the chunk, the starting physical address of the chunk, and the number of frames contained in the chunk. According to the number of frames contained in each sample stored in the SampleEntry type array and the number of samples contained in each chunk stored in the chunk_sample_frame array, the number of frames in each chunk can be calculated, and the data Stored in the frameNum field of chunk_frame. So far, the chunk_frame array has saved all the information of the chunk, including the ID number of the chunk, the starting physical address of the chunk, and the number of frames contained in the chunk. The absolute position of each frame in the file can be accurately positioned through the chunk_frame array and the array frame.
3、采用高级加密解密标准算法对视频帧H’进行加密,得到3GP文件T”,视频帧H’转化为H”。3. The video frame H' is encrypted using the advanced encryption and decryption standard algorithm to obtain a 3GP file T", and the video frame H' is converted into H".
4、向上述3GP文件T”中加入加密算法名称、视频内容标识符和视频内容权限发布者地址信息,得到打包的数字权限管理内容格式文件P,在文件P中添加自定义指令,以构成说明流媒体实时传输协议格式数据包的传输方式的索引盒子,得到支持流媒体应用的打包的数字权限管理内容格式文件P’。具体实现过程为:4. Add the name of the encryption algorithm, the video content identifier, and the address information of the video content rights issuer to the above-mentioned 3GP file T" to obtain a packaged digital rights management content format file P, and add custom instructions to the file P to form a description The index box of the transmission mode of the streaming media real-time transmission protocol format data packet, obtains the packaged digital rights management content format file P' that supports the streaming media application. The specific implementation process is:
遵照ISO IEC 14496-12标准向3GP文件中加入sinf Box信息。遵循3GPP TS 26.244700和ISO IEC 14496-12标准设计sinf Box,其内容主要包括加密算法名称、视频内容标识符和视频内容权限发布者地址信息。fopen打开T”,遵循ISO IEC 14496-12标准中关于meta Box的定义并采用上述定位Box的方法搜索T”中的meta Box。如果T”中没有meta Box,则将文件指针指向文件结尾,按照3GPP TS 26.244 700和ISO IEC 14496-12标准添加包含meta Box及其子Box sinf Box的字节信息。如果T”中含有meta Box,则读出meta Box信息到临时变量t中,将自定义信息加密算法名称、视频内容标识符和视频内容权限发布者地址信息按照上述定位Box的方法添加到sinf Box中,并将使用t覆盖T”中原有的meta Box信息。通过向上述3GP文件T”中加入加密算法名称、视频内容标识符和视频内容权限发布者地址信息,得到了打包的数字权限管理内容格式(PDCF)文件P;通过使用开源工具QuickTime流化功能,生成包含索引(以下简称hint)Box的文件P’,hint Box由文件P中moov Box内的音视频的索引信息构成,用于支持流媒体服务器的流应用。Add sinf Box information to 3GP files according to ISO IEC 14496-12 standard. The sinf Box is designed in accordance with 3GPP TS 26.244700 and ISO IEC 14496-12 standards, and its content mainly includes encryption algorithm name, video content identifier and video content rights issuer address information. fopen opens T", follows the definition of the meta Box in the ISO IEC 14496-12 standard and uses the above method of locating the Box to search for the meta Box in T". If there is no meta Box in T", point the file pointer to the end of the file, and add byte information including the meta Box and its sub-Box sinf Box according to 3GPP TS 26.244 700 and ISO IEC 14496-12 standards. If T" contains meta Box , then read the meta Box information into the temporary variable t, add the custom information encryption algorithm name, video content identifier and video content authority publisher address information to the sinf Box according to the above method of locating the Box, and overwrite it with t Original meta Box information in "T". By adding the encryption algorithm name, video content identifier and video content rights issuer address information to the above-mentioned 3GP file T", the digital rights management content format (PDCF) file P of packaging is obtained; By using the open source tool QuickTime streaming function, a file P' containing an index (hint) Box is generated. The hint Box is composed of the audio and video index information in the moov Box in the file P, and is used to support the streaming application of the streaming media server.
5、流媒体服务器分析上述打包的数字权限管理内容格式P’,得到会话描述协议文件(SDP)。流媒体服务器接收到播放视频内容请求后,对上述打包的数字权限管理内容格式文件P’进行打包,得到实时传输协议(RTP)格式数据包,同时将会话描述协议文件也打包成实时传输协议格式数据包,并将这些数据包发送到流媒体客户端。5. The streaming media server analyzes the above-mentioned packaged digital rights management content format P' to obtain a session description protocol file (SDP). After the streaming media server receives the request to play the video content, it packs the above-mentioned packaged digital rights management content format file P' to obtain a real-time transport protocol (RTP) format data packet, and at the same time packs the session description protocol file into the real-time transport protocol format packets and send those packets to the streaming client.
6、流媒体客户端从上述接收到的实时传输协议格式数据包中,解析出加密后的帧H”和加密算法名称,采用高级加密解密标准算法对H”解密,得到视频帧H’,根据视频帧H’的最后b个字节中第1个字节内容计算出填充字节数,去除帧尾部的填充字节,得到视频帧H。6. The streaming media client parses the encrypted frame H" and the name of the encryption algorithm from the received real-time transport protocol format data packet, and uses the advanced encryption and decryption standard algorithm to decrypt H" to obtain the video frame H', according to The content of the first byte in the last b bytes of the video frame H' calculates the number of padding bytes, removes the padding bytes at the end of the frame, and obtains the video frame H.
7、对上述视频帧H进行熵解码,得到矩阵C,对矩阵C进行反置乱变换,得到矩阵B,对矩阵B进行反量化,得到矩阵A’,对矩阵A’进行反离散余弦变换,得到可用于播放的RGB或YUV数据,直接用于视频播放。7. Perform entropy decoding on the above video frame H to obtain matrix C, perform inverse scrambling transformation on matrix C to obtain matrix B, perform inverse quantization on matrix B to obtain matrix A', and perform inverse discrete cosine transform on matrix A', Get the RGB or YUV data that can be used for playback, and directly use it for video playback.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200810119360 CN100581249C (en) | 2008-09-05 | 2008-09-05 | Encoding and decoding method in copyright protection of streaming video content |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200810119360 CN100581249C (en) | 2008-09-05 | 2008-09-05 | Encoding and decoding method in copyright protection of streaming video content |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101355695A CN101355695A (en) | 2009-01-28 |
CN100581249C true CN100581249C (en) | 2010-01-13 |
Family
ID=40308238
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200810119360 Active CN100581249C (en) | 2008-09-05 | 2008-09-05 | Encoding and decoding method in copyright protection of streaming video content |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100581249C (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
IL199486A0 (en) * | 2009-06-22 | 2011-08-01 | Nds Ltd | Partial encryption using variable block-size parameters |
CN103136459B (en) * | 2013-01-09 | 2018-12-21 | 上海威客网络科技有限公司 | A kind of copyright method and system of encrypted digital content |
CN104661082A (en) * | 2015-02-04 | 2015-05-27 | 深圳创维数字技术有限公司 | Program source data protecting method and relating devices |
CN105100820B (en) * | 2015-08-18 | 2019-05-03 | 杭州士兰微电子股份有限公司 | Coding method, coding/decoding method, code device and the decoding apparatus of digital media file |
CN106649411B (en) * | 2015-11-04 | 2019-12-06 | 青岛伟东云教育集团有限公司 | courseware making and analyzing device and method |
CN108632282A (en) * | 2018-05-10 | 2018-10-09 | 句容市百事特复合材料有限公司 | Image and video safe transmission method based on image library |
CN109462469A (en) * | 2018-11-13 | 2019-03-12 | 常熟理工学院 | Based on arrangement and displaced network flow-medium information security encryption method and system |
CN114727157B (en) * | 2022-03-31 | 2022-11-15 | 慧之安信息技术股份有限公司 | Video encryption and decryption method and system based on platform |
CN117395474B (en) * | 2023-12-12 | 2024-02-27 | 法序(厦门)信息科技有限公司 | Locally stored tamper-resistant video evidence obtaining and storing method and system |
-
2008
- 2008-09-05 CN CN 200810119360 patent/CN100581249C/en active Active
Non-Patent Citations (4)
Title |
---|
A DCT-based MPEG-2 Transparent Scrambling Algorithm. Ci Wang, Hong-Bin Yu, and Meng Zheng.IEEE Transactions on Consumer Electronics,Vol.Vol. 49 No.No. 4. 2003 |
A DCT-based MPEG-2 Transparent Scrambling Algorithm. Ci Wang, Hong-Bin Yu, and Meng Zheng.IEEE Transactions on Consumer Electronics,Vol.Vol. 49 No.No. 4. 2003 * |
一种流媒体DRM 系统及音视频加解密模块的研究与设计. 郭辉,葛建华.现代电子技术,第No.22期. 2006 |
一种流媒体DRM 系统及音视频加解密模块的研究与设计. 郭辉,葛建华.现代电子技术,第No.22期. 2006 * |
Also Published As
Publication number | Publication date |
---|---|
CN101355695A (en) | 2009-01-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100581249C (en) | Encoding and decoding method in copyright protection of streaming video content | |
JP7418533B2 (en) | System and method for protecting elementary bitstreams incorporating independently encoded tiles | |
KR101730754B1 (en) | Dlna/dtcp stream conversion for secure media playback | |
US8510568B2 (en) | Method and apparatus for importing a transport stream | |
US8638929B2 (en) | System and method for encrypting and decrypting data | |
CN100481933C (en) | A method for encryption of MP4 multi-media data content | |
CN101350918B (en) | Method for protecting copyright of video content | |
Hartung et al. | Drm protected dynamic adaptive http streaming | |
CN110881142A (en) | Audio and video data encryption and decryption method and device based on rtmp and readable storage medium | |
CN109743627B (en) | Playing method of digital movie package based on AVS + video coding | |
JP4745738B2 (en) | Media file recording method | |
JP4860993B2 (en) | Method and apparatus for protecting content packaging | |
CN104272748A (en) | Encryption-resistant watermarking | |
Shin et al. | A study on the digital right management of MPEG-4 streams for digital video library | |
CN119094819A (en) | A video encryption transmission method and related device | |
Kim et al. | Protection system for MPEG-2 streaming media | |
Park et al. | DRM for streamed MPEG-4 media | |
Park et al. | Protecting ASF movie on VOD | |
WO2005060259A2 (en) | Method and device for distributing av content in download type file format |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |