CN105915493A - Audio and video real-time transmission method and device and audio and video real-time playing method and device - Google Patents
Audio and video real-time transmission method and device and audio and video real-time playing method and device Download PDFInfo
- Publication number
- CN105915493A CN105915493A CN201510886024.6A CN201510886024A CN105915493A CN 105915493 A CN105915493 A CN 105915493A CN 201510886024 A CN201510886024 A CN 201510886024A CN 105915493 A CN105915493 A CN 105915493A
- Authority
- CN
- China
- Prior art keywords
- program
- video
- specific information
- audio
- primary flow
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/65—Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
- H04L63/0435—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/75—Media network packet handling
- H04L65/762—Media network packet handling at the source
-
- 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/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2347—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving video stream encryption
- H04N21/23476—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving video stream encryption by partially encrypting, e.g. encrypting the ending portion of a movie
-
- 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/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/236—Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream
- H04N21/2368—Multiplexing of audio and video streams
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
本发明实施例提供一种音视频实时传输方法,包括:将分组的视频原始流以及分组的音频原始流复用后存储为节目切片;对节目特定信息进行加密,并存储为节目特定信息切片;传输所述节目特定信息及所述节目切片。本发明实施例还提供一种音视频实时传输方法、音视频实时播放方法及装置。本发明实施例可以减少现有技术中加密及解密的运算量。
An embodiment of the present invention provides a method for real-time audio and video transmission, including: storing the grouped video original stream and the grouped audio original stream as program slices after multiplexing; encrypting the program-specific information, and storing it as a program-specific information slice; The program specific information and the program slices are transmitted. Embodiments of the present invention also provide a real-time audio and video transmission method, and a real-time audio and video playback method and device. The embodiment of the present invention can reduce the calculation amount of encryption and decryption in the prior art.
Description
技术领域technical field
本发明实施例涉及音视频技术领域,尤其涉及一种音视频实时传输方法及装置、音视频实时播放方法及装置。Embodiments of the present invention relate to the field of audio and video technologies, and in particular, to a method and device for real-time transmission of audio and video, and a method and device for real-time playback of audio and video.
背景技术Background technique
HLS(HTTP Live Streaming)协议是苹果公司研发出的,用在网络直播和点播场景中的扩展HTTP协议,该协议使用传输流(Transport Stream,TS)的方式封装数据。每个传输流都携带视频(Video)、音频(Audio)等数据信息,以及携带节目关联表(Program Association Table,PAT)、节目映射表(Program Map Table,PMT)等流索引信息。The HLS (HTTP Live Streaming) protocol is an extended HTTP protocol developed by Apple and used in webcast and on-demand scenarios. The protocol uses Transport Stream (TS) to encapsulate data. Each transport stream carries data information such as video (Video), audio (Audio), and stream index information such as program association table (Program Association Table, PAT) and program mapping table (Program Map Table, PMT).
HLS协议中支持对传输流的切片进行加密,现有技术中的加密方案是对每个切片都要进行加密,因此该加密方式的运算量较大,接收端在解密时运算量也会相应的增大。因而,现有技术的加密方案,如果要保证传输的质量,要么需要单独的硬件加解密器件支持,要么要求CPU有较强的处理能力。The HLS protocol supports the encryption of the slices of the transport stream. The encryption scheme in the prior art is to encrypt each slice. Therefore, the calculation amount of this encryption method is relatively large, and the calculation amount of the receiving end will be corresponding when decrypting. increase. Therefore, if the encryption scheme in the prior art needs to guarantee the quality of transmission, it either needs the support of a separate hardware encryption and decryption device, or requires a strong processing capability of the CPU.
发明内容Contents of the invention
本发明实施例提供一种音视频实时传输方法及装置、音视频实时播放方法及装置,用以解决现有技术中加密及解密的运算量过大的技术问题。Embodiments of the present invention provide a method and device for real-time transmission of audio and video, and a method and device for real-time playback of audio and video, which are used to solve the technical problem of excessive computational complexity in encryption and decryption in the prior art.
本发明实施例提供一种音视频实时传输方法,包括:An embodiment of the present invention provides a method for real-time transmission of audio and video, including:
将分组的视频原始流以及分组的音频原始流复用后存储为节目切片;Multiplexing the grouped original video streams and grouped audio original streams and storing them as program slices;
对节目特定信息进行加密,并存储为节目特定信息切片;Encrypt program-specific information and store it as program-specific information slices;
传输所述节目特定信息及所述节目切片。The program specific information and the program slices are transmitted.
进一步的,所述对节目特定信息进行加密包括对节目关联表和节目映射表加密。Further, said encrypting the program-specific information includes encrypting the program association table and the program mapping table.
进一步的,所述将分组的视频原始流以及分组的音频原始流复用后存储为节目切片的步骤之前还包括:Further, before the step of multiplexing the packetized video original stream and the packetized audio original stream and storing them as program slices, the step further includes:
将视频原始流及音频原始流分别打包为分组的视频原始流和分组的音频原始流的步骤。A step of packaging the original video stream and the original audio stream into packetized video original streams and packetized audio original streams respectively.
进一步的,所述将视频原始流及音频原始流分别打包为分组的视频原始流和分组的音频原始流的步骤之前还包括:Further, before the step of packaging the original video stream and the original audio stream into packetized video original streams and packetized audio original streams, the step also includes:
将视频数据及视频数据分别编码及形成所述视频原始流及所述音频原始流的步骤。A step of encoding the video data and the video data respectively and forming the video original stream and the audio original stream.
本发明还提供一种音视频实时播放方法,包括:The present invention also provides a real-time audio and video playback method, including:
下载加密后的节目特定信息切片;Download encrypted program-specific information slices;
解密所述加密后的节目特定信息切片,得到解密后的节目特定信息;Decrypting the encrypted program-specific information slices to obtain decrypted program-specific information;
下载节目切片,并根据所述解密后的节目特定信息解析所述节目切片。Downloading program slices, and parsing the program slices according to the decrypted program specific information.
进一步的,所述加密后的节目特定信息切片包括加密后的节目关联表及加密后的节目映射表。Further, the encrypted program-specific information slice includes an encrypted program association table and an encrypted program mapping table.
进一步的,所述解密所述加密后的节目特定信息切片包括:解密所述加密后的节目关联表及加密后的节目映射表。Further, the decrypting the encrypted program-specific information slice includes: decrypting the encrypted program association table and the encrypted program mapping table.
本发明提供一种音视频实时传输装置,包括:The present invention provides an audio and video real-time transmission device, comprising:
加密模块,用于对节目特定信息进行加密,并存储为节目特定信息切片;An encryption module, configured to encrypt program-specific information and store it as a program-specific information slice;
复用器,用于将分组的视频原始流以及分组的音频原始流复用后存储为节目切片;a multiplexer, configured to multiplex the packetized original video stream and the packetized audio original stream and store them as program slices;
传输模块,用于传输所述节目特定信息及所述节目切片。A transmission module, configured to transmit the program specific information and the program slice.
进一步的,所述对节目特定信息进行加密包括对节目关联表和节目映射表加密。Further, said encrypting the program-specific information includes encrypting the program association table and the program mapping table.
进一步的,还包括视频分组器及音频分组器:Further, it also includes video grouper and audio grouper:
所述视频分组器,用于将视频原始流打包为分组的视频原始流;The video packetizer is used to pack the video original stream into a grouped video original stream;
所述音频分组器,用于将音频原始流打包为分组的音频原始流。The audio packetizer is configured to packetize the audio original stream into grouped audio original streams.
进一步的,还包括视频编码器和音频编码器:Further, it also includes video encoder and audio encoder:
所述视频编码器,用于将视频数据编码形成所述视频原始流;The video encoder is configured to encode video data to form the original video stream;
所述音频编码器,用于将音频数据编码形成所述音频原始流。The audio encoder is configured to encode audio data to form the audio original stream.
本发明提供一种音视频实时播放装置,包括:The present invention provides an audio and video real-time playback device, comprising:
第一下载模块,用于下载加密后的节目特定信息切片;A first download module, configured to download encrypted program-specific information slices;
解密模块,用于解密所述加密后的节目特定信息切片,得到解密后的节目特定信息;A decryption module, configured to decrypt the encrypted program-specific information slices to obtain decrypted program-specific information;
第二下载模块,用于下载节目切片,并根据所述解密后的节目特定信息解析所述节目切片。The second downloading module is configured to download program slices, and analyze the program slices according to the decrypted program specific information.
进一步的,所述加密后的节目特定信息切片包括加密后的节目关联表及加密后的节目映射表。Further, the encrypted program-specific information slice includes an encrypted program association table and an encrypted program mapping table.
进一步的,所述解密模块还用于解密所述加密后的节目关联表及加密后的节目映射表。Further, the decryption module is also used to decrypt the encrypted program association table and the encrypted program mapping table.
本发明实施例提供的音视频实时传输方法及装置、音视频实时播放方法及装置,不需要对每个切片都进行加密及解密,可以同时减少传输端的加密运算量,及减少接收端的解密运算量。The audio and video real-time transmission method and device, audio and video real-time playback method and device provided by the embodiments of the present invention do not need to encrypt and decrypt each slice, and can simultaneously reduce the amount of encryption calculations at the transmission end and the decryption calculation amount at the receiving end. .
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are For some embodiments of the present invention, those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为现有技术中传输流的切片的格式示意图;FIG. 1 is a schematic diagram of the format of a slice of a transport stream in the prior art;
图2为本发明实施例一种音视频实时传输方法的节目切片的格式示意图;2 is a schematic diagram of the format of a program slice of a method for real-time audio and video transmission according to an embodiment of the present invention;
图3为本发明实施例一种音视频实时传输方法的节目特定信息切片的格式示意图;3 is a schematic diagram of the format of a program-specific information slice of a method for real-time audio and video transmission according to an embodiment of the present invention;
图4为本发明实施例一种音视频实时传输方法的切片的包的构成示意;FIG. 4 is a schematic diagram of the composition of sliced packets of an audio and video real-time transmission method according to an embodiment of the present invention;
图5为本发明实施例一种音视频实时传输方法的流程图;5 is a flowchart of a method for real-time audio and video transmission according to an embodiment of the present invention;
图6为本发明实施例一种音视频实时播放方法的流程图;Fig. 6 is the flow chart of a kind of audio and video real-time playing method of the embodiment of the present invention;
图7为本发明实施例一种音视频实时传输装置的结构示意图;7 is a schematic structural diagram of an audio and video real-time transmission device according to an embodiment of the present invention;
图8为本发明实施例一种音视频实时播放装置的结构示意图。FIG. 8 is a schematic structural diagram of an audio and video real-time playback device according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments 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 creative efforts fall within the protection scope of the present invention.
为更好的说明本发明实施例的技术方案及其所产生的有益效果,本发明将首先介绍现有技术中传输流的切片的格式。In order to better illustrate the technical solutions of the embodiments of the present invention and the beneficial effects produced by them, the present invention will first introduce the format of slices of transport streams in the prior art.
图1为现有技术中传输流的切片的格式示意图。FIG. 1 is a schematic diagram of the format of a transport stream slice in the prior art.
传输流为层次型的封装格式,需要先找到节目关联表,以获取传输流中节目映射表的数量,以此获得传输流中节目的数量,其中每一张节目映射表对应一个节目,然后再根据节目映射表获取节目的视频包标示符(PacketIdentification,PID)和音频包标示符。The transport stream is a hierarchical encapsulation format. It is necessary to find the program association table first to obtain the number of program mapping tables in the transport stream, so as to obtain the number of programs in the transport stream. Each program mapping table corresponds to a program, and then The video packet identifier (Packet Identification, PID) and audio packet identifier of the program are acquired according to the program mapping table.
根据HLS协议的规定,一个长时间的节目通常被切割分成多个时长为10秒的切片。因此,现有技术中传输流的切片,为了方便用户随时接收传输流并保证切片中的音视频数据不被盗播,传输端是周期性的将节目关联表和节目映射表插入到传输流的切片中,并且对每一个切片都进行加密;从而导致现有技术中的传输流的切片包括至少两张以上加密过的节目关联表和节目映射表,接收端在接收在接收到切片后同样需要对每一个切片中的所有节目关联表及节目映射表进行解密。According to the HLS protocol, a long program is usually divided into multiple 10-second slices. Therefore, in the slice of the transport stream in the prior art, in order to facilitate the user to receive the transport stream at any time and ensure that the audio and video data in the slice are not pirated, the transmission end periodically inserts the program association table and the program mapping table into the transport stream slices, and each slice is encrypted; thus the slice of the transport stream in the prior art includes at least two encrypted program association tables and program mapping tables, and the receiving end also needs to receive the slice after receiving the slice Decrypt all program association tables and program mapping tables in each slice.
例如,图1中,一个节目被切割为n个切片,用户A可以从节目关联表1处接收,用户B可以从节目关联表n处接收,以就近找到节目映射表,从而方便直播;由于传输端在传输过程中对节目关联表1至n以及节目映射表1至n均进行了加密,因此接收端在接收到加密的节目关联表1至n以及节目映射表1至n也都需要进行解密。因此,现有技术极大的增加了传输流中的冗余数据。For example, in Figure 1, a program is cut into n slices, user A can receive it from program association table 1, and user B can receive it from program association table n to find the program mapping table nearby, so as to facilitate live broadcast; The terminal encrypts the program association tables 1 to n and the program mapping tables 1 to n during the transmission process, so the receiving end also needs to decrypt the encrypted program association tables 1 to n and program mapping tables 1 to n . Therefore, the prior art greatly increases the redundant data in the transport stream.
本发明的发明人在经过长时间研究后发现在每一个切片中,并不需要周期性的插入节目关联表和节目映射表,而仅需要把节目关联表和节目映射表单独打包并加密,就可以达到既可保持与现有技术中的传输流兼容,又同时减少传输流中的冗余数据的效果。After a long period of research, the inventors of the present invention found that in each slice, it is not necessary to periodically insert the program association table and the program mapping table, but only need to package and encrypt the program association table and the program mapping table separately, then The effect of not only maintaining compatibility with the transport stream in the prior art, but also reducing redundant data in the transport stream can be achieved.
以下将对本发明传输流的切片的格式进行说明。The format of the slice of the transport stream of the present invention will be described below.
图2为本发明实施例一种音视频实时传输方法的节目切片的格式示意图。FIG. 2 is a schematic diagram of the format of a program slice in a method for real-time audio and video transmission according to an embodiment of the present invention.
本发明实施例中的传输流是一种基于包的流,每一组传输流被分割为若干个切片,需要说明的是图3中仅示出了一个切片的格式,其它切片的格式其实与图2中的切片格式类似。The transport stream in the embodiment of the present invention is a packet-based stream, and each group of transport streams is divided into several slices. It should be noted that only the format of one slice is shown in FIG. 3 , and the formats of other slices are actually the same as The slice format in Figure 2 is similar.
本发明实施例中的节目切片包括包1、包2……包n-1、包n,而且每个节目切片均不包括节目关联表和节目映射表。The program slices in the embodiment of the present invention include package 1, package 2...packet n-1, package n, and each program slice does not include a program association table and a program mapping table.
图3为本发明实施例一种音视频实时传输方法的节目特定信息切片的格式示意图。Fig. 3 is a schematic diagram of the format of program-specific information slices in a method for real-time audio and video transmission according to an embodiment of the present invention.
本实施例中的节目特定信息切片只包括有加密后的节目关联表和节目映射表这两个节目特定信息,而不包含视频数据和音频数据。节目特定信息切片可以将其存储为文件名为init.ts的文件。The program-specific information slice in this embodiment only includes two pieces of program-specific information, the encrypted program association table and the program mapping table, but does not include video data and audio data. A program specific information slice may be stored as a file named init.ts.
图4为本发明实施例一种音视频实时传输方法的切片的包的构成示意图。FIG. 4 is a schematic diagram of the packet composition of a slice in a method for real-time audio and video transmission according to an embodiment of the present invention.
本实施例中所示出的切片可以是节目特定信息切片也可以是节目切片,每个切片均包括包头和数据,每个包是188个字节或204个字节,其中204个字节的包是在188个字节的包之后加上了16字节的CRC校验数据形成。The slices shown in this embodiment can be program-specific information slices or program slices, each slice includes a packet header and data, and each packet is 188 bytes or 204 bytes, of which 204 bytes The packet is formed by adding 16 bytes of CRC check data after the 188-byte packet.
包头还可以包括扩展的自使用区,包头长度占4个字节,自使用区和包数据共占184个字节。包头包括同步字节、传输误码指示符、有效载荷单元起始指示符、传输优先、包识别符、传输加扰控制、自适应区控制和连续计数器8个部分组成。The packet header may also include an extended self-use area, the length of the packet header occupies 4 bytes, and the self-use area and packet data occupy a total of 184 bytes. The packet header consists of 8 parts: synchronization byte, transmission error code indicator, payload unit start indicator, transmission priority, packet identifier, transmission scrambling control, adaptive area control and continuous counter.
其中,可以通过同步字节的位串的自动相关特性,检测数据流中的包限制,建立包同步;传输误码指示符,是指有不能消除的误码时,采用误码校正解码器可表示1位的误码,但无法校正该误码;有效载荷单元起始指示符,表示该包是否存在确定的起始信息;传输优先用于是给包分配优先权;包标示符值是由用户确定的,由解码器根据包标示符区别不同原始流(ElementaryStream,ES)的包,以重建原始流;传输加扰控制可用于指示包内容是否加扰;自适应区控制是用于表示有否自适应区,通常用2位来表示,比如“01”表示有有用信息,但是无自适应区,“10”表示无有用信息,且有自适应区,“11”表示有有用信息且有自适应区,“00”表示无定义;连续计数器可对包标示符传送顺序计数,根据连续计数器的读数,接收端可以判断是否有包丢失及包传送顺序错误。总而言之,包头对传输流具有同步、识别、检错及加密功能。Among them, the packet restriction in the data stream can be detected through the automatic correlation characteristic of the bit string of the synchronization byte, and packet synchronization can be established; the transmission error indicator means that when there is an error code that cannot be eliminated, the error correction decoder can be used Indicates a 1-bit error, but the error cannot be corrected; the payload unit start indicator indicates whether the packet has definite start information; the transmission priority is used to assign priority to the packet; the packet identifier value is determined by the user Determined, the decoder distinguishes the packets of different elementary streams (ElementaryStream, ES) according to the packet identifier to reconstruct the original stream; the transmission scrambling control can be used to indicate whether the packet content is scrambled; the adaptive area control is used to indicate whether there is Adaptive area, usually represented by 2 bits, for example, "01" indicates that there is useful information but no adaptive area, "10" indicates that there is no useful information and there is adaptive area, "11" indicates that there is useful information and there is automatic Adaptation area, "00" means no definition; the continuous counter can count the transmission sequence of the packet identifier, and according to the reading of the continuous counter, the receiving end can judge whether there is a packet loss or a packet transmission sequence error. All in all, the packet header has the functions of synchronization, identification, error detection and encryption for the transport stream.
此外,包标示符是传输流中的唯一识别标志,包中的数据内容是由包标示符决定。如果一个传输流中的一个包的包头中的包标示符是0,那么该包的数据内容就是节目关联表,如果不是0,就是视频数据,音频数据,节目映射表,或者是其他类型数据。In addition, the packet identifier is a unique identifier in the transport stream, and the data content in the packet is determined by the packet identifier. If the packet identifier in the header of a packet in a transport stream is 0, then the data content of the packet is the program association table, if not 0, it is video data, audio data, program mapping table, or other types of data.
图5为本发明实施例一种音视频实时传输方法的流程图。Fig. 5 is a flow chart of an audio and video real-time transmission method according to an embodiment of the present invention.
音视频的实时传输包括对视频数据的实时传输和对音频数据的实时传输,因此需要将视频原始流及音频原始流分别打包为分组的视频原始流和分组的音频原始流;然后将分组的视频原始流,以及分组的音频原始流复用后存储为节目切片;除此之外,本实施例还需要对节目关联表和节目映射表分别进行加密后打包,具体如下:The real-time transmission of audio and video includes real-time transmission of video data and real-time transmission of audio data, so it is necessary to package the video original stream and audio original stream into packetized video original stream and packetized audio original stream respectively; The original stream and the grouped audio original stream are multiplexed and stored as program slices; in addition, this embodiment also needs to encrypt and package the program association table and program mapping table respectively, as follows:
分组的视频原始流的打包的具体步骤如下:The specific steps of packaging the original video stream of the packet are as follows:
S101:将视频数据编码形成视频原始流(Elementary Stream,ES);S101: Encode the video data to form an original video stream (Elementary Stream, ES);
视频原始流是由编码器输出的原始基础码流,只含有解码器所必需的,并与原始图像相接近的信息。编码后的视频原始流可以是MPEG-2或MPEG-4格式,还可以是H.264格式或者其他格式,本发明对此不作限定。The original video stream is the original basic bit stream output by the encoder, which only contains the information necessary for the decoder and is close to the original image. The encoded original video stream may be in MPEG-2 or MPEG-4 format, and may also be in H.264 format or other formats, which is not limited in the present invention.
S102:将视频原始流打包为分组的视频原始流(Packet Elemental Stream,PES);S102: Pack the original video stream into a packetized original video stream (Packet Elemental Stream, PES);
分组的视频原始流,是以分割的数据包形式存在,主要是在视频原始流上加了时间戳等对数据帧的说明信息,分组的视频原始流提供标准的包头和打包方法,并提供解码的时间标志。The grouped original video stream exists in the form of divided data packets, mainly adding time stamps and other description information to the data frame on the original video stream. The grouped original video stream provides standard packet headers and packaging methods, and provides decoding time sign.
分组的音频原始流的打包的具体步骤如下:The specific steps of packaging the packetized audio original stream are as follows:
S201:将音频数据编码形成音频原始流;S201: Encode the audio data to form an audio original stream;
数字音频信号如果不加压缩地直接进行传送,将会占用极大的带宽,因此需要采用音频压缩技术对音频数据进行处理,才能有效地传输音频数据。本步骤中的音频编码方式可以是MPEG-1音频编码,也可以是MPEG-2 AAC(Advanced Audio Coding)编码,本发明对此不作限定。If the digital audio signal is directly transmitted without compression, it will occupy a huge bandwidth. Therefore, it is necessary to use audio compression technology to process the audio data in order to effectively transmit the audio data. The audio coding method in this step may be MPEG-1 audio coding, or MPEG-2 AAC (Advanced Audio Coding) coding, which is not limited in the present invention.
S202:将视频原始流打包为分组的音频原始流。S202: Pack the original video stream into packetized audio original streams.
音频分组器202把音频原始流分割成段或者是打包成组,并加上相应的头文件打包形成分组的音频原始流,音频原始流的包和包之间可以是不连续的。The audio packetizer 202 divides the audio original stream into segments or packs them into groups, and adds corresponding header files to pack into grouped audio original streams. The packets of the audio original stream may be discontinuous.
在打包完成分组的视频原始流、分组的音频原始流之后,进入步骤S300;After packing the original video stream and the original audio stream of the packet, enter step S300;
S300:将分组的视频原始流和分组的音频原始流复用后存储为节目切片。S300: Multiplex the packetized original video stream and the packetized audio original stream and store them as program slices.
S400为节目特定信息切片的打包,具体为:对节目特定信息进行加密,并存储为节目特定信息切片。对节目特定信息进行加密包括对节目关联表和节目映射表加密。S400 is the packaging of program-specific information slices, specifically: encrypting program-specific information and storing it as program-specific information slices. Encrypting the program specific information includes encrypting the program association table and the program mapping table.
最后进入步骤S500:传输节目特定信息及节目切片。Finally, enter step S500: transmit program specific information and program slices.
图6为本发明实施例一种音视频实时播放方法的流程图。FIG. 6 is a flowchart of a method for real-time audio and video playback according to an embodiment of the present invention.
S301:下载加密后的节目特定信息切片;加密后的节目特定信息切片包括加密后的节目关联表及加密后的节目映射表。S301: Download encrypted program-specific information slices; the encrypted program-specific information slices include encrypted program association tables and encrypted program mapping tables.
S302:解密所述加密后的节目特定信息切片,得到解密后的节目特定信息;具体而言,解密加密后的节目特定信息切片包括:解密加密后的节目关联表及加密后的节目映射表。S302: Decrypt the encrypted program-specific information slice to obtain decrypted program-specific information; specifically, decrypting the encrypted program-specific information slice includes: decrypting an encrypted program association table and an encrypted program mapping table.
S303:下载节目切片,并根据所述解密后的节目特定信息解析所述节目切片。解析过程具体为:S303: Download the program slice, and analyze the program slice according to the decrypted program specific information. The analysis process is specifically:
首先,解析节目关联表,以获取节目映射表的包标示符;在本实施例中首先解析包标示符为0的节目关联表,以获取节目映射表的包标示符。Firstly, the program association table is analyzed to obtain the package identifier of the program mapping table; in this embodiment, the program association table whose package identifier is 0 is first analyzed to obtain the package identifier of the program mapping table.
然后,根据映射表的包标示符搜索节目映射表;在本实施例中,节目映射表的数量等于节目的数量。Then, the program mapping table is searched according to the packet identifier of the mapping table; in this embodiment, the number of program mapping tables is equal to the number of programs.
其次,根据节目映射表搜索视频数据的包标示符及音频数据的包标示符;在本实施例中,搜索视频数据的包标示符及音频数据的包标示符就是为了获取视频数据及音频数据。Secondly, search the packet identifier of the video data and the packet identifier of the audio data according to the program mapping table; in this embodiment, the packet identifier of the video data and the packet identifier of the audio data are searched to obtain the video data and the audio data.
最后,根据视频数据的包标示符及音频数据的包标示符,解析视频数据及音频数据。Finally, the video data and the audio data are analyzed according to the packet identifier of the video data and the packet identifier of the audio data.
上述解析过程是由接收端完成,接收端通常为消费性电子产品,可以为智能电视、机顶盒、投影仪、视频播放器、个人计算机,智能手机,平板电脑等。The above parsing process is completed by the receiving end, which is usually a consumer electronic product, such as a smart TV, a set-top box, a projector, a video player, a personal computer, a smart phone, a tablet computer, etc.
图7为本发明实施例一种音视频实时传输装置的结构示意图。FIG. 7 is a schematic structural diagram of an audio and video real-time transmission device according to an embodiment of the present invention.
本发明实施例的音视频实时传输装置10包括:视频编码器101、音频编码器201、视频分组器102、音频分组器202、复用器300、加密模块400,以及传输模块500。The real-time audio and video transmission device 10 of the embodiment of the present invention includes: a video encoder 101 , an audio encoder 201 , a video packetizer 102 , an audio packetizer 202 , a multiplexer 300 , an encryption module 400 , and a transmission module 500 .
由于采集到的视频数据及音频数据均为模拟数据,因此需要进行抽样、量化及压缩编码形成视频原始流及音频原始流,视频原始流及音频原始流是不分段的连续码流。Since the collected video data and audio data are all analog data, sampling, quantization and compression encoding are required to form the original video stream and the original audio stream. The original video stream and the original audio stream are unsegmented continuous code streams.
视频编码器101用于将视频数据编码形成视频原始流。在本实施例中,视频原始流包括多个访问单元,每一个访问单元是一幅图像的编码数据。本发明的视频编码方式可以采用变换编码、熵编码、运动估计和运动补偿,或者是混合编码方式进行编码,本发明对此不作限定。The video encoder 101 is used to encode video data to form an original video stream. In this embodiment, the original video stream includes multiple access units, and each access unit is the encoded data of an image. The video coding method of the present invention may adopt transform coding, entropy coding, motion estimation and motion compensation, or a mixed coding method for coding, which is not limited in the present invention.
音频编码器201用于将音频数据分别编码形成音频原始流。在本实施例中,数字音频信号如果不加压缩地直接进行传送,将会占用极大的带宽,因此需要采用音频压缩技术对音频数据进行处理,才能有效地传输音频数据。数字音频压缩编码在保证信号在听觉方面不产生失真的前提下,对音频数据信号进行尽可能大的压缩。数字音频压缩编码采取去除声音信号中冗余成分的方法来实现。本发明的音频编码方式可以是波形编码、参数编码,或者混合编码,本发明对此不作限定。The audio encoder 201 is used for respectively encoding audio data to form an audio original stream. In this embodiment, if the digital audio signal is directly transmitted without compression, it will occupy a huge bandwidth. Therefore, it is necessary to use audio compression technology to process the audio data in order to effectively transmit the audio data. Digital audio compression coding compresses the audio data signal as much as possible on the premise of ensuring that the signal does not produce distortion in the auditory sense. Digital audio compression coding is realized by removing redundant components in the sound signal. The audio coding method of the present invention may be waveform coding, parameter coding, or mixed coding, which is not limited in the present invention.
视频分组器102用于将视频原始流打包为分组的视频原始流。详而言之,视频分组器102把视频原始流分割成段或者是打包成组,并加上相应的头文件打包形成分组的视频原始流,视频原始流的包和包之间可以是不连续的。The video packetizer 102 is used for packetizing the video original stream into grouped video original streams. In detail, the video packetizer 102 divides the original video stream into segments or packs it into groups, and adds corresponding header files to pack the original video stream into groups, and the packets of the original video stream may be discontinuous of.
音频分组器202用于将音频原始流打包为分组的音频原始流。详而言之,音频分组器202把音频原始流分割成段或者是打包成组,并加上相应的头文件打包形成分组的音频原始流,音频原始流的包和包之间可以是不连续的。The audio packetizer 202 is used to packetize the audio original stream into grouped audio original streams. In detail, the audio packetizer 202 divides the audio original stream into segments or packs them into groups, and adds corresponding header files to pack into grouped audio original streams. The packets of the audio original stream may be discontinuous of.
复用器300用于将分组的视频原始流以及分组的音频原始流复用后存储为节目切片,以及传输节目特定信息及节目切片。在本实施例中,复用器300在传输时将节目关联表、节目映射表、分组的视频原始流,以及分组的音频原始流打包成固定长度为188字节的切片。The multiplexer 300 is used to multiplex the packetized original video stream and the packetized audio original stream and store them as program slices, and transmit program specific information and program slices. In this embodiment, the multiplexer 300 packs the program association table, program mapping table, packetized video original stream, and packetized audio original stream into slices with a fixed length of 188 bytes during transmission.
加密模块400用于对节目特定信息进行加密,并存储为节目特定信息切片。本实施例中对节目特定信息进行加密,包括对节目关联表和节目映射表加密。The encryption module 400 is used to encrypt program specific information and store it as a program specific information slice. In this embodiment, program-specific information is encrypted, including program association table and program mapping table.
传输模块500用于传输节目特定信息及节目切片。The transmission module 500 is used for transmitting program specific information and program slices.
本发明实施例提供的上述音视频实时传输装置100在实际应用中可以具体应用于电子设备中,可以通过硬件处理器(hardware processor)来实现相关功能模块,该电子设备通常为各类视频服务器。The audio and video real-time transmission device 100 provided by the embodiment of the present invention can be specifically applied to electronic equipment in practical applications, and related functional modules can be implemented by hardware processors. The electronic equipment is usually various types of video servers.
图8为本发明实施例一种音视频实时播放装置的结构示意图。FIG. 8 is a schematic structural diagram of an audio and video real-time playback device according to an embodiment of the present invention.
本发明实施例一种音视频实时播放装置400包括第一下载模块401、解密模块402,以及第二下载模块403。An audio and video real-time playback device 400 according to an embodiment of the present invention includes a first download module 401 , a decryption module 402 , and a second download module 403 .
第一下载模块401用于下载加密后的节目特定信息切片;加密后的节目特定信息切片包括加密后的节目关联表及加密后的节目映射表。The first download module 401 is used for downloading the encrypted program-specific information slice; the encrypted program-specific information slice includes an encrypted program association table and an encrypted program mapping table.
解密模块402用于解密加密后的节目特定信息切片,得到解密后的节目特定信息;由于加密后的节目特定信息切片包括加密后的节目关联表及加密后的节目映射表,因此解密模块402还用于解密加密后的节目关联表及加密后的节目映射表。The decryption module 402 is used to decrypt the encrypted program-specific information slice to obtain the decrypted program-specific information; since the encrypted program-specific information slice includes an encrypted program association table and an encrypted program mapping table, the decryption module 402 also It is used to decrypt the encrypted program association table and the encrypted program mapping table.
第二下载模块403用于下载节目切片,并根据解密后的节目特定信息解析节目切片。The second downloading module 403 is used for downloading the program slice, and analyzing the program slice according to the decrypted program specific information.
通过本发明实施例的上述技术方案,不需要周期性的插入节目关联表和节目映射表,而仅需要把节目关联表和节目映射表单独打包并加密,就可以达到既可保持与现有技术中的传输流兼容,又同时减少传输流中的冗余数据的效果。Through the above-mentioned technical solution of the embodiment of the present invention, it is not necessary to periodically insert the program association table and the program mapping table, but only need to package and encrypt the program association table and the program mapping table separately, so as to maintain the same level as the prior art The transport streams in the transport stream are compatible, and at the same time reduce the effect of redundant data in the transport stream.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and 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 it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative efforts.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims (14)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510886024.6A CN105915493A (en) | 2015-12-03 | 2015-12-03 | Audio and video real-time transmission method and device and audio and video real-time playing method and device |
PCT/CN2016/096990 WO2017092434A1 (en) | 2015-12-03 | 2016-08-26 | Method and device for audio/video real-time transmission, method and device for audio/video real-time playback |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510886024.6A CN105915493A (en) | 2015-12-03 | 2015-12-03 | Audio and video real-time transmission method and device and audio and video real-time playing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105915493A true CN105915493A (en) | 2016-08-31 |
Family
ID=56744049
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510886024.6A Pending CN105915493A (en) | 2015-12-03 | 2015-12-03 | Audio and video real-time transmission method and device and audio and video real-time playing method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105915493A (en) |
WO (1) | WO2017092434A1 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107342098A (en) * | 2017-07-20 | 2017-11-10 | 青岛海信电器股份有限公司 | Audio frequency playing method and device |
CN109561345A (en) * | 2018-12-14 | 2019-04-02 | 上海文广科技(集团)有限公司 | Digital movie packaging method based on AVS+ coded format |
CN110809191A (en) * | 2019-10-08 | 2020-02-18 | 烽火通信科技股份有限公司 | Video tamper-proofing method and system based on index verification and real-time package conversion |
CN111885412A (en) * | 2020-07-06 | 2020-11-03 | 深圳市宝泽科技有限公司 | HDMI signal screen transmission method and wireless screen transmission device |
CN112954673A (en) * | 2021-02-03 | 2021-06-11 | 深圳市长丰影像器材有限公司 | Encryption method for wireless microphone channel |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114449349B (en) * | 2020-10-30 | 2023-07-25 | 深圳Tcl新技术有限公司 | Program recording method, device, equipment and computer readable storage medium |
CN114640866B (en) * | 2022-05-18 | 2022-08-16 | 电子科技大学成都学院 | Multichannel encryption method, device and system based on random dynamics |
CN115412741A (en) * | 2022-08-31 | 2022-11-29 | 北京奇艺世纪科技有限公司 | Data packaging method, data analyzing method, data packaging device, data analyzing device, electronic equipment and readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1623327A (en) * | 2002-01-02 | 2005-06-01 | 索尼电子有限公司 | Partial encryption and PID mapping |
CN101360226A (en) * | 2007-12-14 | 2009-02-04 | 华亚微电子(上海)有限公司 | Transmission control method of digital television transmission stream and apparatus thereof |
CN102547401A (en) * | 2010-12-28 | 2012-07-04 | 索尼公司 | On-demand switched content encryption |
CN104918108A (en) * | 2015-06-09 | 2015-09-16 | 烽火通信科技股份有限公司 | Video accurate positioning device and method based on HLS (HTTP Live Streaming) protocol |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2034729A2 (en) * | 2007-06-21 | 2009-03-11 | Panasonic Corporation | Transmitting apparatus, receiving apparatus, and transmitting and receiving apparatus |
-
2015
- 2015-12-03 CN CN201510886024.6A patent/CN105915493A/en active Pending
-
2016
- 2016-08-26 WO PCT/CN2016/096990 patent/WO2017092434A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1623327A (en) * | 2002-01-02 | 2005-06-01 | 索尼电子有限公司 | Partial encryption and PID mapping |
CN101360226A (en) * | 2007-12-14 | 2009-02-04 | 华亚微电子(上海)有限公司 | Transmission control method of digital television transmission stream and apparatus thereof |
CN102547401A (en) * | 2010-12-28 | 2012-07-04 | 索尼公司 | On-demand switched content encryption |
CN104918108A (en) * | 2015-06-09 | 2015-09-16 | 烽火通信科技股份有限公司 | Video accurate positioning device and method based on HLS (HTTP Live Streaming) protocol |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107342098A (en) * | 2017-07-20 | 2017-11-10 | 青岛海信电器股份有限公司 | Audio frequency playing method and device |
CN107342098B (en) * | 2017-07-20 | 2019-11-26 | 青岛海信电器股份有限公司 | Audio frequency playing method and device |
CN109561345A (en) * | 2018-12-14 | 2019-04-02 | 上海文广科技(集团)有限公司 | Digital movie packaging method based on AVS+ coded format |
CN109561345B (en) * | 2018-12-14 | 2021-08-03 | 上海文广科技(集团)有限公司 | Digital movie packaging method based on AVS + coding format |
CN110809191A (en) * | 2019-10-08 | 2020-02-18 | 烽火通信科技股份有限公司 | Video tamper-proofing method and system based on index verification and real-time package conversion |
CN110809191B (en) * | 2019-10-08 | 2022-01-07 | 烽火通信科技股份有限公司 | Video tamper-proofing method and system based on index verification and real-time package conversion |
CN111885412A (en) * | 2020-07-06 | 2020-11-03 | 深圳市宝泽科技有限公司 | HDMI signal screen transmission method and wireless screen transmission device |
CN111885412B (en) * | 2020-07-06 | 2022-08-09 | 深圳市宝泽科技有限公司 | HDMI signal screen transmission method and wireless screen transmission device |
CN112954673A (en) * | 2021-02-03 | 2021-06-11 | 深圳市长丰影像器材有限公司 | Encryption method for wireless microphone channel |
CN112954673B (en) * | 2021-02-03 | 2023-08-01 | 深圳市长丰影像器材有限公司 | Encryption method for wireless microphone channel |
Also Published As
Publication number | Publication date |
---|---|
WO2017092434A1 (en) | 2017-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105915493A (en) | Audio and video real-time transmission method and device and audio and video real-time playing method and device | |
CN108306900B (en) | Apparatus for sending media data in a multimedia transmission system | |
CN105009595B (en) | Sending device, sending method, receiving device, and receiving method | |
KR102616590B1 (en) | Transmitting device, transmitting method, receiving device, and receiving method | |
KR102117445B1 (en) | Method and apparatus for packet header compression | |
JP7418533B2 (en) | System and method for protecting elementary bitstreams incorporating independently encoded tiles | |
TWI502485B (en) | Method, apparatus and computer readable storage medium for displaying and transmitting media information | |
CN109413447B (en) | ISO-BMFF event box bearer in MPEG-2 transport stream | |
US20060036551A1 (en) | Protecting elementary stream content | |
EP1913776A2 (en) | Protecting elementary stream content | |
KR101145782B1 (en) | Method for lightweight video contents encryption and decryption to provide mobile contents service | |
US20180302674A1 (en) | File generating method and file generating apparatus | |
US10237196B2 (en) | Apparatus for transmitting broadcast signal, apparatus for receiving broadcast signal, method for transmitting broadcast signal and method for receiving broadcast signal | |
CN105916011A (en) | Video real-time playing method and device | |
KR100840200B1 (en) | Packaging / unpackaging device and method thereof for protecting H.264 format video files | |
CN105898353A (en) | Real-time audio and video transmission method and device, transmission stream packaging method and multiplexer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20160831 |
|
WD01 | Invention patent application deemed withdrawn after publication |