[go: up one dir, main page]

CN103179435B - A kind of multi-path video data multiplexing method and device - Google Patents

A kind of multi-path video data multiplexing method and device Download PDF

Info

Publication number
CN103179435B
CN103179435B CN201310062468.9A CN201310062468A CN103179435B CN 103179435 B CN103179435 B CN 103179435B CN 201310062468 A CN201310062468 A CN 201310062468A CN 103179435 B CN103179435 B CN 103179435B
Authority
CN
China
Prior art keywords
file
video data
multiplexed
data
multiplexing
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.)
Expired - Fee Related
Application number
CN201310062468.9A
Other languages
Chinese (zh)
Other versions
CN103179435A (en
Inventor
张德岭
王天星
王文军
李伟东
李红艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Shibo Digital TV Technology Co Ltd
Original Assignee
Beijing Shibo Digital TV Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Shibo Digital TV Technology Co Ltd filed Critical Beijing Shibo Digital TV Technology Co Ltd
Priority to CN201310062468.9A priority Critical patent/CN103179435B/en
Publication of CN103179435A publication Critical patent/CN103179435A/en
Application granted granted Critical
Publication of CN103179435B publication Critical patent/CN103179435B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

本发明公开了一种多路视频数据复用方法及装置,该方法包括:实时接收多路视频数据;创建一个文件,限定该文件的最大存储容量,并将该文件设定为当前文件;每隔固定时间判断该固定时间内接收的多路视频数据是否为空;如果否,对固定时间内接收的多路视频数据进行复用封装,生成一个复用数据块;判断当前文件的剩余存储容量是否大于等于复用数据块的存储容量;如果是,将复用数据块中的数据写入至当前文件;如果否,另外创建一个新的文件,限定新的文件的最大存储容量,重新设定新的文件为当前文件,将复用数据块中的数据写入至当前文件。本发明提出的技术方案能够有效实现多路视频数据的同步,使得播放器播放多路视频数据时的处理逻辑简单化。

The invention discloses a multi-channel video data multiplexing method and device. The method includes: receiving multiple video data in real time; creating a file, limiting the maximum storage capacity of the file, and setting the file as the current file; Determine whether the multi-channel video data received within the fixed time is empty at a fixed time interval; if not, multiplex and encapsulate the multi-channel video data received within the fixed time to generate a multiplexed data block; determine the remaining storage capacity of the current file Whether it is greater than or equal to the storage capacity of the multiplexed data block; if yes, write the data in the multiplexed data block to the current file; if not, create a new file, limit the maximum storage capacity of the new file, and reset The new file is the current file, and the data in the multiplexed data block is written into the current file. The technical solution proposed by the invention can effectively realize the synchronization of multi-channel video data, and simplify the processing logic when the player plays the multi-channel video data.

Description

一种多路视频数据复用方法及装置A method and device for multiplexing multiplexed video data

技术领域technical field

本发明涉及视频处理技术领域,尤其涉及一种多路视频数据复用方法及装置。The present invention relates to the technical field of video processing, in particular to a method and device for multiplexing multiplexed video data.

背景技术Background technique

目前,视频监控作为协助公共安全部门打击犯罪、维持社会安定的重要技术手段,被广泛应用于安防领域。视频监控能够提供实时监视,并对被监视的画面进行录像存储、事后回放。审讯系统作为视频监控的一个应用,往往需要多台摄像机进行全方位实时监控和录像,多台摄像机视频数据的同步是审讯系统中的重要指标。At present, video surveillance is widely used in the field of security as an important technical means to assist public security departments in combating crimes and maintaining social stability. Video surveillance can provide real-time surveillance, record and store the monitored images, and play them back afterwards. As an application of video surveillance, the interrogation system often requires multiple cameras for all-round real-time monitoring and recording. The synchronization of video data of multiple cameras is an important indicator in the interrogation system.

在现有技术中,审讯系统通常是将多台摄像机采集的视频数据同步刻录到根光盘中。其中,根光盘中存储了多个视频文件,每个文件对应一台摄像机采集的视频数据,即一路视频数据。当要求同步播放根光盘中多路视频数据时,播放器需同时读取多个视频文件进行回放。由此可见,现有的技术方案对播放器的要求比较高,播放器承担着多路视频数据的同步任务,快进快退时需要对多个视频文件进行处理,工作任务繁重,且难以做到严格同步。特别的,当多台摄像机的码率不同时,播放器的处理逻辑会更加复杂,同时对播放器的播放效率也会产生影响。In the prior art, the interrogation system usually burns the video data collected by multiple cameras into the root CD synchronously. Wherein, a plurality of video files are stored in the root CD, and each file corresponds to video data collected by a camera, that is, one channel of video data. When it is required to play multiple channels of video data in the root disc synchronously, the player needs to read multiple video files at the same time for playback. It can be seen that the existing technical solutions have relatively high requirements on the player, and the player is responsible for the synchronization task of multi-channel video data. When fast forwarding and rewinding, multiple video files need to be processed. to strict synchronization. In particular, when multiple cameras have different bit rates, the processing logic of the player will be more complicated, and at the same time, the playback efficiency of the player will also be affected.

发明内容Contents of the invention

本发明的目的在于提出一种多路视频数据复用方法及装置,能够有效实现多台摄像机所采集的视频数据的同步,使播放器的处理逻辑简单化,提高播放器的效率,同时还可以承载一些用户自定义的描述性信息,对多台摄像机采集的视频数据进行说明。The purpose of the present invention is to propose a multi-channel video data multiplexing method and device, which can effectively realize the synchronization of video data collected by multiple cameras, simplify the processing logic of the player, improve the efficiency of the player, and simultaneously Carry some user-defined descriptive information to explain the video data collected by multiple cameras.

为达此目的,本发明采用以下技术方案:For reaching this purpose, the present invention adopts following technical scheme:

一种多路视频数据复用方法,所述方法包括:A method for multiplexing multiplexed video data, the method comprising:

S1:实时接收多路视频数据;S1: Receive multiple channels of video data in real time;

S2:创建一个文件,限定所述文件的最大存储容量,并将所述文件设定为当前文件;S2: Create a file, limit the maximum storage capacity of the file, and set the file as the current file;

S3:待固定时间过后,判断所述固定时间内接收的多路视频数据是否为空;S3: after a fixed time, judge whether the multi-channel video data received within the fixed time is empty;

S4:当所述固定时间内接收的多路视频数据不为空时,对所述固定时间内接收的多路视频数据进行复用封装,生成一个复用数据块;其中,所述复用数据块包括复用数据块标识符、复用数据块内各路视频数据的播放时间、顺序存储的所述固定时间内接收的各路视频数据;S4: When the multi-channel video data received within the fixed time is not empty, multiplex and encapsulate the multiple video data received within the fixed time to generate a multiplexed data block; wherein the multiplexed data The block includes a multiplexed data block identifier, the play time of each channel of video data in the multiplexed data block, and each channel of video data received within the fixed time that is sequentially stored;

S5:判断所述当前文件的剩余存储容量是否大于等于所述复用数据块的存储容量;如果是,执行步骤S6,否则,执行步骤S7;S5: Determine whether the remaining storage capacity of the current file is greater than or equal to the storage capacity of the multiplexed data block; if yes, perform step S6, otherwise, perform step S7;

S6:将所述复用数据块中的数据写入至所述当前文件,返回至所述步骤S3;S6: Write the data in the multiplexed data block to the current file, and return to the step S3;

S7:另外创建一个新的文件,同时限定所述新的文件的最大存储容量,并设定所述新的文件为当前文件,将所述复用数据块中的数据写入至所述当前文件,返回至所述步骤S3。S7: Create a new file in addition, limit the maximum storage capacity of the new file at the same time, and set the new file as the current file, and write the data in the multiplexed data block to the current file , return to the step S3.

进一步地,所述方法还包括:Further, the method also includes:

根据用户输入参数,生成与所述当前文件相对应的文件说明信息;Generate file description information corresponding to the current file according to user input parameters;

将所述生成的文件说明信息写入至所述当前文件。Writing the generated file specification information into the current file.

进一步地,所述文件说明信息包括文件名称、区域标识符、各产品标识符。Further, the file description information includes file name, area identifier, and each product identifier.

进一步地,所述固定时间优选为l00ms。Further, the fixed time is preferably 100ms.

进一步地,所述复用数据块还包括复用数据块长度、密钥数据;Further, the multiplexed data block also includes the length of the multiplexed data block and key data;

其中,所述密钥数据为当所述复用数据块中存在加密的视频数据时的解密数据。Wherein, the key data is decrypted data when encrypted video data exists in the multiplexed data block.

对应地,本发明还提供了一种多路视频数据复用装置,所述装置包括:Correspondingly, the present invention also provides a multiplex video data multiplexing device, the device comprising:

视频数据接收模块,用于实时接收多路视频数据;The video data receiving module is used to receive multi-channel video data in real time;

文件创建模块,用于创建一个文件,限定所述文件的最大存储容量,并将所述文件设定为当前文件;A file creation module, configured to create a file, limit the maximum storage capacity of the file, and set the file as the current file;

视频数据判断模块,用于每隔固定时间后,判断所述固定时间内接收的多路视频数据是否为空;The video data judging module is used to judge whether the multi-channel video data received within the fixed time is empty after every fixed time;

复用封装模块,用于当所述固定时间内接收的多路视频数据不为空时,对所述固定时间内接收的多路视频数据进行复用封装,生成一个复用数据块;A multiplexing encapsulation module, used to multiplex and encapsulate the multiplexed video data received within the fixed time period when the multiplexed video data received within the fixed time period is not empty, to generate a multiplexed data block;

文件存储容量判断模块,用于判断所述当前文件的剩余存储容量是否大于等于所述复用数据块的存储容量;A file storage capacity judging module, configured to judge whether the remaining storage capacity of the current file is greater than or equal to the storage capacity of the multiplexed data block;

第一复用数据写入模块,用于当所述当前文件的剩余存储容量大于等于复用数据块的存储容量时,将所述复用数据块中的数据,写入至所述当前文件中;The first multiplexed data writing module is used to write the data in the multiplexed data block into the current file when the remaining storage capacity of the current file is greater than or equal to the storage capacity of the multiplexed data block ;

第二复用数据写入模块,用于当所述当前文件的剩余存储容量小于所述复用数据块的存储容量时,通知所述文件创建模块另外创建一个新的文件、限定所述新的文件的最大存储容量、设定所述新的文件为当前文件;将所述复用数据块中的数据写入至所述当前文件。The second multiplexing data writing module is used to notify the file creation module to create a new file and limit the new file when the remaining storage capacity of the current file is less than the storage capacity of the multiplexing data block. The maximum storage capacity of the file, setting the new file as the current file; writing the data in the multiplexed data block to the current file.

进一步地,所述装置还包括文件说明信息写入模块,用于Further, the device also includes a file description information writing module for

根据用户输入参数,生成与所述当前文件相对应的文件说明信息;Generate file description information corresponding to the current file according to user input parameters;

将所述生成的文件说明信息写入至所述当前文件。Writing the generated file specification information into the current file.

进一步地,所述文件说明信息包括文件名称、区域标识符、各产品标识符。Further, the file description information includes file name, area identifier, and each product identifier.

进一步地,所述固定时间优选为100ms。Further, the fixed time is preferably 100ms.

进一步地,所述复用数据块还包括复用数据块长度、密钥数据;Further, the multiplexed data block also includes the length of the multiplexed data block and key data;

其中,所述密钥数据为当所述复用数据块中存在加密的视频数据时的解密数据。Wherein, the key data is decrypted data when encrypted video data exists in the multiplexed data block.

本发明的有益技术效果是:The beneficial technical effect of the present invention is:

本发明提出的一种多路视频数据复用方法及装置,每隔固定时间将实时接收的多路视频数据复用封装成一个复用数据块后写入至同一个文件,且对每一复用数据块内的各路视频数据进行顺序存储,不会出现多路视频数据间的相互影响,能够有效实现后续多路视频数据的同步播放,使得播放器在播放多路视频数据时的处理逻辑简单化,提高播放器的效率,无需对多个视频文件进行繁琐的加工处理,同时,还可以承载一些用户自定义的对文件说明信息,满足了用户需求。A method and device for multiplexing multiplexed video data proposed by the present invention multiplexes and encapsulates multiplexed video data received in real time into a multiplexed data block at regular intervals and writes it into the same file, and for each multiplexed Sequential storage of each channel of video data in the data block does not cause mutual influence between multiple channels of video data, and can effectively realize the synchronous playback of subsequent multiple channels of video data, so that the processing logic of the player when playing multiple channels of video data Simplification improves the efficiency of the player and does not require cumbersome processing of multiple video files. At the same time, it can also carry some user-defined file description information to meet user needs.

附图说明Description of drawings

图1是本发明实施例一提供的一种多路视频数据复用方法流程示意图;FIG. 1 is a schematic flowchart of a method for multiplexing multiplexed video data provided by Embodiment 1 of the present invention;

图2是本发明实施例二提供的一种多路视频数据复用装置示意图。FIG. 2 is a schematic diagram of a device for multiplexing multiple channels of video data according to Embodiment 2 of the present invention.

具体实施方式detailed description

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部内容。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, only parts related to the present invention are shown in the drawings but not all content.

实施例一Embodiment one

图1是本发明实施例一提供的一种多路视频数据复用方法流程示意图。参见图1,一种多路视频数据复用方法包括:FIG. 1 is a schematic flowchart of a method for multiplexing multiple channels of video data provided by Embodiment 1 of the present invention. Referring to Fig. 1, a method for multiplexing multiplexed video data includes:

S101:实时接收多台摄像机采集的视频数据,即多路视频数据。S101: Receive video data collected by multiple cameras in real time, that is, multiple channels of video data.

在步骤S101中,可以先向多台摄像机进行注册,待注册成功,并经多台摄像机验证通过后,从多台摄像机实时接收多路视频数据。通常情况下,多路视频数据均来自于同一个区域,例如多路视频数据均为来自于北京市海淀区某一公安局审讯系统的监控录像。In step S101, it is possible to first register with multiple cameras, and after successful registration and verification by multiple cameras, multiple channels of video data are received from multiple cameras in real time. Usually, multiple channels of video data come from the same area. For example, multiple channels of video data come from the surveillance video of the interrogation system of a public security bureau in Haidian District, Beijing.

S102:创建一个文件,对该文件的最大存储容量做限定,并设定该文件为当前文件;其中,最大存储容量用于描述该文件最大可以存储多少大小的内容数据,例如25M。S102: Create a file, limit the maximum storage capacity of the file, and set the file as the current file; wherein, the maximum storage capacity is used to describe the maximum size of content data that the file can store, for example, 25M.

S103:待固定时间过后,判断所述固定时间内接收的多路视频数据是否为空,如果是,执行步骤S104,否则执行步骤S105。优选地,固定时间选用100ms。S103: After a fixed time elapses, determine whether the multi-channel video data received within the fixed time is empty, if yes, perform step S104, otherwise, perform step S105. Preferably, the fixed time is 100ms.

S104:多路视频数据均已接收完毕,不再继续执行以下各步骤,结束。S104: Multiple channels of video data have been received, and the following steps are not continued, and the process ends.

S105:对所述固定时间内接收的多路视频数据进行复用封装,生成一个复用数据块Data Block。所述复用数据块Data Block包括复用数据块标识符、复用数据块内各路视频数据的播放时间、顺序存储的所述固定时间内接收的各路视频数据。S105: Multiplexing and encapsulating the multiple channels of video data received within the fixed time to generate a multiplexed data block Data Block. The multiplexed data block Data Block includes the multiplexed data block identifier, the play time of each channel of video data in the multiplexed data block, and the sequentially stored video data of each channel received within the fixed time.

以15路视频数据为例,在对所述固定时间内接收的15路视频数据进行复用封装时,其封装格式(复用数据块Data Block的格式)优选为:Taking 15 channels of video data as an example, when multiplexing and encapsulating the 15 channels of video data received within the fixed time, the encapsulation format (the format of the multiplexed data block Data Block) is preferably:

其中,M/O中的M代表必选项,O代表可选项;必选项表示此项数据不可以为空,可选项表示此项数据可以为空,也可以不为空;Among them, M in M/O represents a mandatory item, and O represents an optional item; a mandatory item means that this data cannot be empty, and an optional item means that this data can be empty or not;

Time用于表示本复用数据块Data Block各路视频数据的播放时间,与步骤S103中固定时间相同;系统待各路视频数据播放的时间达到播放时间Time时,对各路视频数据进行复用封装;Time is used to represent the play time of each road video data of this multiplexing data block Data Block, and is identical with the fixed time in step S103; encapsulation;

Ind用于指示第i路视频数据是否不为空;当第i路视频数据不为空时,第i路视频数据的Ind为1,第i路视频数据长度Length_data、第i路视频数据Data存在,不为空,否则当第i路视频数据为空时,第i路视频数据的Ind为0,第i路视频数据长度Length_data、第i路视频数据Data不存在,为空;Ind is used to indicate whether the i-th video data is not empty; when the i-th video data is not empty, the Ind of the i-th video data is 1, the i-th video data length Length_data, and the i-th video data Data exist , is not empty, otherwise when the i-th road video data is empty, the Ind of the i-th road video data is 0, the i-th road video data length Length_data, the i-th road video data Data do not exist, and are empty;

Ind_ecm用于指示是否存在密钥数据,密钥数据为当本复用数据块Data Block中存在加密的视频数据时的解密数据;当本复用数据块Data Block中存在加密的视频数据时,Ind_ecm为1,密钥数据长度Length_ecm、密钥数据Data_ecm存在,不为空;当本复用数据块Data Block中不存在加密的视频数据时,Ind_ecm为0时,密钥数据长度Length_ecm、密钥数据Data_ecm不存在,为空;Ind_ecm is used to indicate whether there is key data, and the key data is the decrypted data when there is encrypted video data in the multiplexing data block Data Block; when there is encrypted video data in the multiplexing data block Data Block, Ind_ecm is 1, the key data length Length_ecm and key data Data_ecm exist and are not empty; when there is no encrypted video data in the multiplexed data block Data Block, when Ind_ecm is 0, the key data length Length_ecm, key data Data_ecm does not exist and is empty;

CRC检验是为了保证本复用数据块中数据的完整性。The CRC check is to ensure the integrity of the data in the multiplexed data block.

S106:判断当前文件的剩余存储容量是否大于等于步骤S105复用封装后的复用数据块Data Block的存储容量,如果是,执行步骤S107,否则,执行步骤S108。其中,当前文件的剩余存储容量为当前文件的最大存储容量与当前文件中已存数据的存储容量之差。S106: Determine whether the remaining storage capacity of the current file is greater than or equal to the storage capacity of the multiplexed data block Data Block after multiplexing and encapsulation in step S105, if yes, perform step S107, otherwise, perform step S108. Wherein, the remaining storage capacity of the current file is the difference between the maximum storage capacity of the current file and the storage capacity of data stored in the current file.

S107:将步骤S105复用封装后的复用数据块Data Block中的数据,写入至设定的当前文件中,返回至步骤S103。S107: Write the data in the multiplexed data block Data Block multiplexed and encapsulated in step S105 into the set current file, and return to step S103.

S108:另外创建一个新的文件,同时对该新的文件的最大存储容量也做限定,并设定该新的文件为当前文件,将步骤S105复用封装后的复用数据块Data Block中的数据,写入至设定的当前文件,返回至步骤S103。S108: Create a new file in addition, and limit the maximum storage capacity of the new file at the same time, and set the new file as the current file, and reuse the data in the multiplexed data block Data Block after step S105 is encapsulated Data is written into the set current file, and the process returns to step S103.

本实施例的一个优选实施方式中,该多路视频数据复用方法还包括:In a preferred implementation of this embodiment, the method for multiplexing multiplexed video data also includes:

根据用户输入参数,生成与当前文件相对应的文件说明信息Readme;其中,文件说明信息包括文件名称、区域标识符ID、各产品标识符ID等信息;区域标识符ID、各产品标识符ID为文件中存有加密视频数据时解密所需的密钥标识。文件存储的复用数据块中的每一路视频数据都对应一个产品。不同路的视频数据对应的产品可以相同或不同。在后续播放器对文件进行读取播放时,如果文件存储的复用数据块中某一路视频数据为加密的视频数据,可通过读取区域标识符ID、各产品标识符ID,查找与此路视频数据相对应的产品标识符(密钥标识),对此路视频数据进行解密。According to the user input parameters, generate the file description information Readme corresponding to the current file; wherein, the file description information includes information such as file name, regional identifier ID, and each product identifier ID; the regional identifier ID and each product identifier ID are Key identifier required for decryption when encrypted video data is stored in the file. Each channel of video data in the multiplexing data block stored in the file corresponds to a product. Products corresponding to different channels of video data may be the same or different. When the subsequent player reads and plays the file, if a certain channel of video data in the multiplexed data block stored in the file is encrypted video data, it can be found by reading the area identifier ID and each product identifier ID. The product identifier (key identifier) corresponding to the video data is used to decrypt the video data.

将生成的文件说明信息写入至当前文件;对于文件说明信息Readme的写入格式可以为但不限于:Write the generated file description information to the current file; the writing format of the file description information Readme can be but not limited to:

另外,当前文件中还可包括文件说明信息的长度、开始标识、结束标识等信息。例如,当前文件格式为:In addition, the current file may also include information such as the length of the file description information, the start identifier, and the end identifier. For example, the current file format is:

在对所有接收到的多路视频数据写入至创建的文件中后,将创建的文件存储至外接存储设备,例如DVD光盘。当播放器播放DVD光盘时,能够根据复用封装格式解复用后,直接将多路视频数据同时播放,而不需要考虑时间同步问题,因为各复用数据块中的多路视频数据本就是同步录制的内容,节省了播放器的同步逻辑。After writing all the received multi-channel video data into the created file, store the created file to an external storage device, such as a DVD disc. When the player plays a DVD disc, it can directly play multiple channels of video data at the same time after demultiplexing according to the multiplexing encapsulation format, without considering the problem of time synchronization, because the multiple channels of video data in each multiplexed data block are inherently Synchronize the recorded content, saving the synchronization logic of the player.

本发明实施例一提供的方法,每隔固定时间将实时接收的多路视频数据复用封装成一个复用数据块后写入至同一个文件,且对每一复用数据块内的各路视频数据进行顺序存储,不会出现多路视频数据间的相互影响,有效解决了在播放多路视频数据时的时间同步问题,提高了读写多路视频数据的效率,避免了对多个视频文件进行处理,工作任务繁重的缺陷。同时,本实施例提出的多路视频数据复用方法还可以承载用户对文件名称、区域标识符ID、产品标识符ID的描述信息,能够满足用户需求。The method provided by Embodiment 1 of the present invention multiplexes and encapsulates multiple channels of video data received in real time into a multiplexed data block at regular intervals and writes them into the same file, and for each channel in each multiplexed data block The video data is stored sequentially, and there will be no mutual influence between multiple video data, which effectively solves the time synchronization problem when playing multiple video data, improves the efficiency of reading and writing multiple video data, and avoids multiple video Files are processed, the work task is heavy defect. At the same time, the multi-channel video data multiplexing method proposed in this embodiment can also carry the user's description information on the file name, area identifier ID, and product identifier ID, which can meet user needs.

实施例二Embodiment two

图2是本发明实施例二提供的一种多路监控录像内容复用装置示意图。参见图2,一种多路监控录像内容复用装置包括:Fig. 2 is a schematic diagram of a multi-channel surveillance video content multiplexing device provided by Embodiment 2 of the present invention. Referring to Fig. 2, a kind of multi-channel surveillance video content multiplexing device comprises:

视频数据接收模块201,用于实时接收多台摄像机采集的视频数据,即多路视频数据。通常情况下,多路视频数据均来自于同一个区域,例如多路视频数据均为来自于北京市海淀区某一公安局审讯系统的监控录像。The video data receiving module 201 is used for receiving video data collected by multiple cameras in real time, that is, multi-channel video data. Usually, multiple channels of video data come from the same area. For example, multiple channels of video data come from the surveillance video of the interrogation system of a public security bureau in Haidian District, Beijing.

文件创建模块202,用于创建一个文件,对该文件的最大存储容量做限定,并设定该文件为当前文件;其中,最大存储容量用于描述该文件最大可以存储多少大小的内容数据,例如25M。The file creation module 202 is used to create a file, limit the maximum storage capacity of the file, and set the file as the current file; wherein, the maximum storage capacity is used to describe the maximum size of content data that can be stored in the file, for example 25M.

视频数据判断模块203,用于每隔固定时间后,判断所述固定时间内接收的多路视频数据是否为空;优选地,固定时间选用100ms。The video data judging module 203 is configured to judge whether the multi-channel video data received within the fixed time is empty after every fixed time; preferably, the fixed time is 100 ms.

复用封装模块204,用于当视频数据判断模块203判断所述固定时间内接收的多路视频数据不为空时,对所述固定时间内接收的多路视频数据进行复用封装,生成一个复用数据块;The multiplexing encapsulation module 204 is used for multiplexing and encapsulating the multiplexed video data received within the fixed time when the video data judging module 203 judges that the multiplexed video data received within the fixed time is not empty, to generate a Multiplexing data blocks;

所述复用数据块包括复用数据块标识符、复用数据块内各路视频数据的播放时间、顺序存储的所述固定时间内接收的各路视频数据。复用数据块各路视频数据的播放时间,与所述固定时间是一致的。优选地,所述复用数据块还包括复用数据块长度、密钥数据。密钥数据为当所述复用数据块中存在加密的视频数据时的解密数据;The multiplexed data block includes an identifier of the multiplexed data block, the playing time of each channel of video data in the multiplexed data block, and each channel of video data received within the fixed time and stored sequentially. The playing time of each channel of video data in the multiplexed data block is consistent with the fixed time. Preferably, the multiplexed data block further includes the length of the multiplexed data block and key data. The key data is decrypted data when there is encrypted video data in the multiplexed data block;

对所述固定时间内接收的多路视频数据进行复用封装时的封装格式(复用数据块Data Block的格式)与实施例一相同,这里不再赘述。The encapsulation format (the format of the multiplexed data block Data Block) when multiplexing and encapsulating the multiple channels of video data received within the fixed time is the same as that in Embodiment 1, and will not be repeated here.

文件存储容量判断模块205,用于判断文件创建模块202设定的当前文件的剩余存储容量是否大于等于复用封装模块204刚生成的复用数据块的存储容量;其中,当前文件的剩余存储容量为当前文件的最大存储容量与当前文件中已存数据的存储容量之差。The file storage capacity judging module 205 is used to judge whether the remaining storage capacity of the current file set by the file creation module 202 is greater than or equal to the storage capacity of the multiplexed data block just generated by the multiplexing encapsulation module 204; wherein, the remaining storage capacity of the current file It is the difference between the maximum storage capacity of the current file and the storage capacity of the stored data in the current file.

第一复用数据写入模块206,用于当文件存储容量判断模块205判断文件创建模块202设定的当前文件的剩余存储容量大于等于复用封装模块204刚生成的复用数据块的存储容量时,将复用封装模块204刚生成的复用数据块中的数据,写入至文件创建模块202设定的当前文件中。The first multiplexed data writing module 206 is used for judging by the file storage capacity judging module 205 that the remaining storage capacity of the current file set by the file creation module 202 is greater than or equal to the storage capacity of the multiplexed data block just generated by the multiplexing encapsulation module 204 , write the data in the multiplexed data block just generated by the multiplexed encapsulation module 204 into the current file set by the file creation module 202 .

第二复用数据写入模块207,用于当文件存储容量判断模块205判断文件创建模块202设定的当前文件的剩余存储容量小于复用封装模块204刚生成的复用数据块的存储容量时,The second multiplexing data writing module 207 is used for when the file storage capacity judging module 205 judges that the remaining storage capacity of the current file set by the file creation module 202 is less than the storage capacity of the multiplexing data block just generated by the multiplexing encapsulation module 204 ,

通知文件创建模块202另外创建一个新的文件、限定该新的文件的最大存储容量、设定该新的文件为当前文件;Notify the file creation module 202 to create a new file in addition, limit the maximum storage capacity of the new file, set the new file as the current file;

将复用封装模块204刚生成的复用数据块中的数据,写入至文件创建模块202设定的当前文件。Write the data in the multiplexed data block just generated by the multiplexed encapsulation module 204 to the current file set by the file creation module 202 .

本实施例的一个优选实施方式中,该装置还包括文件说明信息写入模块,用于:In a preferred implementation of this embodiment, the device also includes a file description information writing module for:

根据用户输入参数,生成与文件创建模块202设定的当前文件相对应的文件说明信息;其中,文件说明信息包括文件名称、区域标识符ID、各产品标识符ID等信息;区域标识符ID、各产品标识符ID为文件中存有加密视频数据时所需的密钥标识;区域标识符ID、各产品标识符ID为文件中存有加密视频数据时解密所需的密钥标识。文件存储的复用数据块中的每一路视频数据都对应一个产品。不同路的视频数据对应的产品可以相同或不同。在后续播放器对文件进行读取播放时,如果文件存储的复用数据块中某一路视频数据为加密的视频数据,可通过读取区域标识符ID、各产品标识符ID,查找与此路视频数据相对应的产品标识符(密钥标识),对此路视频数据进行解密。According to the user input parameters, generate the file description information corresponding to the current file set by the file creation module 202; wherein, the file description information includes information such as file name, area identifier ID, each product identifier ID; area identifier ID, Each product identifier ID is the key identification required when encrypted video data is stored in the file; the area identifier ID and each product identifier ID are the key identification required for decryption when encrypted video data is stored in the file. Each channel of video data in the multiplexing data block stored in the file corresponds to a product. Products corresponding to different channels of video data may be the same or different. When the subsequent player reads and plays the file, if a certain channel of video data in the multiplexed data block stored in the file is encrypted video data, it can be found by reading the area identifier ID and each product identifier ID. The product identifier (key identifier) corresponding to the video data is used to decrypt the video data.

将生成的文件说明信息写入至文件创建模块202设定的当前文件;对于文件说明信息的写入格式与实施例一相同,这里不再赘述。Write the generated file description information into the current file set by the file creation module 202; the writing format of the file description information is the same as that in Embodiment 1, and will not be repeated here.

另外,设定的当前文件中还可包括文件说明信息的长度、开始标识、结束标识等信息。In addition, the set current file may also include information such as the length of the file description information, a start mark, an end mark, and the like.

在对所有接收到的多路视频数据写入至文件创建模块202创建的文件中后,将创建的文件存储至外接存储设备,例如DVD光盘。当播放器播放DVD光盘时,能够根据复用封装格式解复用后,直接将多路视频数据同时播放,而不需要考虑时间同步问题,因为各复用数据块中的多路视频数据本就是同步录制的内容,节省了播放器的同步逻辑。After writing all the received multi-channel video data into the file created by the file creation module 202, the created file is stored to an external storage device, such as a DVD disc. When the player plays a DVD disc, it can directly play multiple channels of video data at the same time after demultiplexing according to the multiplexing encapsulation format, without considering the problem of time synchronization, because the multiple channels of video data in each multiplexed data block are inherently Synchronize the recorded content, saving the synchronization logic of the player.

在本发明实施例二提出的装置中,复用封装模块204每隔固定时间后将实时接收的多路视频数据复用封装生成复用数据块,且每一复用数据块内的各路视频数据顺序存储,第一复用数据写入模块206或第二复用数据写入模块207将复用封装模块204生成的复用数据块写入至文件创建模块202设定的当前文件,本实施例有效解决了在播放多路视频数据时的时间同步问题,提高了读写多路视频数据的效率,避免了对多个视频文件进行处理,工作任务繁重的缺陷。同时,本实施例提出的多路视频数据复用装置还包括文件说明信息写入模块,承载了用户对文件名称、区域标识符ID、产品标识符ID的描述信息,能够满足用户需求。In the device proposed in Embodiment 2 of the present invention, the multiplexing and encapsulation module 204 multiplexes and encapsulates multiple channels of video data received in real time to generate multiplexed data blocks after a fixed time interval, and each channel of video in each multiplexed data block The data is stored sequentially. The first multiplexed data writing module 206 or the second multiplexed data writing module 207 writes the multiplexed data blocks generated by the multiplexed package module 204 into the current file set by the file creation module 202. This implementation The example effectively solves the problem of time synchronization when playing multi-channel video data, improves the efficiency of reading and writing multi-channel video data, and avoids the defect of processing multiple video files and heavy work tasks. At the same time, the multiplex video data multiplexing device proposed in this embodiment also includes a file description information writing module, which carries the user's description information on the file name, area identifier ID, and product identifier ID, which can meet user needs.

以上实施例提供的技术方案中的全部或部分内容可以通过软件编程实现,其软件程序存储在可读取的存储介质中,存储介质例如:计算机中的硬盘、光盘或软盘。All or part of the technical solutions provided by the above embodiments can be realized by software programming, and the software program is stored in a readable storage medium, such as a hard disk, an optical disk or a floppy disk in a computer.

以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection of the present invention. within range.

Claims (10)

1.一种多路视频数据复用方法,其特征在于,所述方法包括:1. A method for multiplexing multiplexed video data, characterized in that the method comprises: S1:实时接收多路视频数据;S1: Receive multiple channels of video data in real time; S2:创建一个文件,限定所述文件的最大存储容量,并将所述文件设定为当前文件;S2: Create a file, limit the maximum storage capacity of the file, and set the file as the current file; S3:待固定时间过后,判断所述固定时间内接收的多路视频数据是否为空;S3: after a fixed time, judge whether the multi-channel video data received within the fixed time is empty; S4:当所述固定时间内接收的多路视频数据不为空时,对所述固定时间内接收的多路视频数据进行复用封装,生成一个复用数据块;其中,所述复用数据块包括复用数据块标识符、复用数据块内各路视频数据的播放时间、顺序存储的所述固定时间内接收的各路视频数据;S4: When the multi-channel video data received within the fixed time is not empty, multiplex and encapsulate the multiple video data received within the fixed time to generate a multiplexed data block; wherein the multiplexed data The block includes a multiplexed data block identifier, the play time of each channel of video data in the multiplexed data block, and each channel of video data received within the fixed time that is sequentially stored; S5:判断所述当前文件的剩余存储容量是否大于等于所述复用数据块的存储容量;如果是,执行步骤S6,否则,执行步骤S7;S5: Determine whether the remaining storage capacity of the current file is greater than or equal to the storage capacity of the multiplexed data block; if yes, perform step S6, otherwise, perform step S7; S6:将所述复用数据块中的数据写入至所述当前文件,返回至所述步骤S3;S6: Write the data in the multiplexed data block to the current file, and return to the step S3; S7:另外创建一个新的文件,同时限定所述新的文件的最大存储容量,并设定所述新的文件为当前文件,将所述复用数据块中的数据写入至所述当前文件,返回至所述步骤S3。S7: Create a new file in addition, limit the maximum storage capacity of the new file at the same time, and set the new file as the current file, and write the data in the multiplexed data block to the current file , return to the step S3. 2.根据权利要求1所述的多路视频数据复用方法,其特征在于,所述方法还包括:2. multiplex video data multiplexing method according to claim 1, is characterized in that, described method also comprises: 根据用户输入参数,生成与所述当前文件相对应的文件说明信息;Generate file description information corresponding to the current file according to user input parameters; 将所述生成的文件说明信息写入至所述当前文件。Writing the generated file specification information into the current file. 3.根据权利要求2所述的多路视频数据复用方法,其特征在于,所述文件说明信息包括文件名称、区域标识符、各产品标识符。3. The method for multiplexing multiplexed video data according to claim 2, wherein the file description information includes file names, area identifiers, and product identifiers. 4.根据权利要求1所述的多路视频数据复用方法,其特征在于,所述固定时间优选为100ms。4. The method for multiplexing multiplexed video data according to claim 1, wherein the fixed time is preferably 100ms. 5.根据权利要求1所述的多路视频数据复用方法,其特征在于,所述复用数据块还包括复用数据块长度、密钥数据;5. multiplex video data multiplexing method according to claim 1, is characterized in that, described multiplexing data block also comprises multiplexing data block length, key data; 其中,所述密钥数据为当所述复用数据块中存在加密的视频数据时的解密数据。Wherein, the key data is decrypted data when encrypted video data exists in the multiplexed data block. 6.一种多路视频数据复用装置,其特征在于,所述装置包括:6. A multiplex video data multiplexing device, characterized in that the device comprises: 视频数据接收模块,用于实时接收多路视频数据;The video data receiving module is used to receive multi-channel video data in real time; 文件创建模块,用于创建一个文件,限定所述文件的最大存储容量,并将所述文件设定为当前文件;A file creation module, configured to create a file, limit the maximum storage capacity of the file, and set the file as the current file; 视频数据判断模块,用于每隔固定时间后,判断所述固定时间内接收的多路视频数据是否为空;The video data judging module is used to judge whether the multi-channel video data received within the fixed time is empty after every fixed time; 复用封装模块,用于当所述固定时间内接收的多路视频数据不为空时,对所述固定时间内接收的多路视频数据进行复用封装,生成一个复用数据块;A multiplexing encapsulation module, used to multiplex and encapsulate the multiplexed video data received within the fixed time period when the multiplexed video data received within the fixed time period is not empty, to generate a multiplexed data block; 文件存储容量判断模块,用于判断所述当前文件的剩余存储容量是否大于等于所述复用数据块的存储容量;A file storage capacity judging module, configured to judge whether the remaining storage capacity of the current file is greater than or equal to the storage capacity of the multiplexed data block; 第一复用数据写入模块,用于当所述当前文件的剩余存储容量大于等于复用数据块的存储容量时,将所述复用数据块中的数据,写入至所述当前文件中;The first multiplexed data writing module is used to write the data in the multiplexed data block into the current file when the remaining storage capacity of the current file is greater than or equal to the storage capacity of the multiplexed data block ; 第二复用数据写入模块,用于当所述当前文件的剩余存储容量小于所述复用数据块的存储容量时,通知所述文件创建模块另外创建一个新的文件、限定所述新的文件的最大存储容量、设定所述新的文件为当前文件;将所述复用数据块中的数据写入至所述当前文件。The second multiplexing data writing module is used to notify the file creation module to create a new file and limit the new file when the remaining storage capacity of the current file is less than the storage capacity of the multiplexing data block. The maximum storage capacity of the file, setting the new file as the current file; writing the data in the multiplexed data block to the current file. 7.根据权利要求6所述的多路视频数据复用装置,其特征在于,所述装置还包括文件说明信息写入模块,用于7. The device for multiplexing multiplexed video data according to claim 6, wherein the device also includes a file description information writing module for 根据用户输入参数,生成与所述当前文件相对应的文件说明信息;Generate file description information corresponding to the current file according to user input parameters; 将所述生成的文件说明信息写入至所述当前文件。Writing the generated file specification information into the current file. 8.根据权利要求7所述的多路视频数据复用装置,其特征在于,所述文件说明信息包括文件名称、区域标识符、各产品标识符。8. The device for multiplexing multiplexed video data according to claim 7, wherein the file description information includes file names, area identifiers, and product identifiers. 9.根据权利要求6所述的多路视频数据复用装置,其特征在于,所述固定时间优选为100ms。9. The device for multiplexing multiplexed video data according to claim 6, wherein the fixed time is preferably 100 ms. 10.根据权利要求6所述的多路视频数据复用装置,其特征在于,所述复用数据块还包括复用数据块长度、密钥数据;10. multiplex video data multiplexing device according to claim 6, is characterized in that, described multiplexing data block also comprises multiplexing data block length, key data; 其中,所述密钥数据为当所述复用数据块中存在加密的视频数据时的解密数据。Wherein, the key data is decrypted data when encrypted video data exists in the multiplexed data block.
CN201310062468.9A 2013-02-27 2013-02-27 A kind of multi-path video data multiplexing method and device Expired - Fee Related CN103179435B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310062468.9A CN103179435B (en) 2013-02-27 2013-02-27 A kind of multi-path video data multiplexing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310062468.9A CN103179435B (en) 2013-02-27 2013-02-27 A kind of multi-path video data multiplexing method and device

Publications (2)

Publication Number Publication Date
CN103179435A CN103179435A (en) 2013-06-26
CN103179435B true CN103179435B (en) 2016-09-28

Family

ID=48639006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310062468.9A Expired - Fee Related CN103179435B (en) 2013-02-27 2013-02-27 A kind of multi-path video data multiplexing method and device

Country Status (1)

Country Link
CN (1) CN103179435B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428462A (en) * 2013-08-29 2013-12-04 中安消技术有限公司 Method and device for processing multichannel audio and video
CN103813139A (en) * 2013-12-31 2014-05-21 南宁市公安局 Vehicle-mounted monitoring device
CN103826100A (en) * 2013-12-31 2014-05-28 南宁市公安局 Monitoring method based on double cameras
CN112866640A (en) * 2021-01-08 2021-05-28 珠海研果科技有限公司 Data storage method and device
CN113556619B (en) * 2021-07-15 2024-04-19 广州市奥威亚电子科技有限公司 Device and method for link transmission and method for link reception
CN115643442A (en) * 2022-10-25 2023-01-24 广州市保伦电子有限公司 Audio and video converging recording and playing method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002102049A2 (en) * 2001-06-11 2002-12-19 Broadcom Corporation System and method for multi-channel video and audio encoding on a single chip
CN101164347A (en) * 2005-04-26 2008-04-16 汤姆森许可贸易公司 Synchronous stream packing
CN102200978A (en) * 2010-03-26 2011-09-28 宁波Gqy视讯股份有限公司 Data real-time storage method, data real-time storage device and data real-time storage system in data transmission
CN102301730A (en) * 2011-07-18 2011-12-28 华为技术有限公司 Method, device and system for transmitting and processing multichannel AV

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719233A (en) * 2009-08-27 2010-06-02 武汉双赢信息技术有限公司 Cold-chain logistics management system
CN104918016B (en) * 2015-06-09 2018-10-19 柳州桂通科技股份有限公司 A kind of system of multimedia multi information reproduced in synchronization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002102049A2 (en) * 2001-06-11 2002-12-19 Broadcom Corporation System and method for multi-channel video and audio encoding on a single chip
CN101164347A (en) * 2005-04-26 2008-04-16 汤姆森许可贸易公司 Synchronous stream packing
CN102200978A (en) * 2010-03-26 2011-09-28 宁波Gqy视讯股份有限公司 Data real-time storage method, data real-time storage device and data real-time storage system in data transmission
CN102301730A (en) * 2011-07-18 2011-12-28 华为技术有限公司 Method, device and system for transmitting and processing multichannel AV

Also Published As

Publication number Publication date
CN103179435A (en) 2013-06-26

Similar Documents

Publication Publication Date Title
CN103179435B (en) A kind of multi-path video data multiplexing method and device
TWI344300B (en) Computer-readable recording medium and method and apparatus to synchronize av data with text subtitle data
JP4481889B2 (en) Data recording apparatus and method, program, and recording medium
MX2010002097A (en) Recording medium, reproduction device, system lsi, reproduction method, spectacle, and display device associated with 3d video.
CN110337010A (en) Video/audio processing method, law-enforcing recorder, management server and enforcement system
TW201204053A (en) Method and apparatus for processing information, method and apparatus for manufacturing information recording medium, information recording medium, and computer program
JP2011019084A5 (en)
CN102027751A (en) Recording medium, reproduction device, and integrated circuit
US20160057491A1 (en) Information processing device, information recording medium, information processing method, and program
CN1193602C (en) Image processing method and image processing device
CN102314914A (en) Signal conditioning package, information processing method and program
WO2006120921A1 (en) Recording medium, authoring device, and authoring method
CN101785006A (en) Method and apparatus for encoding and decoding multimedia data
CN101895736B (en) Media stream data processing method and device thereof
JPWO2006064738A1 (en) Management server device, content playback device, and recording medium
CN102314915A (en) Messaging device, information processing method and program
JP2008293578A (en) Stream data control module
JP6034277B2 (en) Content creation method, content creation device, and content creation program
CN101352037A (en) Information processing device and information processing method, and computer program
RU2006132778A (en) INFORMATION PROCESSING DEVICE, INFORMATION RECORDING MEDIA DEVICE, INFORMATION RECORDING MEDIA, THEIR METHODS AND COMPUTER PROGRAM
CN104081460A (en) Information processing device, information recording medium, information processing method, and program
JP7024787B2 (en) Information processing equipment, information processing methods, and programs
TW201003388A (en) Video recording and playback equipment, video recording method, video playback method, and video recording and playback method
JP2004128938A (en) AV data recording and reproducing apparatus and method
CN111813965B (en) Encryption method and decryption method for multimedia file, storage medium and electronic device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160928