CN100481933C - A method for encryption of MP4 multi-media data content - Google Patents

A method for encryption of MP4 multi-media data content Download PDF

Info

Publication number
CN100481933C
CN100481933C CN 200610022555 CN200610022555A CN100481933C CN 100481933 C CN100481933 C CN 100481933C CN 200610022555 CN200610022555 CN 200610022555 CN 200610022555 A CN200610022555 A CN 200610022555A CN 100481933 C CN100481933 C CN 100481933C
Authority
CN
China
Prior art keywords
unit
frame
data
sampling block
trak
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
CN 200610022555
Other languages
Chinese (zh)
Other versions
CN1997146A (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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric 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 Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN 200610022555 priority Critical patent/CN100481933C/en
Publication of CN1997146A publication Critical patent/CN1997146A/en
Application granted granted Critical
Publication of CN100481933C publication Critical patent/CN100481933C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

This invention provides one MP4 form multi-media data content coding method based on frame, which comprises the following steps: a, analyzing the MP4 files and its element data capacitor unit; b, finding the media type of visual frequency or audio frequency frame information in the capacitor unit; c, finding the frame address in the media data capacitor according to the frame information; d, reading the frame data in the media data capacitor; e, coding other frame data besides frame head.

Description

A kind of MP4 form multimedia data contents encryption method
Technical field
The present invention relates to multimedia data encryption method.
Background technology
Along with the progress of network technology, information security, ecommerce and software engineering, a technology-digital copyright management (DRM) of specializing in content protecting has appearred, and it mainly by the encryption to audio, video data, reaches the controlled use to content.
Encryption to audio-video frequency content, two kinds of cipher modes of general employing: first kind is the mode of stream cipher, as the CA of present broadcasting and TV system and at DTCP, the HTCP of household electrical appliance terminal content protecting, UCPS etc., this mode cryptographic algorithm is simple, fast operation, but fail safe is not high, generally is applicable to the occasion that data throughout is bigger; Another is the mode of block encryption, as the SMS4 scheduling algorithm of DES, 3DES, IDEA, AES and China, and its computing more complicated, bigger to expending of resource, fail safe is than higher, and its fail safe is the transmission to key.In present DRM system, generally all adopt second kind of cipher mode.
In the DRM technology, generally following several modes are adopted in the encryption of content of multimedia:
(1) the need protected file is all encrypted.This mode not content of protection of pipe is any form, and it all is used as needs ciphered data to carry out the block encryption processing.But the files in stream media that this mode of process is handled, because the information of Streaming Media has also been handled together, can not use the Streaming Media bearing protocol, can not be by corresponding player identification, therefore must use while can not decipher earlier with whole file decryption before use.And, whole file decryption has also been increased the risk out of control to content.For big files in stream media, the deciphering of whole file also needs very big spatial cache, has increased cost indirectly.
(2) media data container (mdat) content of MP4 file is carried out encryption: this cipher mode is at first analyzed the MP4 file, finds out corresponding media data container unit (mdat box), and the media data container content is carried out encryption.Owing in encrypted process, the type of media data container content is not distinguished, audio frequency, video and other data is handled together.And streaming media server is according to the transmission of separately packing of audio frequency, video, so the data of obtaining from the network streaming media server end, player can't be realized the deciphering of correct Voice ﹠ Video, so can't realize the online broadcast of network, versatility is not strong.
(3) carry out encryption according to the RTP load, audio frequency is that multiframe is combined into a bag, and for the broadcast form of file, if incorrect deciphering when playing, player can't correctly be discerned audio frame, will cause the serious data mistake for directly.This mode can not be protected the program of downloading and playing, and this may be maximum demand to Streaming Media.
Aspect the Digital Media source encoding, at present popular be based on MPEG2, MPEG1, MPEG4, H.264, the disclosed standard of AVS.The source encoding standard of Microsoft and Real company has also obtained using widely on network in addition, but because the private ownership of these standards does not obtain using in fields such as broadcasting and TV, IPTV, support is also few aspect terminal simultaneously.
Summary of the invention
The technical problem to be solved in the present invention is: a kind of MP4 form multimedia data contents encryption method is provided, can be applied to various host-host protocols.
The present invention solves the problems of the technologies described above the technical scheme that is adopted to be: a kind of MP4 form multimedia data contents encryption method based on frame may further comprise the steps:
A, the MP4 file is analyzed analytical element data capsule unit;
B, in the metadata container unit, search the frame information that medium type is video or audio frequency;
C, find the address of this frame in media data container according to described frame information;
D, read according to described address and find frame data at media data container;
E, the frame data of encryption except that frame head.
Further, described step b may further comprise the steps:
B1, in the metadata container unit, search the mvhd unit;
B2, in the mvhd unit, receive and seek the trak unit;
B3, judge whether hdlr is claimed as video or audio frequency in the trak unit; Enter step b2 if not; If enter b4;
B4, read the sampling block information of this trak unit correspondence.
Further be, described sampling block information includes, the sampling block quantity of number of blocks, piece correspondence, the offset address and the size of sampling block.
Further be that described step b also comprises and searches the frame information that medium type is the RTP load.
Audio/video frames is encrypted the function that also can reach to the MP4 encrypting and protecting files; and the scope of application of this mode is wider; can be applicable to simultaneously and local play and play during network implementation, and the mode that RTP encrypts is play can only be used for network implementation the time, can't satisfy the requirement of local broadcast.
The invention has the beneficial effects as follows: can handle simultaneously, realize DRM protection effectively, can guarantee that also streaming media server and player can correctly discern this mp4 file the mp4 file format at audio frequency, video, RTP bag etc.Be applicable to the MPEG4 that adopts the MP4 form, H.264, the processing of AVS and MOV file.Adopt the DRM system of this method, can break away from the bearing protocol of Streaming Media and become an independently system, be implemented in multiple occasions such as multimedia service, audio frequency and video issue, monitoring, IPTV, network medium contents provide, CHINA RFTCOM Co Ltd content protecting.
The present invention is described in further detail below in conjunction with accompanying drawing and object lesson.
Description of drawings
Fig. 1 based on the DRM of frame encrypt flow process.
Embodiment
When the present invention arrived decoder according to multi-medium data, the principle of the frame that is bound to initial data is reverted to had proposed a kind of MP4 form multimedia data contents encryption method based on frame.
In the MP4 file, metadata is the data of one group of essential characteristic of data of description own and attribute.In the metadata container unit of metadata MP4 file (moov box).The metadata container unit pack contains offset address, size of each piece (chunk) and each sampling block (sample) etc., and player identifies the type of file by the metadata container unit, and carries out play operation.
In the mp4 file, frame is a kind of of sampling block, and sampling block also may be elementary cell, other descriptive information elementary cell of fluidisation etc. except frame.A plurality of sampling blocks are then formed a piece.
What the MP4 file format was used is international standard ISO14496-12 multimedia file format.At present, H.264 the multimedia that adopts the MP4 file format comprises also, AVS etc. that except the MPEG-4 coding MOV file of Apple is also similar substantially to the MP4 file format.The base unit of MP4 file is unit (box), mainly comprises 6 unit in file hierarchy, and the content of each unit sees the following form:
Object type Whether necessary Explanation
ftyp Be File type and compatibility
mooV Be Metadata container
moof Not Filmstrip
mdat Not Media data container
free Not Free space
skip Not Free space
In a mp4 file, ftyp unit and moov unit are necessary, and remaining element is optional.But in fact, what the mdat unit comprised is the content of the audio, video data of reality, also is the necessary part of mp4 file, and just the mdat unit can exist with independent file, does not need and must be placed in the file with other unit.
In incomplete mp4 file, much the ftyp unit does not exist yet, and just has only moov and mdat unit.Moov deposits the unit is about the explanation of media information and to the index of data in the mdat unit.Can corresponding find audio, video data concrete in the mdat unit by the content in the moov unit.The structure of moov unit is as shown in the table:
Figure C200610022555D0007182729QIETU
The moov unit is made up of different rail (track) unit.In a mp4 file, comprise 5 kinds of rails at least, be respectively vide, soun, hint, sdsm, odsm, the quantity of rail is at least more than 6.Wherein, vide trak shows this video track, and soun trak is expressed as audio track, and hint trak then is expressed as RTP load data rail.
The important object of the positional information of data and temporal information in the stbl rail, its path hereof is moov/trak/mdia/minf/stbl, wherein stts is the decode time object of sampling block, ctts is the generated time object of sampling block, stss is the synchronization object (DRM can not perform an analysis) of sampling block, provide therein can random access catalogue number(Cat.No.).Stsd is the description object of sampling block, is divided into four types: frame of video, audio frame, index and other mpeg4 stream except index type, all comprise the basic ISN flow descriptors of mpeg4 during other three kinds of samples are described.Stsz describes the size of sampling block.Stsc has described the relation between sampling block and the piece, the stso object factory piece relative position relation hereof.Promptly, can in the madt unit, find corresponding sampling block according to the explanation in the rail.As, the sampling block of video track correspondence is a frame of video; The sampling block of audio track correspondence is an audio frame; RTP load data rail correspondence be RTP load bag.
By knowing to above analysis, if we carry out encryption according to the sampling block of the explanation correspondence of video track, then can realize processing to frame of video, sampling block according to the explanation correspondence of audio track carries out encryption, then can realize processing to audio frame, sampling block according to the explanation correspondence of RTP load data rail is handled, and then can carry out encryption to RTP load bag.
As shown in Figure 1, description be MP4 based on the DRM of frame encrypt flow process.
1, program is analyzed the MP4 file on file hierarchy.Find out the moov unit.
2, then in the moov unit next level receive and seek the mvhd unit.
3, find out the mvhd unit after, in the mvhd unit, seek the trak unit.
4, resolve all unit that the trak unit is comprised, and utilizes path trak/mdia/hdlr/handler_type to judge whether this rail is video track or audio track.If not, in the mvhd unit, continue to seek next trak unit and proceed above deterministic process.If enter step 5.
5, read the quantity of the piece of this rail correspondence, the quantity relevant information of this piece obtains in the trak/mdia/minf/stbl/stco/entry_count of path.
6, read the quantity of the sampling block of first piece correspondence subsequently, the quantity relevant information of this sampling block obtains in the trak/mdia/minf/stbl/stsc/samples_per_chunk of path; And the relevant information of the offset address of the offset address of this sampling block, this sampling block obtains in the trak/mdia/minf/stbl/stco/chunk_offset of path.
7, read the size of sampling block, the size information of this sampling block obtains in the trak/mdia/minf/stbl/stsz/sample_size of path.
8, read in frame data in the madt unit according to these values, then the data beyond the frame head are encrypted.Judge that whether current block finishes dealing with, and enters step 9 if not; If enter step 10.
9, calculate the offset address of next sampling block, the offset address of promptly going up a sampling block adds the size of its sampling block, gets back to step 7 and proceeds encryption.
10, proceed the processing of next piece.The process of handling is identical with a last piece processing procedure, disposes until all pieces.
Above method is removed the encryption that is applicable to mp4 format audio and frame of video.Can also carry out carrying out based on the RTP load encryption of data content, concrete need get final product at step 4 kind of an inquiry RTP load data rail.
This method has been passed through verification experimental verification, its advantage is the processing that is not only applicable to the Streaming Media of real-time VOD, multicast type, also be applicable to the multimedia processing of downloading mode simultaneously, irrelevant with the Streaming Media bearing protocol, support various downloads, transmission means, versatility is very strong, and range of application is very extensive.The thought of this programme is expanded, can be used in various multimedia content protectings are handled.

Claims (4)

1, a kind of MP4 form multimedia data contents encryption method is characterized in that, may further comprise the steps:
A, the MP4 file is analyzed analytical element data capsule unit;
B, in the metadata container unit, search the frame information that medium type is video or audio frequency;
C, find the address of this frame in media data container according to described frame information;
D, read according to described address and find frame data at media data container;
E, the frame data of encryption except that frame head.
2, a kind of according to claim 1 MP4 form multimedia data contents encryption method is characterized in that described step b may further comprise the steps:
B1, in the metadata container unit, search the mvhd unit;
B2, in the mvhd unit, receive and seek the trak unit;
B3, judge whether hdlr is claimed as video or audio frequency in the trak unit; Enter step b2 if not; If enter step b4;
B4, read the sampling block information of this trak unit correspondence.
3, as a kind of MP4 form multimedia data contents encryption method as described in the claim 2, it is characterized in that described sampling block information includes, the sampling block quantity of number of blocks, sampling block type, piece correspondence, the offset address and the size of sampling block.
4, a kind of according to claim 1 MP4 form multimedia data contents encryption method is characterized in that, described step b also comprises and searches the frame information that medium type is the RTP load.
CN 200610022555 2006-12-20 2006-12-20 A method for encryption of MP4 multi-media data content Expired - Fee Related CN100481933C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200610022555 CN100481933C (en) 2006-12-20 2006-12-20 A method for encryption of MP4 multi-media data content

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200610022555 CN100481933C (en) 2006-12-20 2006-12-20 A method for encryption of MP4 multi-media data content

Publications (2)

Publication Number Publication Date
CN1997146A CN1997146A (en) 2007-07-11
CN100481933C true CN100481933C (en) 2009-04-22

Family

ID=38252042

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200610022555 Expired - Fee Related CN100481933C (en) 2006-12-20 2006-12-20 A method for encryption of MP4 multi-media data content

Country Status (1)

Country Link
CN (1) CN100481933C (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108337566A (en) * 2017-01-20 2018-07-27 创盛视联数码科技(北京)有限公司 A kind of encryption method based on mp4 formatted files
CN109561323A (en) * 2019-01-02 2019-04-02 武汉珈铭汉象教育科技有限公司 MP4 file encryption, decryption method and device
CN109660866A (en) * 2018-12-28 2019-04-19 杭州当虹科技股份有限公司 A kind of decryption of video method based on H5

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009062430A1 (en) * 2007-11-16 2009-05-22 Huawei Technologies Co., Ltd. Method, apparatus and system for transmitting the initiation information of notification
CN101169953B (en) * 2007-11-29 2010-06-02 四川长虹电器股份有限公司 MP3 content encryption method
CN101488860B (en) * 2009-02-20 2011-07-27 四川长虹电器股份有限公司 File ciphering, deciphering method
CN102118628B (en) * 2009-12-30 2013-10-16 上海华虹集成电路有限责任公司 Compatibility test system for UCPS (unified content protection system) protocol
CN105049941B (en) * 2015-06-24 2017-06-30 广州酷狗计算机科技有限公司 A kind of processing method and processing device of multimedia file
CN106096334B (en) * 2016-06-02 2021-11-19 中国传媒大学 Method and device for encrypting hypermedia data, method and device for decrypting hypermedia data
CN107222759B (en) * 2017-06-28 2021-02-02 网易(杭州)网络有限公司 Method, system, device and medium for encrypting and decrypting media file
CN111813965B (en) * 2020-05-14 2024-06-21 北京嘀嘀无限科技发展有限公司 Encryption method and decryption method for multimedia file, storage medium and electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1246008A (en) * 1998-08-26 2000-03-01 英业达股份有限公司 Privacy method for multimedium data
CN1666498A (en) * 2002-06-28 2005-09-07 皇家飞利浦电子股份有限公司 Method of constructing MPEG program streams from encrypted MPEG transport streams

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1246008A (en) * 1998-08-26 2000-03-01 英业达股份有限公司 Privacy method for multimedium data
CN1666498A (en) * 2002-06-28 2005-09-07 皇家飞利浦电子股份有限公司 Method of constructing MPEG program streams from encrypted MPEG transport streams

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108337566A (en) * 2017-01-20 2018-07-27 创盛视联数码科技(北京)有限公司 A kind of encryption method based on mp4 formatted files
CN108337566B (en) * 2017-01-20 2021-06-29 创盛视联数码科技(北京)有限公司 Encryption method based on mp4 format file
CN109660866A (en) * 2018-12-28 2019-04-19 杭州当虹科技股份有限公司 A kind of decryption of video method based on H5
CN109561323A (en) * 2019-01-02 2019-04-02 武汉珈铭汉象教育科技有限公司 MP4 file encryption, decryption method and device
CN109561323B (en) * 2019-01-02 2021-11-12 武汉珈铭汉象教育科技有限公司 MP4 file encryption and decryption method and device

Also Published As

Publication number Publication date
CN1997146A (en) 2007-07-11

Similar Documents

Publication Publication Date Title
CN100481933C (en) A method for encryption of MP4 multi-media data content
KR101011588B1 (en) Method and apparatus for encrypting?decrypting multimedia content to allow random access
KR101730754B1 (en) Dlna/dtcp stream conversion for secure media playback
AU2010331464B2 (en) Content reception apparatus, content playback apparatus, content reception and playback apparatus, content reception method, and program
KR100930303B1 (en) Digital media contents protection system and method thereof
CN100581249C (en) Encoding and decoding method for protecting stream medium video content copyright
KR20130085926A (en) System and method for processing security based on http live streaming
Hartung et al. Drm protected dynamic adaptive http streaming
CN100505866C (en) A video information encrypting-decrypting method
CN101534433A (en) Streaming media encryption method
WO2016027579A1 (en) Information processing apparatus, information recording medium, information processing method, and program
CN104540016A (en) Video playing method and device
CN110881142A (en) Audio and video data encryption and decryption method and device based on rtmp and readable storage medium
CN108174284B (en) Android system-based video decoding method
US20230055310A1 (en) Uhd hls streaming trusted client server environment
KR20080028673A (en) Apparatus and method of packaging/unpackaging h.264 movie file streamed or downloaded
KR101097674B1 (en) Method and device for distributing av content in download type file format
WO2017198153A1 (en) Program playing management method, playing method and apparatus, and playing terminal
TWI450538B (en) System and method for decrypting multi-media stream data
Shin et al. A study on the digital right management of MPEG-4 streams for digital video library
Zhou et al. A TS bitstream parsing system for ChinaDRM
CN104318132B (en) Open mobile terminal behavior analysis method and system
Lee et al. Implementation of Real Time DMB Encryption on PMP for Copyright Protection
JP4860993B2 (en) Method and apparatus for protecting content packaging
Park et al. DRM for streamed MPEG-4 media

Legal Events

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

Granted publication date: 20090422

Termination date: 20211220

CF01 Termination of patent right due to non-payment of annual fee