CN107318045A - The method and device of playing video data stream - Google Patents
The method and device of playing video data stream Download PDFInfo
- Publication number
- CN107318045A CN107318045A CN201610269016.1A CN201610269016A CN107318045A CN 107318045 A CN107318045 A CN 107318045A CN 201610269016 A CN201610269016 A CN 201610269016A CN 107318045 A CN107318045 A CN 107318045A
- Authority
- CN
- China
- Prior art keywords
- data stream
- video data
- decrypted
- video
- multiple data
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 152
- 230000006870 function Effects 0.000 claims abstract description 55
- 230000015654 memory Effects 0.000 claims description 48
- 238000012545 processing Methods 0.000 claims description 38
- 238000012795 verification Methods 0.000 claims description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 claims 1
- 230000008569 process Effects 0.000 description 38
- 238000013496 data integrity verification Methods 0.000 description 13
- 238000010586 diagram Methods 0.000 description 11
- 230000009471 action Effects 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 5
- 238000009877 rendering Methods 0.000 description 5
- 238000006243 chemical reaction Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 239000000969 carrier Substances 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000009191 jumping Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000008447 perception Effects 0.000 description 2
- 101150015547 SDL1 gene Proteins 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4405—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video stream decryption
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
本发明公开了一种播放视频数据流的方法及装置。其中,该方法包括:获取待解密的视频数据流;根据与待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理;将处理后的视频数据流发送至与视频格式对应的解码代码进行播放。本发明解决了相关技术中播放工具提供的播放接口和功能无法支持对于加密视频文件的解码与播放,由此易造成视频文件因为没有经过加密处理故而轻易地被黑客伪装和篡改的技术问题。
The invention discloses a method and device for playing video data streams. Wherein, the method includes: obtaining the video data stream to be decrypted; decrypting the video data stream to be decrypted according to the decryption method corresponding to the encryption method adopted by the video data stream to be decrypted; sending the processed video data stream to The decoding code corresponding to the video format is played. The invention solves the technical problem that the playback interface and functions provided by the playback tool in the related art cannot support the decoding and playback of encrypted video files, thus easily causing the video files to be easily disguised and tampered by hackers because they have not been encrypted.
Description
技术领域technical field
本发明涉及计算机领域,具体而言,涉及一种播放视频数据流的方法及装置。The invention relates to the field of computers, in particular to a method and device for playing video data streams.
背景技术Background technique
现有技术可以提供一种用于播放音视频数据的音视频播放工具,主要通过对音视频的转换、解码等处理来播放音视频,其中,音视频播放工具一般依赖于音视频解码库来实现音视频数据的转换解码等功能,但现有的音视频播放工具提供的播放接口和功能无法支持对于加密视频的解码与播放,从而导致当前待播放的音视频文件存在被黑客伪装和篡改等安全风险。The existing technology can provide an audio and video playback tool for playing audio and video data, mainly through audio and video conversion, decoding and other processing to play audio and video, wherein the audio and video playback tools generally rely on audio and video decoding libraries to achieve Audio and video data conversion and decoding functions, but the playback interface and functions provided by the existing audio and video playback tools cannot support the decoding and playback of encrypted videos, which leads to the security of the audio and video files currently to be played by hackers such as camouflage and tampering risk.
例如,以快进动态图像专家组(fast forward moving picture experts group,简称为ffmpeg)为例,ffmpeg是一种开源的音视频解码库,其可以用来记录、转换数字音频/视频。ffmpeg包含了非常先进的音频/视频编解码库,可以在多种操作系统环境中编译运行。For example, take the fast forward moving picture experts group (ffmpeg for short) as an example, ffmpeg is an open source audio and video decoding library, which can be used to record and convert digital audio/video. ffmpeg contains a very advanced audio/video codec library, which can be compiled and run in a variety of operating system environments.
目前,ffmpeg主要具有以下几种功能:Currently, ffmpeg mainly has the following functions:
(1)视频采集功能(1) Video capture function
ffmpeg不仅可以采集视频采集卡或通用串行总线(Universal Serial Bus,简称为USB)摄像头的图像,还可以进行屏幕录制,此外,还同时支持按照实时传输协议(Real-time Transport Protocol,简称为RTP)方式将视频流传送给支持快速生成树协议(Rapid Spanning Tree Protocol,简称为RSTP)的流媒体服务器,支持播放应用。ffmpeg can not only capture images from video capture cards or Universal Serial Bus (USB) cameras, but also perform screen recording. In addition, it also supports real-time transport protocol (RTP) ) way to send the video stream to a streaming media server that supports Rapid Spanning Tree Protocol (RSTP for short), and supports playback applications.
(2)视频格式转换功能(2) Video format conversion function
ffmpeg可以实现多种视频格式之间的相互转换(例如:wma,rmvb,avi,mod)。ffmpeg can realize mutual conversion between various video formats (for example: wma, rmvb, avi, mod).
(3)视频截图功能(3) Video screenshot function
ffmpeg对于选定的视频截取指定时间的缩略图,通过视频截图来获取静态图和/或动态图。ffmpeg captures a thumbnail of the selected video at a specified time, and obtains static images and/or dynamic images through video screenshots.
(4)为视频添加水印功能。(4) Add watermark function for video.
ffmpeg能够被用来为视频添加水印(logo)。ffmpeg can be used to add watermark (logo) to video.
然而,现有ffmpeg提供的播放接口和功能无法支持对于加密视频的解码与播放,由此易造成视频文件因为没有经过加密处理故而轻易地被黑客伪装和篡改,以达到对基于ffmpeg组件开发的视频播放器或者ffmpeg所运行于的操作环境进行恶意攻击或者制作与上述视频文件相关的盗版产品的目的。However, the playback interface and functions provided by the existing ffmpeg cannot support the decoding and playback of encrypted videos, which can easily cause video files to be easily disguised and tampered by hackers because they have not been encrypted, so as to achieve the video developed based on ffmpeg components. The purpose of malicious attacks on the operating environment in which the player or ffmpeg runs or to make pirated products related to the above video files.
针对上述的问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.
发明内容Contents of the invention
本发明实施例提供了一种播放视频数据流的方法及装置,以至少解决相关技术中播放工具提供的播放接口和功能无法支持对于加密视频文件的解码与播放,由此易造成视频文件因为没有经过加密处理故而轻易地被黑客伪装和篡改的技术问题。Embodiments of the present invention provide a method and device for playing video data streams, to at least solve the problem that the playback interface and functions provided by playback tools in the related art cannot support the decoding and playback of encrypted video files, thus easily causing video files because there is no It is a technical problem that is easily disguised and tampered by hackers after being encrypted.
根据本发明实施例的一个方面,提供了一种播放视频数据流的方法,包括:According to an aspect of an embodiment of the present invention, a method for playing a video data stream is provided, including:
获取待解密的视频数据流;根据与待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理;将处理后的视频数据流发送至与视频格式对应的解码代码进行播放。Obtain the video data stream to be decrypted; decrypt the video data stream to be decrypted according to the decryption method corresponding to the encryption method adopted by the video data stream to be decrypted; send the processed video data stream to the decoder corresponding to the video format code to play.
可选地,获取待解密的视频数据流包括:注册视频数据流读取接口;采用视频数据流读取接口对待解密的视频数据流进行重定向,获取待解密的视频数据流。Optionally, obtaining the video data stream to be decrypted includes: registering a video data stream reading interface; using the video data stream reading interface to redirect the video data stream to be decrypted, and obtaining the video data stream to be decrypted.
可选地,通过与视频格式对应的解码代码提供的回调函数接口向与视频格式对应的解码代码注册视频数据流读取接口。Optionally, register the video data stream reading interface with the decoding code corresponding to the video format through the callback function interface provided by the decoding code corresponding to the video format.
可选地,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法对多个数据块逐一进行加密,再采用第二加密算法对加密后的多个数据块进行整体加密时,根据解密方式对待解密的视频数据流进行解密处理包括:通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;对多个数据块进行组装,得到处理后的视频数据流。Optionally, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length and use the first encryption algorithm to encrypt the multiple data blocks one by one, and then use the second encryption algorithm to encrypt the encrypted data. When a plurality of data blocks of multiple data blocks are encrypted as a whole, the decryption processing of the video data stream to be decrypted according to the decryption method includes: decrypting a plurality of encrypted data streams from the video data stream to be decrypted by using a decryption algorithm matching the second encryption algorithm blocks; using a decryption algorithm matching the first encryption algorithm to decrypt multiple data blocks from the multiple encrypted data blocks; assembling the multiple data blocks to obtain a processed video data stream.
可选地,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法对加密后的多个数据块进行整体加密时,根据解密方式对待解密的视频数据流进行解密处理包括:通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验;在数据完整性校验成功后,对多个数据块进行组装,得到处理后的视频数据流。Optionally, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, use the first encryption algorithm to encrypt the multiple data blocks one by one and add digital watermarks to the multiple data blocks one by one , when the second encryption algorithm is used to encrypt the encrypted multiple data blocks as a whole, according to the decryption method, the decryption processing of the video data stream to be decrypted includes: using the decryption algorithm matching the second encryption algorithm from the video data to be decrypted Decrypt multiple encrypted data blocks in the stream; decrypt multiple data blocks from the multiple encrypted data blocks through a decryption algorithm that matches the first encryption algorithm; The added digital watermark performs data integrity check on multiple data blocks; after the data integrity check succeeds, multiple data blocks are assembled to obtain a processed video data stream.
可选地,在获取待解密的视频数据流之后,还包括:请求创建内存空间,其中,内存空间用于存储待解密的视频数据流以及存储待解密的视频数据流进行解密处理过程中得到的中间数据。Optionally, after obtaining the video data stream to be decrypted, it also includes: requesting to create a memory space, wherein the memory space is used to store the video data stream to be decrypted and to store the video data stream to be decrypted during the decryption process intermediate data.
根据本发明实施例的另一方面,还提供了一种播放视频数据流的装置,包括:According to another aspect of the embodiments of the present invention, there is also provided a device for playing video data streams, including:
获取模块,用于获取待解密的视频数据流;处理模块,用于根据与待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理;发送模块,用于将处理后的视频数据流发送至与视频格式对应的解码代码进行播放。The obtaining module is used to obtain the video data stream to be decrypted; the processing module is used to decrypt the video data stream to be decrypted according to the decryption method corresponding to the encryption method adopted by the video data stream to be decrypted; the sending module is used for Send the processed video data stream to the decoding code corresponding to the video format for playback.
可选地,获取模块包括:注册单元,用于注册视频数据流读取接口;获取单元,用于采用视频数据流读取接口对待解密的视频数据流进行重定向,获取待解密的视频数据流。Optionally, the obtaining module includes: a registration unit for registering the video data stream reading interface; an obtaining unit for redirecting the video data stream to be decrypted by using the video data stream reading interface to obtain the video data stream to be decrypted .
可选地,注册单元,用于通过与视频格式对应的解码代码提供的回调函数接口向与视频格式对应的解码代码注册视频数据流读取接口。Optionally, the registration unit is configured to register the video data stream reading interface with the decoding code corresponding to the video format through a callback function interface provided by the decoding code corresponding to the video format.
可选地,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法对多个数据块逐一进行加密,再采用第二加密算法对加密后的多个数据块进行整体加密时,处理模块包括:第一解密单元,用于通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;第二解密单元,用于通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;组装单元,用于对多个数据块进行组装,得到处理后的视频数据流。Optionally, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length and use the first encryption algorithm to encrypt the multiple data blocks one by one, and then use the second encryption algorithm to encrypt the encrypted data. When a plurality of data blocks are encrypted as a whole, the processing module includes: a first decryption unit, which is used to decrypt a plurality of encrypted data blocks from the video data stream to be decrypted through a decryption algorithm matched with the second encryption algorithm; The second decryption unit is used to decrypt multiple data blocks from the encrypted multiple data blocks through a decryption algorithm that matches the first encryption algorithm; the assembly unit is used to assemble multiple data blocks to obtain the processed video data flow.
可选地,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法对加密后的多个数据块进行整体加密时,处理模块包括:第一解密单元,用于通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;第二解密单元,用于通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;校验单元,用于通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验;组装单元,用于在数据完整性校验成功后,对多个数据块进行组装,得到处理后的视频数据流。Optionally, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, use the first encryption algorithm to encrypt the multiple data blocks one by one and add digital watermarks to the multiple data blocks one by one , when the second encryption algorithm is used to encrypt the encrypted multiple data blocks as a whole, the processing module includes: a first decryption unit, which is used to decrypt the video data stream to be decrypted by a decryption algorithm matching the second encryption algorithm output a plurality of encrypted data blocks; the second decryption unit is used to decrypt a plurality of data blocks from the encrypted plurality of data blocks through a decryption algorithm matched with the first encryption algorithm; The digital watermark added to each data block in multiple data blocks performs data integrity verification on multiple data blocks; the assembly unit is used to assemble multiple data blocks and process them after the data integrity verification is successful subsequent video streams.
可选地,上述装置还包括:请求模块,用于请求创建内存空间,其中,内存空间用于存储待解密的视频数据流以及存储待解密的视频数据流进行解密处理过程中得到的中间数据。Optionally, the above device further includes: a requesting module, configured to request to create a memory space, wherein the memory space is used to store the video data stream to be decrypted and intermediate data obtained during decryption of the video data stream to be decrypted.
根据本发明实施例的又一方面,还提供了一种服务器,该服务器,用于接收来自于客户端的待解密的视频数据流,根据与待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理以及将解密处理后的视频数据流发送至与视频格式对应的解码代码进行播放。According to yet another aspect of the embodiments of the present invention, a server is also provided, the server is used to receive the video data stream to be decrypted from the client, and decrypt it according to the encryption mode corresponding to the video data stream to be decrypted The method is to decrypt the video data stream to be decrypted and send the decrypted video data stream to the decoding code corresponding to the video format for playback.
在本发明实施例中,采用在获取到待解密的视频数据流之后,先根据待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理,然后再将处理后的视频数据流发送至与视频格式对应的解码代码进行播放的方式,通过先对获取到的加密视频进行解密和封装,达到了对加密视频进行解码与播放的目的,从而实现了针对定制化的加密视频文件进行解码和播放,有效地防止加密视频文件中的视频数据被修改或视频文件被盗版的技术效果,进而解决了相关技术中播放工具提供的播放接口和功能无法支持对于加密视频文件的解码与播放,由此易造成视频文件因为没有经过加密处理故而轻易地被黑客伪装和篡改的技术问题。In the embodiment of the present invention, after the video data stream to be decrypted is acquired, the video data stream to be decrypted is decrypted according to the decryption method corresponding to the encryption method adopted by the video data stream to be decrypted, and then the processed The final video data stream is sent to the decoding code corresponding to the video format for playback. By first decrypting and encapsulating the obtained encrypted video, the purpose of decoding and playing the encrypted video is achieved, thereby realizing customization. The encrypted video file is decoded and played, effectively preventing the video data in the encrypted video file from being modified or the technical effect of the video file being pirated, thereby solving the problem that the playback interface and functions provided by the playback tool in the related technology cannot support encrypted video files. The decoding and playing of the video files easily leads to the technical problem that the video files are easily disguised and tampered by hackers because they have not been encrypted.
附图说明Description of drawings
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described here are used to provide a further understanding of the present invention and constitute a part of the application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations to the present invention. In the attached picture:
图1是本发明实施例的一种播放视频数据流的方法的计算机终端的硬件结构框图;Fig. 1 is a block diagram of the hardware structure of a computer terminal of a method for playing a video data stream according to an embodiment of the present invention;
图2是根据本发明实施例的播放视频数据流的方法的流程图;Fig. 2 is the flow chart of the method for playing video data stream according to the embodiment of the present invention;
图3是根据本发明优选实施例的播放视频数据流的方法的流程图;Fig. 3 is the flowchart of the method for playing video data stream according to the preferred embodiment of the present invention;
图4是根据本发明实施例的播放视频数据流的装置的结构框图;Fig. 4 is a structural block diagram of a device for playing video data streams according to an embodiment of the present invention;
图5是根据本发明优选实施例的播放视频数据流的装置的结构框图;Fig. 5 is a structural block diagram of a device for playing video data streams according to a preferred embodiment of the present invention;
图6是根据本发明实施例的用于播放视频数据流的服务器与客户端进行信息交互的示意图;6 is a schematic diagram of information interaction between a server and a client for playing video data streams according to an embodiment of the present invention;
图7是根据本发明实施例的一种计算机终端的结构框图。Fig. 7 is a structural block diagram of a computer terminal according to an embodiment of the present invention.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only It is an embodiment of a part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the description and claims of the present invention and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the invention described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.
本发明所涉及到的名词解释如下:The terms involved in the present invention are explained as follows:
(1)快进动态图像专家组(fast forward moving picture experts group,简称为ffmpeg)是一种开源的音视频解码库,其可以用来记录、转换数字音频/视频。ffmpeg包含了非常先进的音频/视频编解码库,可以在多种操作系统环境中编译运行。(1) The fast forward moving picture experts group (ffmpeg for short) is an open source audio and video decoding library, which can be used to record and convert digital audio/video. ffmpeg contains a very advanced audio/video codec library, which can be compiled and run in a variety of operating system environments.
(2)回调函数是指一个通过函数指针调用的函数,如果将一个函数的指针(地址)作为参数传递给另外一个函数,在特定的事件或条件发生时,由另外一个函数进行调用,用于对该事件或条件进行响应。(2) The callback function refers to a function called through a function pointer. If a function pointer (address) is passed as a parameter to another function, when a specific event or condition occurs, another function will call it. Respond to the event or condition.
(3)重定向是指从原本应该执行的函数跳转到用户自定义提供的函数。(3) Redirection refers to jumping from the function that should be executed to the function provided by the user.
(4)读取接口负责读取待解密的视频数据流,并将该视频数据流重定向到预先设定的回调函数中。(4) The reading interface is responsible for reading the video data stream to be decrypted, and redirecting the video data stream to a preset callback function.
(5)组装是指在将原始视频数据流划分为多个数据块并分别对每个数据块执行用户设定的一系列操作后,重新组合成新的视频数据流。(5) Assembling refers to recombining the original video data stream into a new video data stream after dividing the original video data stream into multiple data blocks and performing a series of operations set by the user on each data block.
实施例1Example 1
根据本发明实施例,还提供了一种播放视频数据流的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present invention, an embodiment of a method for playing a video data stream is also provided. It should be noted that the steps shown in the flow chart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, Also, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown or described herein.
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,图1是本发明实施例的一种播放视频数据流的方法的计算机终端的硬件结构框图。如图1所示,计算机终端10可以包括一个或多个(图中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输装置106。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiment provided in Embodiment 1 of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking running on a computer terminal as an example, FIG. 1 is a block diagram of a hardware structure of a computer terminal according to a method for playing a video data stream according to an embodiment of the present invention. As shown in Figure 1, the computer terminal 10 may include one or more (only one is shown in the figure) processors 102 (the processors 102 may include but not limited to processing devices such as microprocessor MCU or programmable logic device FPGA, etc.) , a memory 104 for storing data, and a transmission device 106 for communication functions. Those of ordinary skill in the art can understand that the structure shown in FIG. 1 is only a schematic diagram, and it does not limit the structure of the above-mentioned electronic device. For example, computer terminal 10 may also include more or fewer components than shown in FIG. 1 , or have a different configuration than that shown in FIG. 1 .
存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的播放视频数据流的方法对应的程序指令/模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的播放视频数据流的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store software programs and modules of application software, such as program instructions/modules corresponding to the method for playing video data streams in the embodiment of the present invention, and the processor 102 runs the software programs and modules stored in the memory 104, thereby Execute various functional applications and data processing, that is, realize the above-mentioned method for playing video data streams. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory that is remotely located relative to the processor 102 , and these remote memories may be connected to the computer terminal 10 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Rad ioFrequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。The transmission device 106 is used to receive or transmit data via a network. The specific example of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal 10 . In one example, the transmission device 106 includes a network interface controller (NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (Radio Frequency, RF for short) module, which is used to communicate with the Internet in a wireless manner.
在上述运行环境下,本申请提供了如图2所示的播放视频数据流的方法。图2是根据本发明实施例的播放视频数据流的方法的流程图。如图2所示,该方法可以包括以下处理步骤:Under the above operating environment, the present application provides a method for playing video data stream as shown in FIG. 2 . Fig. 2 is a flowchart of a method for playing a video data stream according to an embodiment of the present invention. As shown in Figure 2, the method may include the following processing steps:
步骤S22:获取待解密的视频数据流;Step S22: Obtain the video data stream to be decrypted;
步骤S24:根据与待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理;Step S24: Decrypt the video data stream to be decrypted according to the decryption method corresponding to the encryption method adopted by the video data stream to be decrypted;
需要说明的是,本发明并不对上述加密方式做出具体限定,此处仅列举以下几种适用于本发明实施例的解密方式:It should be noted that the present invention does not specifically limit the above-mentioned encryption methods, and only the following decryption methods applicable to the embodiments of the present invention are listed here:
方式一、此种方式最为简便,即按照预设长度为单位(例如:以字节为单位,以视频帧为单位)将原始的视频数据流划分为多个数据块,然后,再对多个数据块中的每个数据块进行逐个单位数据块的加密处理。被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来。Method 1, this method is the most convenient, that is, the original video data stream is divided into multiple data blocks according to the preset length (for example: in bytes, in video frames), and then multiple Each data block in the data block is encrypted on a unit data block basis. The encrypted video file is no longer a standard analyzable video file after being encrypted, but is saved as ciphertext data.
方式二、采用对称加密算法对整个原始的视频数据流进行加密,对称加密算法是应用较早的加密算法,技术成熟。在对称加密算法中,数据发送方可以将明文(原始数据)和加密密钥一起经过特殊加密算法处理后,使其变成复杂的加密密文发送出去。接收方在接收到加密密文后,若想解读原文,则需要使用经过加密处理的密钥及相同算法的逆算法对密文进行解密,才能使其恢复成可读明文。在对称加密算法中,使用的密钥只有一个,发送方和接收方都使用这个密钥对数据进行加密和解密,这就要求解密方事先必须知道加密密钥。对称加密算法的特点是算法公开、计算量小、加密速度快、加密效率高。被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来。Method 2: Use a symmetric encryption algorithm to encrypt the entire original video data stream. The symmetric encryption algorithm is an earlier encryption algorithm with mature technology. In the symmetric encryption algorithm, the data sender can process the plaintext (original data) and the encryption key together with a special encryption algorithm to turn it into a complex encrypted ciphertext and send it out. After receiving the encrypted ciphertext, if the receiver wants to interpret the original text, it needs to use the encrypted key and the inverse algorithm of the same algorithm to decrypt the ciphertext to restore it to readable plaintext. In the symmetric encryption algorithm, only one key is used, and both the sender and the receiver use this key to encrypt and decrypt data, which requires the decryption party to know the encryption key in advance. Symmetric encryption algorithm is characterized by open algorithm, small amount of calculation, fast encryption speed and high encryption efficiency. The encrypted video file is no longer a standard analyzable video file after being encrypted, but is saved as ciphertext data.
方式三、结合上述方式一和方式二所提供的加密方式,首先按照预设长度为单位(例如:以字节为单位,以视频帧为单位)将原始的视频数据流划分为多个数据块;其次,对多个数据块中的每个数据块进行逐个单位数据块的加密处理;然后,再采用高强度的对称加密算法对按照单位数据块逐个进行加密后构成的整体视频数据流进行对称加密。被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来。Method 3. Combining the encryption methods provided by the above method 1 and method 2, first divide the original video data stream into multiple data blocks according to the preset length (for example: in bytes, in video frames) ;Secondly, each data block in the plurality of data blocks is encrypted one by one unit data blocks; then, a high-strength symmetric encryption algorithm is used to perform symmetrical encryption on the overall video data stream formed after the unit data blocks are encrypted one by one encryption. The encrypted video file is no longer a standard analyzable video file after being encrypted, but is saved as ciphertext data.
方式四、在方式三的基础上对每个单位数据块加入不同的数字水印(DigitalWatermarking)。数字水印是指嵌入数字载体(包括:多媒体、文档、软件等)中的数字信号,其可以是图像、文字、符号、数字等所有可以作为标识的信息。数字水印既不影响原始载体的正常使用及存在价值,也不容易被人感知。数字水印通过特定的算法将一些标志性信息直接嵌入到多媒体内容当中,但不影响原内容的价值和使用,并且不能被人的知觉系统觉察或注意到,只有通过专用的检测器或阅读器才能提取,其中的水印信息可以是视频文件作者的序列号、视频文件提供商的标志、有特殊意义的文本等,可用来识别文件、图像或音乐制品的来源、版本、原作者、拥有者、发行人、合法使用人对数字产品的拥有权。通过检测加入到每个单位数据块中的数字水印来确定原始视频数据流的完整性以及版权进行校验。Method 4: Add different digital watermarks (Digital Watermarking) to each unit data block on the basis of method 3. Digital watermarks refer to digital signals embedded in digital carriers (including: multimedia, documents, software, etc.), which can be images, texts, symbols, numbers and other information that can be used as identification. Digital watermark neither affects the normal use and existence value of the original carrier, nor is it easy to be perceived by people. Digital watermarking embeds some iconic information directly into multimedia content through a specific algorithm, but does not affect the value and use of the original content, and cannot be perceived or noticed by the human perception system, only through a dedicated detector or reader. Extraction, where the watermark information can be the serial number of the author of the video file, the logo of the video file provider, text with special meaning, etc., which can be used to identify the source, version, original author, owner, distribution of the file, image or music product Ownership of digital products by people and legal users. The integrity of the original video data stream and the copyright are verified by detecting the digital watermark added to each unit data block.
步骤S26:将处理后的视频数据流发送至与视频格式对应的解码代码进行播放。Step S26: Send the processed video data stream to the decoding code corresponding to the video format for playing.
在优选实施过程中,上述与视频格式对应的解码代码可以包括但不限于:ffmpeg。In a preferred implementation process, the aforementioned decoding code corresponding to the video format may include but not limited to: ffmpeg.
在通常的视频解码播放过程中,avi,mkv,rmvb,mov,mp4等视频格式被称为容器(Container),不同的容器格式规定了其中视频/音频数据的组织方式(当然也包括其他数据,例如:字幕)。容器中通常会封装有视频和音频轨,又被称为视频流(stream)和音频流,播放视频文件首先需要根据视频文件的格式,解析(demux)出其中封装的视频流、音频流以及字幕(可选项),解析的数据读到包(packet)中,每个包内保存的是视频帧(frame)或音频帧,然后分别对视频帧和音频帧调用相应的解码器(decoder)进行解码,例如:使用H.264编码的视频和MP3编码的音频,便会调用相应的H.264解码器和MP3解码器,解码之后得到的便是原始的图像(YUV or RGB)和声音(PCM)数据,然后按照时间同步将图像显示到屏幕上以及将声音输出到声卡。In the usual video decoding and playing process, video formats such as avi, mkv, rmvb, mov, mp4 are called containers (Container), and different container formats specify the organization of video/audio data (including other data, of course, For example: subtitles). There are usually video and audio tracks encapsulated in the container, also known as video stream (stream) and audio stream. To play a video file, you first need to parse (demux) the encapsulated video stream, audio stream and subtitles according to the format of the video file. (Optional), the parsed data is read into the packet, and each packet stores a video frame (frame) or audio frame, and then calls the corresponding decoder (decoder) to decode the video frame and audio frame respectively , For example: using H.264 encoded video and MP3 encoded audio, the corresponding H.264 decoder and MP3 decoder will be called, and the original image (YUV or RGB) and sound (PCM) will be obtained after decoding data, and then display the image on the screen and output the sound to the sound card according to the time synchronization.
具体到ffmpeg的视频数据流解码和播放流程,ffmpeg在获取到处理后的视频数据流之后,将处理后的视频数据流送入媒体格式解码器(demuxer)中去除媒体格式;其次,送入ffmpeg的decode中进行解码,生成待显示的YUV格式的图片,然后再送入简易直控媒体层(Simple DirectMedia Layer,简称为SDL)中进行渲染。SDL是一套开放源代码的跨平台多媒体开发库,使用C语言写成。SDL提供了多种控制图像、声音、输出入的函数,使得开发者只要使用相同或是相似的代码便可以开发出跨多个平台(Linux、Windows、Mac OS X等)的应用软件。目前SDL多用于开发游戏、模拟器、媒体播放器等多媒体应用领域。SDL渲染过程主要包括如下步骤:Specific to the video data stream decoding and playback process of ffmpeg, after ffmpeg obtains the processed video data stream, it sends the processed video data stream to the media format decoder (demuxer) to remove the media format; secondly, sends it to ffmpeg Decode in the decode to generate a picture in YUV format to be displayed, and then send it to the Simple Direct Media Layer (Simple DirectMedia Layer, referred to as SDL) for rendering. SDL is an open source cross-platform multimedia development library written in C language. SDL provides a variety of functions to control images, sounds, and input and output, so that developers can develop application software across multiple platforms (Linux, Windows, Mac OS X, etc.) as long as they use the same or similar codes. At present, SDL is mostly used in the development of multimedia applications such as games, emulators, and media players. The SDL rendering process mainly includes the following steps:
第一步、使用SDL_CreateWindow()创建一个用于视频播放的窗口。The first step is to use SDL_CreateWindow() to create a window for video playback.
第二步、使用SDL_CreateRenderer()基于窗口创建渲染器。The second step is to use SDL_CreateRenderer() to create a renderer based on the window.
第三步、使用SDL_CreateTexture()基于渲染器创建一个纹理。The third step is to use SDL_CreateTexture() to create a texture based on the renderer.
第四步、使用SDL_UpdateTexture()设置纹理的像素数据。The fourth step is to use SDL_UpdateTexture() to set the pixel data of the texture.
第五步、使用SDL_RenderCopy()将纹理数据复制给渲染目标。在使用SDL_RenderCopy()之前,可以使用SDL_RenderClear()先使用清空渲染目标。实际上视频播放的时候不使用SDL_RenderClear()也是可以的,因为视频数据流的后一帧图像会完全覆盖前一帧图像。The fifth step, use SDL_RenderCopy() to copy the texture data to the render target. SDL_RenderClear() can be used to clear the render target before using SDL_RenderCopy(). In fact, it is also possible not to use SDL_RenderClear() when the video is playing, because the next frame of the video data stream will completely cover the previous frame.
第六步、使用SDL_RenderPresent()显示画面。The sixth step, use SDL_RenderPresent () to display the picture.
其中,SDL_Window是使用SDL的时候所弹出的窗口,在SDL1.x版本中,只可以创建一个一个窗口,在SDL2.0版本中,可以创建多个窗口;SDL_Texture用于显示YUV数据;一个SDL_Texture对应一帧YUV数据;SDL_Renderer用于渲染SDL_Texture至SDL_Window;SDL_Rect用于确定SDL_Texture显示的位置。Among them, SDL_Window is the window that pops up when using SDL. In SDL1.x version, only one window can be created. In SDL2.0 version, multiple windows can be created; SDL_Texture is used to display YUV data; one SDL_Texture corresponds to One frame of YUV data; SDL_Renderer is used to render SDL_Texture to SDL_Window; SDL_Rect is used to determine the position where SDL_Texture is displayed.
相关技术中,基于ffmpeg组件开发的视频播放器无法对加密视频文件进行解码和播放,由此易导致发送至ffmpeg的视频文件中的视频数据被篡改或者视频文件被盗版。采用如图2所示的方法实施例,在ffmpeg的播放接口基础上扩展出了解密功能,其能够针对定制化的加密视频文件进行解码和播放,从而有效地防止发送至ffmpeg的视频文件中的视频数据被篡改或者视频文件被盗版,进而实现了在将一个原始的可直接进行播放的视频文件进行加密后,使用基于ffmpeg开发的播放器能够对该加密视频文件进行解密,解码和渲染。In related technologies, video players developed based on ffmpeg components cannot decode and play encrypted video files, which may easily lead to tampering of video data in video files sent to ffmpeg or piracy of video files. Using the method embodiment shown in Figure 2, the decryption function is extended on the basis of the playback interface of ffmpeg, which can decode and play customized encrypted video files, thereby effectively preventing the video files sent to ffmpeg from The video data is tampered with or the video file is pirated, so that after encrypting an original video file that can be played directly, the encrypted video file can be decrypted, decoded and rendered using a player developed based on ffmpeg.
可选地,在步骤S22中,获取待解密的视频数据流可以包括以下执行步骤:Optionally, in step S22, obtaining the video data stream to be decrypted may include the following execution steps:
步骤S222:注册视频数据流读取接口;Step S222: Register the video data stream reading interface;
步骤S224:采用视频数据流读取接口对待解密的视频数据流进行重定向,获取待解密的视频数据流。Step S224: Using the video data stream reading interface to redirect the video data stream to be decrypted, and obtain the video data stream to be decrypted.
在优选实施过程中,可以通过与视频格式对应的解码代码提供的回调函数接口向与视频格式对应的解码代码来完成上述步骤S222中的注册视频数据流读取接口的操作。In a preferred implementation process, the operation of registering the video data stream reading interface in step S222 can be completed to the decoding code corresponding to the video format through the callback function interface provided by the decoding code corresponding to the video format.
考虑到基于ffmpeg组件开发的播放器不支持对加密视频文件的解码和播放,因此,如果已经对原始视频数据流进行过加密,那么将不能直接将加密视频数据流发送至ffmpeg进行解码和播放。为此,如果需要实现加密视频数据流在ffmpeg进行解码和播放,则需要在对加密视频数据流进行解码和播放前,先通过ffmpeg提供的接口将读取加密视频数据流的动作重定向到预先设定的回调函数中,并在回调函数中完成对加密视频数据流的读取操作与解密操作。Considering that the player developed based on the ffmpeg component does not support the decoding and playback of encrypted video files, if the original video data stream has been encrypted, the encrypted video data stream cannot be directly sent to ffmpeg for decoding and playback. For this reason, if it is necessary to decode and play the encrypted video data stream in ffmpeg, before decoding and playing the encrypted video data stream, the action of reading the encrypted video data stream needs to be redirected to the pre- In the callback function set, and complete the read operation and decryption operation of the encrypted video data stream in the callback function.
具体地,ffmpeg提供了一个接口avio_alloc_context,其中,可以设置在ffmpeg需要读取视频流的时候调用read_packet回调函数,在ffmpeg需要写入视频流的时候调用write_packet回调函数以及在ffmpeg需要播放渲染进度跳转的时候来调用seek回调函数。Specifically, ffmpeg provides an interface avio_alloc_context, which can be set to call the read_packet callback function when ffmpeg needs to read the video stream, call the write_packet callback function when ffmpeg needs to write the video stream, and jump when ffmpeg needs to play the rendering progress When the seek callback function is called.
在优选实施过程中,可以仅设置read_packet和write_packet两个回调函数,将这两个回调函数设置为自定义提供的视频读取和视频进度跳转函数,这样ffmpeg在需要获取视频流并且需要执行进度跳转时便会改为调用自定义提供的函数,进而通过在自定义的回调函数中,获取加密过的视频流,并在内存中解密后再传递给ffmpeg进行播放渲染,从而实现在ffmpeg初始化过程中,通过调用ffmpeg提供的回调函数avio_alloc_context接口来注册自定义的read_packet接口,以实现将读取加密视频数据流的动作重定向到预先设定的回调函数中。In the preferred implementation process, you can only set the two callback functions read_packet and write_packet, and set these two callback functions as the video reading and video progress jump functions provided by the custom, so that ffmpeg needs to obtain the video stream and execute the progress When jumping, it will instead call the function provided by the user-defined, and then obtain the encrypted video stream in the user-defined callback function, and decrypt it in memory before passing it to ffmpeg for playback and rendering, so as to achieve initialization in ffmpeg During the process, the custom read_packet interface is registered by calling the callback function avio_alloc_context interface provided by ffmpeg, so as to redirect the action of reading the encrypted video data stream to the preset callback function.
可选地,当加密方式为按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法对多个数据块逐一进行加密,再采用第二加密算法对加密后的多个数据块进行整体加密时,在步骤S24中,根据解密方式对待解密的视频数据流进行解密处理可以包括执行步骤:Optionally, when the encryption method is to divide the original video data stream into multiple data blocks according to the preset length and use the first encryption algorithm to encrypt the multiple data blocks one by one, and then use the second encryption algorithm to encrypt the encrypted When a plurality of data blocks are encrypted as a whole, in step S24, decrypting the video data stream to be decrypted according to the decryption method may include the following steps:
步骤S241:通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;Step S241: Decrypt multiple encrypted data blocks from the video data stream to be decrypted by using a decryption algorithm matching the second encryption algorithm;
步骤S242:通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;Step S242: Decrypt multiple data blocks from the encrypted multiple data blocks by using a decryption algorithm that matches the first encryption algorithm;
步骤S243:对多个数据块进行组装,得到处理后的视频数据流。Step S243: Assemble multiple data blocks to obtain a processed video data stream.
当加密方式为按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,由于被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来,因此,在获取到待解密的视频数据流后,首先,需要采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块;其次,采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块;然后,再通过对解密出的多个数据块进行组装,最终得到准备在ffmpeg进行解码和播放的原始视频数据流。When the encryption method is to divide the original video data stream into multiple data blocks according to the preset length and adopt the first encryption algorithm (encryption algorithm is performed one by one according to the division unit) to encrypt the multiple data blocks one by one, and then use the second encryption When the algorithm (high-strength symmetric encryption algorithm) encrypts multiple encrypted data blocks as a whole, since the encrypted video file is no longer a standard analyzable video file after encryption processing, it is data in ciphertext Therefore, after obtaining the video data stream to be decrypted, first of all, it is necessary to use a decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) to crack the above-mentioned overall encryption process, from the video to be decrypted In the data stream, multiple encrypted data blocks obtained by using the first encryption algorithm are decrypted; secondly, a decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) is used to decrypt the encrypted multiple data blocks one by one. The decryption operation of the unit data block obtains multiple data blocks that have not been encrypted; then, by assembling the decrypted multiple data blocks, the original video data stream ready to be decoded and played by ffmpeg is finally obtained.
可选地,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法对加密后的多个数据块进行整体加密时,在步骤S24中,根据解密方式对待解密的视频数据流进行解密处理可以包括以下执行步骤:Optionally, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, use the first encryption algorithm to encrypt the multiple data blocks one by one and add digital watermarks to the multiple data blocks one by one , when the second encryption algorithm is used to encrypt the encrypted multiple data blocks as a whole, in step S24, decrypting the video data stream to be decrypted according to the decryption method may include the following steps:
步骤S244:通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;Step S244: Decrypt multiple encrypted data blocks from the video data stream to be decrypted by using a decryption algorithm matching the second encryption algorithm;
步骤S245:通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;Step S245: Decrypt multiple data blocks from the encrypted multiple data blocks by using a decryption algorithm that matches the first encryption algorithm;
步骤S246:通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验;Step S246: Perform data integrity check on multiple data blocks by adding digital watermarks to each of the multiple data blocks one by one;
步骤S247:在数据完整性校验成功后,对多个数据块进行组装,得到处理后的视频数据流。Step S247: After the data integrity check is successful, assemble multiple data blocks to obtain a processed video data stream.
当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,由于被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来,因此,在获取到待解密的视频数据流后,首先,需要采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块;其次,采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块;然后,通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验,即通过添加数字水印来确保原始视频数据流的完整性与准确性;最后,再通过对解密出的多个数据块进行组装,最终得到准备在ffmpeg进行解码和播放的原始视频数据流。When the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, adopt the first encryption algorithm (encrypt algorithm one by one according to the division unit) to encrypt the multiple data blocks one by one and encrypt the multiple data blocks one by one. When the digital watermark is added one by one, and then the second encryption algorithm (high-strength symmetric encryption algorithm) is used to encrypt the encrypted multiple data blocks as a whole, the encrypted video file is no longer a standard analyzable file after encryption processing. The video file is stored in ciphertext data. Therefore, after obtaining the video data stream to be decrypted, first, it is necessary to use a decryption algorithm that is reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) for the above-mentioned The overall encryption process is cracked, and multiple encrypted data blocks obtained by using the first encryption algorithm are decrypted from the video data stream to be decrypted; secondly, the decryption that is reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) is used The algorithm decrypts the encrypted multiple data blocks one by one unit data blocks to obtain multiple data blocks that have not been encrypted; then, through the digital watermark added to each data block in the multiple data blocks Perform data integrity verification, that is, add digital watermarks to ensure the integrity and accuracy of the original video data stream; finally, by assembling the decrypted multiple data blocks, finally get the video that is ready to be decoded and played in ffmpeg Raw video data stream.
可选地,在步骤S22,获取待解密的视频数据流之后,还可以包括以下执行步骤:Optionally, in step S22, after obtaining the video data stream to be decrypted, the following execution steps may also be included:
步骤S23:请求创建内存空间,其中,内存空间用于存储待解密的视频数据流以及存储待解密的视频数据流进行解密处理过程中得到的中间数据。Step S23: request to create a memory space, wherein the memory space is used to store the video data stream to be decrypted and store the intermediate data obtained during the decryption process of the video data stream to be decrypted.
在获取到待解密的视频数据流之后,首先,需要在内存中请求开辟一块存储空间对待解密的视频数据流进行存储;其次,基于上述分析,当加密方式为按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,在采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块以及采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块都可以作为中间数据暂存于新开辟的存储空间内;然后,在该存储空间内通过对解密出的多个数据块进行组装,最终得到可以被ffmpeg正确解析和执行的原始视频数据流;或者,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块以及采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块都可以作为中间数据暂存于新开辟的存储空间内;然后,通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验,即通过添加数字水印来确保原始视频数据流的完整性与准确性;最后,再通过对解密出的多个数据块进行组装,最终得到可以被ffmpeg正确解析和执行的原始视频数据流。After obtaining the video data stream to be decrypted, first of all, it is necessary to request a storage space in the memory to store the video data stream to be decrypted; secondly, based on the above analysis, when the encryption method is to convert the original video in units of preset length The data stream is divided into multiple data blocks and the first encryption algorithm (encryption algorithm is performed one by one according to the division unit) is used to encrypt multiple data blocks one by one, and then the second encryption algorithm (high-strength symmetric encryption algorithm) is used to encrypt the encrypted data. When a data block is encrypted as a whole, the above-mentioned overall encryption process is cracked by using a decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm), and the first encryption algorithm is used to decrypt the video data stream to be decrypted. The obtained encrypted multiple data blocks and the decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) are used to perform unit data block-by-unit decryption operations on the encrypted multiple data blocks, and the unencrypted multiple data blocks are obtained. Each data block can be temporarily stored in the newly opened storage space as intermediate data; then, by assembling the decrypted multiple data blocks in the storage space, the original video data that can be correctly parsed and executed by ffmpeg is finally obtained Or, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, adopt the first encryption algorithm (encrypt algorithm one by one according to the division unit) to encrypt the multiple data blocks one by one and then Add digital watermarks to multiple data blocks one by one, and then use the second encryption algorithm (high-strength symmetric encryption algorithm) to encrypt the encrypted multiple data blocks as a whole. The reverse decryption algorithm cracks the above-mentioned overall encryption process, and decrypts the encrypted multiple data blocks obtained by the first encryption algorithm from the video data stream to be decrypted, and uses the second encryption algorithm (high-strength symmetric encryption algorithm) The reciprocal decryption algorithm performs the decryption operation on the encrypted multiple data blocks one by one, and the unencrypted multiple data blocks can be temporarily stored in the newly opened storage space as intermediate data; The digital watermark added to each data block in multiple data blocks performs data integrity verification on multiple data blocks, that is, by adding digital watermarks to ensure the integrity and accuracy of the original video data stream; finally, by decrypting the output Assembled multiple data blocks, and finally get the original video data stream that can be correctly parsed and executed by ffmpeg.
需要说明的是,在整个视频播放过程中,除了需要在内存中短暂生成过被划分的原始视频数据流的多个数据块(这些数据块不再是标准的视频数据流,而是以内存数据块的方式存在)之外,不会在其他任何地方出现与原始视频数据流相关的数据,即不会在内存中或磁盘文件中出现完整的原始视频数据流,由此确保了加密视频数据流的安全性。It should be noted that, during the entire video playback process, in addition to the need to briefly generate multiple data blocks of the divided original video data stream in the memory (these data blocks are no longer standard video data streams, but in the form of memory data Existing in the form of blocks), data related to the original video data stream will not appear anywhere else, that is, the complete original video data stream will not appear in the memory or in the disk file, thus ensuring the encrypted video data stream security.
下面将结合图3所示的优选实施方式对上述优选实施过程做进一步地描述。The above preferred implementation process will be further described below in conjunction with the preferred implementation manner shown in FIG. 3 .
图3是根据本发明优选实施例的播放视频数据流的方法的流程图。如图3所示,该流程可以包括以下处理步骤:Fig. 3 is a flowchart of a method for playing a video data stream according to a preferred embodiment of the present invention. As shown in Figure 3, the process may include the following processing steps:
步骤S32:由于需要实现加密视频数据流在ffmpeg进行解码和播放,则需要在对加密视频数据流进行解码和播放前,先通过ffmpeg提供的接口将读取加密视频数据流的动作重定向到预先设定的回调函数中,并在回调函数中完成对加密视频数据流的读取操作与解密操作。Step S32: Since the encrypted video data stream needs to be decoded and played by ffmpeg, before the encrypted video data stream is decoded and played, the action of reading the encrypted video data stream needs to be redirected to the pre-installed interface through the interface provided by ffmpeg. In the callback function set, and complete the read operation and decryption operation of the encrypted video data stream in the callback function.
在优选实施过程中,可以在ffmpeg初始化过程中,通过调用ffmpeg提供的回调函数avio_alloc_context接口来注册自定义的read_packet接口,以实现将读取加密视频数据流的动作重定向到预先设定的回调函数中。In the preferred implementation process, the custom read_packet interface can be registered by calling the callback function avio_alloc_context interface provided by ffmpeg during the initialization process of ffmpeg, so as to redirect the action of reading the encrypted video data stream to the preset callback function middle.
步骤S34:在获取到待解密的视频数据流之后,首先,需要在内存中请求开辟一块存储空间对待解密的视频数据流进行存储;其次,根据待解密的视频数据流所采用的加密方式确定在使用与该加密方式互逆的解密方式进行解密的过程中产生的中间数据也将存储于该存储空间内。Step S34: After obtaining the video data stream to be decrypted, first, it is necessary to request a storage space in the memory to store the video data stream to be decrypted; secondly, according to the encryption method adopted by the video data stream to be decrypted, determine the The intermediate data generated during the decryption process using the decryption method reciprocal to the encryption method will also be stored in the storage space.
例如:当加密方式为按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,在采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块以及采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块都可以作为中间数据暂存于新开辟的存储空间内;然后,在该存储空间内通过对解密出的多个数据块进行组装,最终得到可以被ffmpeg正确解析和执行的原始视频数据流;For example: when the encryption method is to divide the original video data stream into multiple data blocks according to the preset length and adopt the first encryption algorithm (encrypt the algorithm one by one according to the division unit) to encrypt the multiple data blocks one by one, then use the second When the second encryption algorithm (high-strength symmetric encryption algorithm) encrypts multiple encrypted data blocks as a whole, the above-mentioned overall encryption process is cracked by using a decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm), From the video data stream to be decrypted, a plurality of encrypted data blocks obtained by using the first encryption algorithm are decrypted, and a plurality of encrypted data blocks are encrypted by a decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm). The block is decrypted one by one, and the unencrypted multiple data blocks can be temporarily stored in the newly opened storage space as intermediate data; then, in the storage space, the decrypted multiple data blocks are Assemble, and finally get the original video data stream that can be correctly parsed and executed by ffmpeg;
或者,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块以及采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块都可以作为中间数据暂存于新开辟的存储空间内;然后,通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验,即通过添加数字水印来确保原始视频数据流的完整性与准确性;最后,再通过对解密出的多个数据块进行组装,最终得到可以被ffmpeg正确解析和执行的原始视频数据流。Or, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, adopt the first encryption algorithm (encrypt the algorithm one by one according to the division unit) to encrypt the multiple data blocks one by one and encrypt the multiple data blocks one by one. Add digital watermarks to each data block one by one, and then use the second encryption algorithm (high-strength symmetric encryption algorithm) to encrypt multiple encrypted data blocks as a whole, use the reciprocal method of the second encryption algorithm (high-strength symmetric encryption algorithm) The decryption algorithm cracks the above-mentioned overall encryption process, decrypts multiple encrypted data blocks obtained by the first encryption algorithm from the video data stream to be decrypted, and uses the reciprocal encryption algorithm with the second encryption algorithm (high-strength symmetric encryption algorithm) The decryption algorithm performs the decryption operation on the encrypted multiple data blocks one by one, and the unencrypted multiple data blocks can be temporarily stored in the newly opened storage space as intermediate data; The digital watermark added to each data block in the data block performs data integrity verification on multiple data blocks, that is, by adding digital watermarks to ensure the integrity and accuracy of the original video data stream; A data block is assembled, and finally the original video data stream that can be correctly parsed and executed by ffmpeg is obtained.
步骤S36:利用与待解密的视频数据流所采用的加密方式互逆的解密方式对待解密的视频数据流进行解密处理。Step S36: Decrypt the video data stream to be decrypted by using a decryption method that is reciprocal to the encryption method adopted by the video data stream to be decrypted.
具体地,当加密方式为按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,由于被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来,因此,在获取到待解密的视频数据流后,首先,需要采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块;其次,采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块;然后,再通过对解密出的多个数据块进行组装,最终得到准备在ffmpeg进行解码和播放的原始视频数据流。Specifically, when the encryption method is to divide the original video data stream into multiple data blocks according to the preset length and adopt the first encryption algorithm (the encryption algorithm is performed one by one according to the division unit) to encrypt the multiple data blocks one by one, and then use When the second encryption algorithm (high-strength symmetric encryption algorithm) encrypts multiple encrypted data blocks as a whole, since the encrypted video file is no longer a standard analysable video file after encryption processing, but encrypted Therefore, after obtaining the video data stream to be decrypted, first, it is necessary to use a decryption algorithm that is reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) to crack the above-mentioned overall encryption process. In the decrypted video data stream, a plurality of encrypted data blocks obtained by using the first encryption algorithm are decrypted; secondly, a plurality of encrypted data blocks are encrypted using a decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm). The block is decrypted unit by block to obtain multiple data blocks that have not been encrypted; then, by assembling the decrypted multiple data blocks, the original video data stream ready to be decoded and played by ffmpeg is finally obtained.
具体地,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,由于被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来,因此,在获取到待解密的视频数据流后,首先,需要采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块;其次,采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块;然后,通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验,即通过添加数字水印来确保原始视频数据流的完整性与准确性;最后,再通过对解密出的多个数据块进行组装,最终得到准备在ffmpeg进行解码和播放的原始视频数据流。Specifically, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, the multiple data blocks are encrypted one by one by using the first encryption algorithm (encryption algorithm is performed one by one according to the division unit) and the Add digital watermarks to multiple data blocks one by one, and then use the second encryption algorithm (high-strength symmetric encryption algorithm) to encrypt multiple encrypted data blocks as a whole, because the encrypted video files are no longer standard after being encrypted. Therefore, after obtaining the video data stream to be decrypted, first of all, it is necessary to use a decryption that is reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) The algorithm cracks the above-mentioned overall encryption process, and decrypts multiple encrypted data blocks obtained by the first encryption algorithm from the video data stream to be decrypted; The inverse decryption algorithm performs decryption operations on the encrypted multiple data blocks one by one unit data blocks to obtain multiple data blocks that have not been encrypted; then, through the digital watermark added to each of the multiple data blocks one by one Data integrity check for each data block, that is, by adding digital watermark to ensure the integrity and accuracy of the original video data stream; finally, by assembling the decrypted multiple data blocks, finally get ready to be decoded in ffmpeg and play the original video data stream.
步骤S38:在得到可以被ffmpeg正确解析和执行的视频数据流后,完成对处理后的视频数据流的播放过程。Step S38: After obtaining the video data stream that can be correctly parsed and executed by ffmpeg, complete the playing process of the processed video data stream.
具体地,ffmpeg在获取到处理后的视频数据流之后,将处理后的视频数据流送入媒体格式解码器(demuxer)中去除媒体格式;其次,送入ffmpeg的decode中进行解码,生成待显示的YUV格式的图片,然后再送入简易直控媒体层(Simple DirectMediaLayer,简称为SDL)中进行渲染。Specifically, after ffmpeg obtains the processed video data stream, it sends the processed video data stream to the media format decoder (demuxer) to remove the media format; secondly, it sends it to ffmpeg's decode for decoding, and generates the video data stream to be displayed. The picture in the YUV format is sent to the Simple Direct Media Layer (Simple DirectMediaLayer, referred to as SDL) for rendering.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence. Because of the present invention, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的播放视频数据流的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method for playing a video data stream according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but In many cases the former is the better implementation. Based on such an understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products are stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.
实施例2Example 2
根据本发明实施例,还提供了一种用于实施上述播放视频数据流的装置实施例,图4是根据本发明实施例的播放视频数据流的装置的结构框图。如图4所示,该装置包括:获取模块10,用于获取待解密的视频数据流;处理模块20,用于根据与待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理;发送模块30,用于将处理后的视频数据流发送至与视频格式对应的解码代码进行播放。According to an embodiment of the present invention, an embodiment of an apparatus for playing the video data stream described above is also provided. FIG. 4 is a structural block diagram of an apparatus for playing a video data stream according to an embodiment of the present invention. As shown in Figure 4, the device includes: an acquisition module 10, used to acquire the video data stream to be decrypted; The video data stream is decrypted; the sending module 30 is configured to send the processed video data stream to a decoding code corresponding to the video format for playback.
在优选实施过程中,上述与视频格式对应的解码代码可以包括但不限于:ffmpeg。In a preferred implementation process, the aforementioned decoding code corresponding to the video format may include but not limited to: ffmpeg.
需要说明的是,本发明并不对上述加密方式做出具体限定,此处仅列举以下几种适用于本发明实施例的解密方式:It should be noted that the present invention does not specifically limit the above-mentioned encryption methods, and only the following decryption methods applicable to the embodiments of the present invention are listed here:
方式一、此种方式最为简便,即按照预设长度为单位(例如:以字节为单位,以视频帧为单位)将原始的视频数据流划分为多个数据块,然后,再对多个数据块中的每个数据块进行逐个单位数据块的加密处理。被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来。Method 1, this method is the most convenient, that is, the original video data stream is divided into multiple data blocks according to the preset length (for example: in bytes, in video frames), and then multiple Each data block in the data block is encrypted on a unit data block basis. The encrypted video file is no longer a standard analyzable video file after being encrypted, but is saved as ciphertext data.
方式二、采用对称加密算法对整个原始的视频数据流进行加密,对称加密算法是应用较早的加密算法,技术成熟。在对称加密算法中,数据发送方可以将明文(原始数据)和加密密钥一起经过特殊加密算法处理后,使其变成复杂的加密密文发送出去。接收方在接收到加密密文后,若想解读原文,则需要使用经过加密处理的密钥及相同算法的逆算法对密文进行解密,才能使其恢复成可读明文。在对称加密算法中,使用的密钥只有一个,发送方和接收方都使用这个密钥对数据进行加密和解密,这就要求解密方事先必须知道加密密钥。对称加密算法的特点是算法公开、计算量小、加密速度快、加密效率高。被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来。Method 2: Use a symmetric encryption algorithm to encrypt the entire original video data stream. The symmetric encryption algorithm is an earlier encryption algorithm with mature technology. In the symmetric encryption algorithm, the data sender can process the plaintext (original data) and the encryption key together with a special encryption algorithm to turn it into a complex encrypted ciphertext and send it out. After receiving the encrypted ciphertext, if the receiver wants to interpret the original text, it needs to use the encrypted key and the inverse algorithm of the same algorithm to decrypt the ciphertext to restore it to readable plaintext. In the symmetric encryption algorithm, only one key is used, and both the sender and the receiver use this key to encrypt and decrypt data, which requires the decryption party to know the encryption key in advance. Symmetric encryption algorithm is characterized by open algorithm, small amount of calculation, fast encryption speed and high encryption efficiency. The encrypted video file is no longer a standard analyzable video file after being encrypted, but is saved as ciphertext data.
方式三、结合上述方式一和方式二所提供的加密方式,首先按照预设长度为单位(例如:以字节为单位,以视频帧为单位)将原始的视频数据流划分为多个数据块;其次,对多个数据块中的每个数据块进行逐个单位数据块的加密处理;然后,再采用高强度的对称加密算法对按照单位数据块逐个进行加密后构成的整体视频数据流进行对称加密。被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来。Method 3. Combining the encryption methods provided by the above method 1 and method 2, first divide the original video data stream into multiple data blocks according to the preset length (for example: in bytes, in video frames) ;Secondly, each data block in the plurality of data blocks is encrypted one by one unit data blocks; then, a high-strength symmetric encryption algorithm is used to perform symmetrical encryption on the overall video data stream formed after the unit data blocks are encrypted one by one encryption. The encrypted video file is no longer a standard analyzable video file after being encrypted, but is saved as ciphertext data.
方式四、在方式三的基础上对每个单位数据块加入不同的数字水印(DigitalWatermarking)。数字水印是指嵌入数字载体(包括:多媒体、文档、软件等)中的数字信号,其可以是图像、文字、符号、数字等所有可以作为标识的信息。数字水印既不影响原始载体的正常使用及存在价值,也不容易被人感知。数字水印通过特定的算法将一些标志性信息直接嵌入到多媒体内容当中,但不影响原内容的价值和使用,并且不能被人的知觉系统觉察或注意到,只有通过专用的检测器或阅读器才能提取,其中的水印信息可以是视频文件作者的序列号、视频文件提供商的标志、有特殊意义的文本等,可用来识别文件、图像或音乐制品的来源、版本、原作者、拥有者、发行人、合法使用人对数字产品的拥有权。通过检测加入到每个单位数据块中的数字水印来确定原始视频数据流的完整性以及版权进行校验。Method 4: Add different digital watermarks (Digital Watermarking) to each unit data block on the basis of method 3. Digital watermarks refer to digital signals embedded in digital carriers (including: multimedia, documents, software, etc.), which can be images, texts, symbols, numbers and other information that can be used as identification. Digital watermark neither affects the normal use and existence value of the original carrier, nor is it easy to be perceived by people. Digital watermarking embeds some iconic information directly into multimedia content through a specific algorithm, but does not affect the value and use of the original content, and cannot be perceived or noticed by the human perception system, only through a dedicated detector or reader. Extraction, where the watermark information can be the serial number of the author of the video file, the logo of the video file provider, text with special meaning, etc., which can be used to identify the source, version, original author, owner, distribution of the file, image or music product Ownership of digital products by people and legal users. The integrity of the original video data stream and the copyright are verified by detecting the digital watermark added to each unit data block.
相关技术中,基于ffmpeg组件开发的视频播放器无法对加密视频文件进行解码和播放,由此易导致发送至ffmpeg的视频文件中的视频数据被篡改或者视频文件被盗版。采用如图4所示的装置实施例,在播放接口基础上扩展出了解密功能,其能够针对定制化的加密视频文件进行解码和播放,从而有效地防止发送至与视频格式对应的解码代码的视频文件中的视频数据被篡改或者视频文件被盗版,进而实现了在将一个原始的可直接进行播放的视频文件进行加密后,使得播放器能够对该加密视频文件进行解密,解码和渲染。In related technologies, video players developed based on ffmpeg components cannot decode and play encrypted video files, which may easily lead to tampering of video data in video files sent to ffmpeg or piracy of video files. Using the device embodiment shown in Figure 4, the decryption function is extended on the basis of the playback interface, which can decode and play customized encrypted video files, thereby effectively preventing the The video data in the video file is tampered with or the video file is pirated, so that after an original video file that can be directly played is encrypted, the player can decrypt, decode and render the encrypted video file.
可选地,图5是根据本发明优选实施例的播放视频数据流的装置的结构框图。如图5所示,获取模块10可以包括:注册单元100,用于注册视频数据流读取接口;获取单元102,用于采用视频数据流读取接口对待解密的视频数据流进行重定向,获取待解密的视频数据流。Optionally, FIG. 5 is a structural block diagram of an apparatus for playing video data streams according to a preferred embodiment of the present invention. As shown in Figure 5, the acquisition module 10 may include: a registration unit 100, which is used to register the video data stream reading interface; an acquisition unit 102, which is used to redirect the video data stream to be decrypted by using the video data stream reading interface, and obtain The video data stream to be decrypted.
在优选实施过程中,上述注册单元100,用于通过与视频格式对应的解码代码提供的回调函数接口向与视频格式对应的解码代码注册视频数据流读取接口。In a preferred implementation process, the registration unit 100 is configured to register the video data stream reading interface with the decoding code corresponding to the video format through the callback function interface provided by the decoding code corresponding to the video format.
考虑到基于ffmpeg组件开发的播放器不支持对加密视频文件的解码和播放,因此,如果已经对原始视频数据流进行过加密,那么将不能直接将加密视频数据流发送至ffmpeg进行解码和播放。为此,如果需要实现加密视频数据流在ffmpeg进行解码和播放,则需要在对加密视频数据流进行解码和播放前,先通过ffmpeg提供的接口将读取加密视频数据流的动作重定向到预先设定的回调函数中,并在回调函数中完成对加密视频数据流的读取操作与解密操作。具体地,在ffmpeg初始化过程中,通过调用ffmpeg提供的回调函数avio_alloc_context接口来注册自定义的read_packet接口,以实现将读取加密视频数据流的动作重定向到预先设定的回调函数中。Considering that the player developed based on the ffmpeg component does not support the decoding and playback of encrypted video files, if the original video data stream has been encrypted, the encrypted video data stream cannot be directly sent to ffmpeg for decoding and playback. For this reason, if it is necessary to decode and play the encrypted video data stream in ffmpeg, before decoding and playing the encrypted video data stream, the action of reading the encrypted video data stream needs to be redirected to the pre- In the callback function set, and complete the read operation and decryption operation of the encrypted video data stream in the callback function. Specifically, during the initialization process of ffmpeg, the custom read_packet interface is registered by calling the callback function avio_alloc_context interface provided by ffmpeg, so as to redirect the action of reading the encrypted video data stream to the preset callback function.
可选地,如图5所示,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法对多个数据块逐一进行加密,再采用第二加密算法对加密后的多个数据块进行整体加密时,处理模块20可以包括:第一解密单元200,用于通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;第二解密单元202,用于通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;组装单元204,用于对多个数据块进行组装,得到处理后的视频数据流。Optionally, as shown in Figure 5, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length and use the first encryption algorithm to encrypt the multiple data blocks one by one, and then use the second When the second encryption algorithm encrypts multiple encrypted data blocks as a whole, the processing module 20 may include: a first decryption unit 200, configured to decrypt the video data stream from the video data stream to be decrypted by using a decryption algorithm that matches the second encryption algorithm. Encrypted multiple data blocks; the second decryption unit 202 is used to decrypt multiple data blocks from the encrypted multiple data blocks through a decryption algorithm that matches the first encryption algorithm; the assembly unit 204 is used for multiple data blocks The data blocks are assembled to obtain the processed video data stream.
当加密方式为按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,由于被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来,因此,在获取到待解密的视频数据流后,首先,需要采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块;其次,采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块;然后,再通过对解密出的多个数据块进行组装,最终得到准备在ffmpeg进行解码和播放的原始视频数据流。When the encryption method is to divide the original video data stream into multiple data blocks according to the preset length and adopt the first encryption algorithm (encryption algorithm is performed one by one according to the division unit) to encrypt the multiple data blocks one by one, and then use the second encryption When the algorithm (high-strength symmetric encryption algorithm) encrypts multiple encrypted data blocks as a whole, since the encrypted video file is no longer a standard analyzable video file after encryption processing, it is data in ciphertext Therefore, after obtaining the video data stream to be decrypted, first of all, it is necessary to use a decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) to crack the above-mentioned overall encryption process, from the video to be decrypted In the data stream, multiple encrypted data blocks obtained by using the first encryption algorithm are decrypted; secondly, a decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) is used to decrypt the encrypted multiple data blocks one by one. The decryption operation of the unit data block obtains multiple data blocks that have not been encrypted; then, by assembling the decrypted multiple data blocks, the original video data stream ready to be decoded and played by ffmpeg is finally obtained.
可选地,如图5所示,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法对加密后的多个数据块进行整体加密时,处理模块20可以包括:第一解密单元200,用于通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;第二解密单元202,用于通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;校验单元206,用于通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验;组装单元204,用于在数据完整性校验成功后,对多个数据块进行组装,得到处理后的视频数据流。Optionally, as shown in Figure 5, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, the first encryption algorithm is used to encrypt the multiple data blocks one by one and the multiple When digital watermarks are added to the data blocks one by one, and then the second encryption algorithm is used to encrypt the encrypted multiple data blocks as a whole, the processing module 20 may include: a first decryption unit 200, configured to use a decryption algorithm that matches the second encryption algorithm Decrypt a plurality of encrypted data blocks from the video data stream to be decrypted; the second decryption unit 202 is used to decrypt a plurality of encrypted data blocks from the encrypted data blocks through a decryption algorithm that matches the first encryption algorithm block; verification unit 206, for carrying out data integrity verification to a plurality of data blocks by the digital watermark added one by one for each data block in the plurality of data blocks; assembling unit 204, for succeeding in data integrity verification Finally, multiple data blocks are assembled to obtain a processed video data stream.
当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,由于被加密的视频文件通过加密处理后已经不再是标准的可解析的视频文件,而是以密文的数据保存下来,因此,在获取到待解密的视频数据流后,首先,需要采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块;其次,采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块;然后,通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验,即通过添加数字水印来确保原始视频数据流的完整性与准确性;最后,再通过对解密出的多个数据块进行组装,最终得到准备在ffmpeg进行解码和播放的原始视频数据流。When the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, adopt the first encryption algorithm (encrypt algorithm one by one according to the division unit) to encrypt the multiple data blocks one by one and encrypt the multiple data blocks one by one. When the digital watermark is added one by one, and then the second encryption algorithm (high-strength symmetric encryption algorithm) is used to encrypt the encrypted multiple data blocks as a whole, the encrypted video file is no longer a standard analyzable file after encryption processing. The video file is stored in ciphertext data. Therefore, after obtaining the video data stream to be decrypted, first, it is necessary to use a decryption algorithm that is reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) for the above-mentioned The overall encryption process is cracked, and multiple encrypted data blocks obtained by using the first encryption algorithm are decrypted from the video data stream to be decrypted; secondly, the decryption that is reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) is used The algorithm decrypts the encrypted multiple data blocks one by one unit data blocks to obtain multiple data blocks that have not been encrypted; then, through the digital watermark added to each data block in the multiple data blocks Perform data integrity verification, that is, add digital watermarks to ensure the integrity and accuracy of the original video data stream; finally, by assembling the decrypted multiple data blocks, finally get the video that is ready to be decoded and played in ffmpeg Raw video data stream.
可选地,如图5所示,上述装置还可以包括:请求模块40,用于请求创建内存空间,其中,内存空间用于存储待解密的视频数据流以及存储待解密的视频数据流进行解密处理过程中得到的中间数据。Optionally, as shown in FIG. 5, the above-mentioned apparatus may further include: a requesting module 40, configured to request to create a memory space, wherein the memory space is used to store the video data stream to be decrypted and store the video data stream to be decrypted for decryption Intermediate data obtained during processing.
在获取到待解密的视频数据流之后,首先,需要在内存中请求开辟一块存储空间对待解密的视频数据流进行存储;其次,基于上述分析,当加密方式为按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,在采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块以及采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块都可以作为中间数据暂存于新开辟的存储空间内;然后,在该存储空间内通过对解密出的多个数据块进行组装,最终得到可以被ffmpeg正确解析和执行的原始视频数据流;或者,当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法(按划分单位逐一进行加密算法)对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法(高强度对称加密算法)对加密后的多个数据块进行整体加密时,采用与第二加密算法(高强度对称加密算法)互逆的解密算法对上述整体加密过程进行破解,从待解密的视频数据流中解密出采用第一加密算法得到的加密后的多个数据块以及采用与第二加密算法(高强度对称加密算法)互逆的解密算法对加密后的多个数据块进行逐个单位数据块的解密操作,得到尚未加密的多个数据块都可以作为中间数据暂存于新开辟的存储空间内;然后,通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验,即通过添加数字水印来确保原始视频数据流的完整性与准确性;最后,再通过对解密出的多个数据块进行组装,最终得到可以被ffmpeg正确解析和执行的原始视频数据流。After obtaining the video data stream to be decrypted, first of all, it is necessary to request a storage space in the memory to store the video data stream to be decrypted; secondly, based on the above analysis, when the encryption method is to convert the original video in units of preset length The data stream is divided into multiple data blocks and the first encryption algorithm (encryption algorithm is performed one by one according to the division unit) is used to encrypt multiple data blocks one by one, and then the second encryption algorithm (high-strength symmetric encryption algorithm) is used to encrypt the encrypted data. When a data block is encrypted as a whole, the above-mentioned overall encryption process is cracked by using a decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm), and the first encryption algorithm is used to decrypt the video data stream to be decrypted. The obtained encrypted multiple data blocks and the decryption algorithm reciprocal to the second encryption algorithm (high-strength symmetric encryption algorithm) are used to perform unit data block-by-unit decryption operations on the encrypted multiple data blocks, and the unencrypted multiple data blocks are obtained. Each data block can be temporarily stored in the newly opened storage space as intermediate data; then, by assembling the decrypted multiple data blocks in the storage space, the original video data that can be correctly parsed and executed by ffmpeg is finally obtained Or, when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, adopt the first encryption algorithm (encrypt algorithm one by one according to the division unit) to encrypt the multiple data blocks one by one and then Add digital watermarks to multiple data blocks one by one, and then use the second encryption algorithm (high-strength symmetric encryption algorithm) to encrypt the encrypted multiple data blocks as a whole. The reverse decryption algorithm cracks the above-mentioned overall encryption process, and decrypts the encrypted multiple data blocks obtained by the first encryption algorithm from the video data stream to be decrypted, and uses the second encryption algorithm (high-strength symmetric encryption algorithm) The reciprocal decryption algorithm performs the decryption operation on the encrypted multiple data blocks one by one, and the unencrypted multiple data blocks can be temporarily stored in the newly opened storage space as intermediate data; The digital watermark added to each data block in multiple data blocks performs data integrity verification on multiple data blocks, that is, by adding digital watermarks to ensure the integrity and accuracy of the original video data stream; finally, by decrypting the output Assembled multiple data blocks, and finally get the original video data stream that can be correctly parsed and executed by ffmpeg.
此外,在该实施例中还提供了一种服务器。图6是根据本发明实施例的用于播放视频数据流的服务器与客户端进行信息交互的示意图。如图6所示,服务器,用于接收来自于客户端的待解密的视频数据流,根据与待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理以及将解密处理后的视频数据流发送至与视频格式对应的解码代码进行播放。In addition, a server is also provided in this embodiment. Fig. 6 is a schematic diagram of information interaction between a server and a client for playing video data streams according to an embodiment of the present invention. As shown in Figure 6, the server is configured to receive the video data stream to be decrypted from the client, decrypt the video data stream to be decrypted according to the decryption method corresponding to the encryption method adopted by the video data stream to be decrypted, and convert the The decrypted video data stream is sent to the decoding code corresponding to the video format for playback.
实施例3Example 3
本发明的实施例可以提供一种计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端设备。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。Embodiments of the present invention may provide a computer terminal, and the computer terminal may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the foregoing computer terminal may also be replaced with a terminal device such as a mobile terminal.
可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。Optionally, in this embodiment, the foregoing computer terminal may be located in at least one network device among multiple network devices of the computer network.
可选地,图7是根据本发明实施例的一种计算机终端的结构框图。如图7所示,该计算机终端可以包括:一个或多个(图中仅示出一个)处理器以及存储器。Optionally, FIG. 7 is a structural block diagram of a computer terminal according to an embodiment of the present invention. As shown in FIG. 7, the computer terminal may include: one or more (only one is shown in the figure) processors and memory.
其中,存储器可用于存储软件程序以及模块,如本发明实施例中的播放视频数据流的方法和装置对应的程序指令/模块,处理器通过运行存储在存储器内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的播放视频数据流的方法。存储器可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。Wherein, the memory can be used to store software programs and modules, such as program instructions/modules corresponding to the method and device for playing video data streams in the embodiments of the present invention, and the processor runs the software programs and modules stored in the memory to execute various A functional application and data processing, that is, a method for realizing the above-mentioned playing video data stream. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory that is remotely located relative to the processor, and these remote memories may be connected to the terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
处理器可以通过传输装置调用存储器存储的信息及应用程序,以执行下述步骤:The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps:
S1:获取待解密的视频数据流;S1: Obtain the video data stream to be decrypted;
S2:根据与待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理;S2: Decrypt the video data stream to be decrypted according to the decryption method corresponding to the encryption method adopted by the video data stream to be decrypted;
S3:将处理后的视频数据流发送至与视频格式对应的解码代码进行播放。S3: Send the processed video data stream to the decoding code corresponding to the video format for playback.
可选的,上述处理器还可以执行如下步骤的程序代码:注册视频数据流读取接口;采用视频数据流读取接口对待解密的视频数据流进行重定向,获取待解密的视频数据流。Optionally, the above-mentioned processor may also execute the program code in the following steps: register the video data stream reading interface; use the video data stream reading interface to redirect the video data stream to be decrypted, and obtain the video data stream to be decrypted.
可选的,上述处理器还可以执行如下步骤的程序代码:通过与视频格式对应的解码代码提供的回调函数接口向与视频格式对应的解码代码注册视频数据流读取接口。Optionally, the above-mentioned processor may also execute the program code of the following step: Register the video data stream reading interface with the decoding code corresponding to the video format through the callback function interface provided by the decoding code corresponding to the video format.
可选的,上述处理器还可以执行如下步骤的程序代码:当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法对多个数据块逐一进行加密,再采用第二加密算法对加密后的多个数据块进行整体加密时,通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;对多个数据块进行组装,得到处理后的视频数据流。Optionally, the above-mentioned processor can also execute the program code of the following steps: when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, and use the first encryption algorithm to encrypt the multiple data blocks one by one When encrypting, and then adopting the second encryption algorithm to encrypt the encrypted multiple data blocks as a whole, the encrypted multiple data blocks are decrypted from the video data stream to be decrypted by a decryption algorithm matched with the second encryption algorithm; A plurality of data blocks are decrypted from the encrypted data blocks by a decryption algorithm matching the first encryption algorithm; the plurality of data blocks are assembled to obtain a processed video data stream.
可选的,上述处理器还可以执行如下步骤的程序代码:当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法对加密后的多个数据块进行整体加密时,通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验;在数据完整性校验成功后,对多个数据块进行组装,得到处理后的视频数据流。Optionally, the above-mentioned processor can also execute the program code in the following steps: when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, and use the first encryption algorithm to encrypt the multiple data blocks one by one Encrypt and add digital watermarks to multiple data blocks one by one, and then use the second encryption algorithm to encrypt the encrypted multiple data blocks as a whole, use the decryption algorithm that matches the second encryption algorithm from the video data stream to be decrypted Decrypt the encrypted multiple data blocks; decrypt multiple data blocks from the encrypted multiple data blocks through a decryption algorithm that matches the first encryption algorithm; The digital watermark performs data integrity verification on multiple data blocks; after the data integrity verification is successful, multiple data blocks are assembled to obtain the processed video data stream.
可选的,上述处理器还可以执行如下步骤的程序代码:请求创建内存空间,其中,内存空间用于存储待解密的视频数据流以及存储待解密的视频数据流进行解密处理过程中得到的中间数据。Optionally, the above-mentioned processor may also execute the program code of the following steps: requesting to create a memory space, wherein the memory space is used to store the video data stream to be decrypted and to store the video data stream to be decrypted for the intermediate data obtained during the decryption process. data.
采用本发明实施例,在获取到待解密的视频数据流之后,先根据待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理,然后再将处理后的视频数据流发送至与视频格式对应的解码代码进行播放的方式,通过先对获取到的加密视频进行解密和封装,达到了对加密视频进行解码与播放的目的,从而实现了针对定制化的加密视频文件进行解码和播放,有效地防止加密视频文件中的视频数据被修改或视频文件被盗版的技术效果,进而解决了相关技术中播放工具提供的播放接口和功能无法支持对于加密视频文件的解码与播放,由此易造成视频文件因为没有经过加密处理故而轻易地被黑客伪装和篡改的技术问题。According to the embodiment of the present invention, after the video data stream to be decrypted is acquired, the video data stream to be decrypted is decrypted according to the decryption method corresponding to the encryption method adopted by the video data stream to be decrypted, and then the processed video data stream is decrypted The video data stream is sent to the decoding code corresponding to the video format for playback. By first decrypting and encapsulating the obtained encrypted video, the purpose of decoding and playing the encrypted video is achieved, thereby realizing customized encryption. The video file is decoded and played, which effectively prevents the video data in the encrypted video file from being modified or the video file is pirated, thereby solving the problem that the playback interface and functions provided by the playback tool in the related technology cannot support the decoding of the encrypted video file and playback, which easily leads to the technical problem that video files are easily disguised and tampered by hackers because they have not been encrypted.
本领域普通技术人员可以理解,图7所示的结构仅为示意,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图7其并不对上述电子装置的结构造成限定。例如,计算机终端还可包括比图7中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图7所示不同的配置。Those of ordinary skill in the art can understand that the structure shown in Figure 7 is only schematic, and the computer terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, an applause computer, and a mobile Internet device (Mobile Internet Devices, MID ), PAD and other terminal equipment. FIG. 7 does not limit the structure of the above-mentioned electronic device. For example, the computer terminal may also include more or less components than those shown in FIG. 7 (such as a network interface, a display device, etc.), or have a configuration different from that shown in FIG. 7 .
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取器(Random Access Memory,简称为RAM)、磁盘或光盘等。Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can be Including: a flash disk, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk or an optical disk, and the like.
实施例4Example 4
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例一所提供的播放视频数据流的方法所执行的程序代码。The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the foregoing storage medium may be used to store program codes executed by the method for playing a video data stream provided in Embodiment 1 above.
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。Optionally, in this embodiment, the above-mentioned storage medium may be located in any computer terminal in the group of computer terminals in the computer network, or in any mobile terminal in the group of mobile terminals.
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:Optionally, in this embodiment, the storage medium is configured to store program codes for performing the following steps:
S1:获取待解密的视频数据流;S1: Obtain the video data stream to be decrypted;
S2:根据与待解密的视频数据流所采用的加密方式对应的解密方式对待解密的视频数据流进行解密处理;S2: Decrypt the video data stream to be decrypted according to the decryption method corresponding to the encryption method adopted by the video data stream to be decrypted;
S3:将处理后的视频数据流发送至与视频格式对应的解码代码进行播放。S3: Send the processed video data stream to the decoding code corresponding to the video format for playback.
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:注册视频数据流读取接口;采用视频数据流读取接口对待解密的视频数据流进行重定向,获取待解密的视频数据流。Optionally, the above-mentioned storage medium is also configured to store program codes for performing the following steps: register the video data stream reading interface; use the video data stream reading interface to redirect the video data stream to be decrypted, and obtain the video data stream to be decrypted video data stream.
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:通过与视频格式对应的解码代码提供的回调函数接口向与视频格式对应的解码代码注册视频数据流读取接口。Optionally, the above-mentioned storage medium is also configured to store program codes for performing the following steps: Register the video data stream reading interface with the decoding code corresponding to the video format through the callback function interface provided by the decoding code corresponding to the video format.
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块并采用第一加密算法对多个数据块逐一进行加密,再采用第二加密算法对加密后的多个数据块进行整体加密时,通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;对多个数据块进行组装,得到处理后的视频数据流。Optionally, the above-mentioned storage medium is also configured to store program codes for performing the following steps: when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length and use the first encryption algorithm to Encrypt multiple data blocks one by one, and then use the second encryption algorithm to encrypt the encrypted multiple data blocks as a whole, and decrypt the encrypted video data stream from the video data stream to be decrypted by using the decryption algorithm matching the second encryption algorithm. A plurality of data blocks; a plurality of data blocks are decrypted from the encrypted plurality of data blocks by a decryption algorithm matching the first encryption algorithm; the plurality of data blocks are assembled to obtain a processed video data stream.
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:当加密方式为先按照预设长度为单位将原始视频数据流划分为多个数据块,采用第一加密算法对多个数据块逐一进行加密并对多个数据块逐一添加数字水印,再采用第二加密算法对加密后的多个数据块进行整体加密时,通过与第二加密算法匹配的解密算法从待解密的视频数据流中解密出加密后的多个数据块;通过与第一加密算法匹配的解密算法从加密后的多个数据块中解密出多个数据块;通过逐一为多个数据块中每个数据块添加的数字水印对多个数据块进行数据完整性校验;在数据完整性校验成功后,对多个数据块进行组装,得到处理后的视频数据流。Optionally, the above-mentioned storage medium is also configured to store program codes for performing the following steps: when the encryption method is to first divide the original video data stream into multiple data blocks according to the preset length, and use the first encryption algorithm to Encrypt multiple data blocks one by one and add digital watermarks to multiple data blocks one by one, and then use the second encryption algorithm to encrypt the encrypted multiple data blocks as a whole, use the decryption algorithm that matches the second encryption algorithm from the data to be decrypted A plurality of encrypted data blocks are decrypted in the video data stream; a plurality of data blocks are decrypted from a plurality of encrypted data blocks by a decryption algorithm matched with the first encryption algorithm; The digital watermark added to each data block performs data integrity verification on multiple data blocks; after the data integrity verification is successful, multiple data blocks are assembled to obtain the processed video data stream.
可选的,上述存储介质还被设置为存储用于执行以下步骤的程序代码:请求创建内存空间,其中,内存空间用于存储待解密的视频数据流以及存储待解密的视频数据流进行解密处理过程中得到的中间数据。Optionally, the above-mentioned storage medium is also configured to store program codes for performing the following steps: requesting to create a memory space, wherein the memory space is used to store the video data stream to be decrypted and store the video data stream to be decrypted for decryption processing Intermediate data obtained during the process.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are for description only, and do not represent the advantages and disadvantages of the embodiments.
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present invention, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be realized in other ways. Wherein, the device embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or can be Integrate into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of units or modules may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media capable of storing program codes such as U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, and it should be pointed out that for those of ordinary skill in the art, some improvements and modifications can be made without departing from the principle of the present invention. It should be regarded as the protection scope of the present invention.
Claims (13)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610269016.1A CN107318045A (en) | 2016-04-27 | 2016-04-27 | The method and device of playing video data stream |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610269016.1A CN107318045A (en) | 2016-04-27 | 2016-04-27 | The method and device of playing video data stream |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107318045A true CN107318045A (en) | 2017-11-03 |
Family
ID=60184538
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610269016.1A Pending CN107318045A (en) | 2016-04-27 | 2016-04-27 | The method and device of playing video data stream |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107318045A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108052915A (en) * | 2017-12-22 | 2018-05-18 | 深圳英飞拓科技股份有限公司 | A kind of method and device that Face datection is carried out to video and is identified |
CN108494732A (en) * | 2018-02-09 | 2018-09-04 | 浙江新再灵科技股份有限公司 | A kind of intelligence screen video playing tamper resistant systems based on digital finger-print |
CN109005427A (en) * | 2018-08-20 | 2018-12-14 | 全球播科技(北京)有限公司 | Encrypted video playback method, device and equipment, storage medium and processor |
CN113613044A (en) * | 2021-07-20 | 2021-11-05 | 深圳Tcl新技术有限公司 | Video playing method and device, storage medium and electronic equipment |
CN114791960A (en) * | 2022-03-09 | 2022-07-26 | 广州博冠信息科技有限公司 | Multimedia file playing method and device, electronic equipment and storage medium |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1710505A (en) * | 2005-07-08 | 2005-12-21 | 北京影立驰技术有限公司 | Digital copyright protection method and system |
CN101185122A (en) * | 2005-06-03 | 2008-05-21 | 皇家飞利浦电子股份有限公司 | Homomorphic encryption for secure watermarks |
CN102622541A (en) * | 2010-12-29 | 2012-08-01 | 奥多比公司 | System and method for encrypting and deciphering |
CN102624708A (en) * | 2012-02-23 | 2012-08-01 | 浙江工商大学 | An Efficient Data Encryption, Update and Access Control Method for Cloud Storage |
CN102760221A (en) * | 2011-04-27 | 2012-10-31 | 航天信息股份有限公司 | IPTV (Internet Protocol Television) digital rights management (DRM) method and device based on digital watermarking and encryption |
CN102905133A (en) * | 2012-10-15 | 2013-01-30 | 南京邮电大学 | A Hybrid Encoding Method for Video Stream |
CN103024449A (en) * | 2011-09-28 | 2013-04-03 | 中国移动通信集团公司 | Method for processing video frame stream, video server and terminal equipment |
CN103647971A (en) * | 2013-12-24 | 2014-03-19 | 广州鸿根信息科技有限公司 | Video transmission based encryption and decryption method and system |
US8804953B2 (en) * | 2008-11-18 | 2014-08-12 | Red Hat, Inc. | Extensive ciphertext feedback |
CN104537600A (en) * | 2014-12-16 | 2015-04-22 | 陕西科技大学 | Secondary image encrypting and decrypting methods and watermark information tamper area positioning method |
CN104837035A (en) * | 2015-04-30 | 2015-08-12 | 华为软件技术有限公司 | Video playing method and terminal |
CN105163190A (en) * | 2015-09-08 | 2015-12-16 | 深圳市九洲电器有限公司 | Method and system for implementing video-on-demand function of set top box |
CN105187912A (en) * | 2015-07-14 | 2015-12-23 | 中国科学院信息工程研究所 | Ciphertext video player and playing method |
-
2016
- 2016-04-27 CN CN201610269016.1A patent/CN107318045A/en active Pending
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101185122A (en) * | 2005-06-03 | 2008-05-21 | 皇家飞利浦电子股份有限公司 | Homomorphic encryption for secure watermarks |
CN1710505A (en) * | 2005-07-08 | 2005-12-21 | 北京影立驰技术有限公司 | Digital copyright protection method and system |
US8804953B2 (en) * | 2008-11-18 | 2014-08-12 | Red Hat, Inc. | Extensive ciphertext feedback |
CN102622541A (en) * | 2010-12-29 | 2012-08-01 | 奥多比公司 | System and method for encrypting and deciphering |
CN102760221A (en) * | 2011-04-27 | 2012-10-31 | 航天信息股份有限公司 | IPTV (Internet Protocol Television) digital rights management (DRM) method and device based on digital watermarking and encryption |
CN103024449A (en) * | 2011-09-28 | 2013-04-03 | 中国移动通信集团公司 | Method for processing video frame stream, video server and terminal equipment |
CN102624708A (en) * | 2012-02-23 | 2012-08-01 | 浙江工商大学 | An Efficient Data Encryption, Update and Access Control Method for Cloud Storage |
CN102905133A (en) * | 2012-10-15 | 2013-01-30 | 南京邮电大学 | A Hybrid Encoding Method for Video Stream |
CN103647971A (en) * | 2013-12-24 | 2014-03-19 | 广州鸿根信息科技有限公司 | Video transmission based encryption and decryption method and system |
CN104537600A (en) * | 2014-12-16 | 2015-04-22 | 陕西科技大学 | Secondary image encrypting and decrypting methods and watermark information tamper area positioning method |
CN104837035A (en) * | 2015-04-30 | 2015-08-12 | 华为软件技术有限公司 | Video playing method and terminal |
CN105187912A (en) * | 2015-07-14 | 2015-12-23 | 中国科学院信息工程研究所 | Ciphertext video player and playing method |
CN105163190A (en) * | 2015-09-08 | 2015-12-16 | 深圳市九洲电器有限公司 | Method and system for implementing video-on-demand function of set top box |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108052915A (en) * | 2017-12-22 | 2018-05-18 | 深圳英飞拓科技股份有限公司 | A kind of method and device that Face datection is carried out to video and is identified |
CN108494732A (en) * | 2018-02-09 | 2018-09-04 | 浙江新再灵科技股份有限公司 | A kind of intelligence screen video playing tamper resistant systems based on digital finger-print |
CN108494732B (en) * | 2018-02-09 | 2021-07-06 | 浙江新再灵科技股份有限公司 | Intelligent screen video playing tamper-proof system based on digital fingerprints |
CN109005427A (en) * | 2018-08-20 | 2018-12-14 | 全球播科技(北京)有限公司 | Encrypted video playback method, device and equipment, storage medium and processor |
CN109005427B (en) * | 2018-08-20 | 2021-06-08 | 全球播科技(北京)有限公司 | Encrypted video playing method, device and equipment and storage medium |
CN113613044A (en) * | 2021-07-20 | 2021-11-05 | 深圳Tcl新技术有限公司 | Video playing method and device, storage medium and electronic equipment |
CN114791960A (en) * | 2022-03-09 | 2022-07-26 | 广州博冠信息科技有限公司 | Multimedia file playing method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101215981B1 (en) | Protection of Digital Data Content | |
CN102292931B (en) | Method and device for multiple content protection systems in a file | |
JP5605146B2 (en) | Information processing apparatus, information processing method, and program | |
CN106331751B (en) | A kind of online encrypted slice video broadcasting method based on iOS operating system | |
CN107318045A (en) | The method and device of playing video data stream | |
TW200428842A (en) | System for secure decryption of streaming media using selective decryption of header information and decryption of reassembled content | |
CN105791893B (en) | Video file encryption and decryption method and device | |
WO2021072878A1 (en) | Audio/video data encryption and decryption method and apparatus employing rtmp, and readable storage medium | |
CN105611318A (en) | Method and system for video encryption playing | |
CN106096334A (en) | The encryption method of hypermedia data and encryption device, decryption method and deciphering device | |
CN103414733A (en) | HLS (HTTP Live Streaming) streaming media playing method and HLS streaming media playing system | |
WO2017054480A1 (en) | Multimedia data encryption method and apparatus | |
US10127396B2 (en) | System and method for local generation of streaming content with a hint track | |
CN103765909A (en) | Thwarting unauthorized content copying using media tracking code | |
US9948695B2 (en) | Enabling delivery of protected content using unprotected delivery services | |
CN101115174A (en) | Method and system of playback for preventing skip over special contents fragment in digital media stream | |
CN102158768A (en) | MP4 file encapsulation format-based video authentication watermark embedding and extraction method | |
CN108141615A (en) | MPEG transports frame synchronization | |
CN106209896A (en) | Streaming media encryption method based on audio frequency and video form and module | |
CN106060604A (en) | Method and system for realizing digital rights management play based on BHD file | |
CN105825088A (en) | Multimedia data processing device and multimedia data copyright protection method | |
HK1246055A1 (en) | Method and apparatus for playing video data streams | |
CN114791960A (en) | Multimedia file playing method and device, electronic equipment and storage medium | |
KR20090105373A (en) | A system for providing contents using a codec dialm, an apparatus and method for generating / reproducing digital contents, and a computer readable recording medium recording a program for performing the method. | |
CN118018182A (en) | Multimedia data encryption method, multimedia data decryption method, device and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 1246055 Country of ref document: HK |
|
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171103 |
|
RJ01 | Rejection of invention patent application after publication | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: WD Ref document number: 1246055 Country of ref document: HK |