CN102170453B - Audio and video coding method and playing method for shortening waiting time before on demand playing - Google Patents

Audio and video coding method and playing method for shortening waiting time before on demand playing Download PDF

Info

Publication number
CN102170453B
CN102170453B CN 201110138701 CN201110138701A CN102170453B CN 102170453 B CN102170453 B CN 102170453B CN 201110138701 CN201110138701 CN 201110138701 CN 201110138701 A CN201110138701 A CN 201110138701A CN 102170453 B CN102170453 B CN 102170453B
Authority
CN
China
Prior art keywords
audio
index
video
sample
video document
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN 201110138701
Other languages
Chinese (zh)
Other versions
CN102170453A (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.)
Storm group Limited by Share Ltd
Original Assignee
BEIJING BAOFENG 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 BAOFENG TECHNOLOGY Co Ltd filed Critical BEIJING BAOFENG TECHNOLOGY Co Ltd
Priority to CN 201110138701 priority Critical patent/CN102170453B/en
Publication of CN102170453A publication Critical patent/CN102170453A/en
Application granted granted Critical
Publication of CN102170453B publication Critical patent/CN102170453B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention discloses an audio and video coding method, which relates to the technical field of multimedia coding. The audio and video coding method comprises the following steps of: arranging data segment samples in an audio and video file sequentially from the samples with small timestamps to the samples with great timestamps, and if the timestamps of media data of different tracks are the same, arranging the samples according to the sequence of the tracks recorded in the audio and video file; dividing a plurality of samples into a plurality of groups by taking audio and video key frames as boundaries, adding a second index for each group of samples in an original audio and video file, and recording the playing information of each sample in the group, wherein the number of the samples in each group is more than or equal to 1; establishing first indexes for each second index, and recording the information of each second index in the audio and video file; and coding the first indexes into the audio and video file. The invention also discloses an audio and video playing method for shortening waiting time before on demand playing. By the audio and video coding method and the audio and video playing method, the waiting time before the online audio and video on demand playing is shortened, and the playing efficiency is improved.

Description

The player method of stand-by period before audio/video coding method and shortening program request are play
Technical field
The present invention relates to the multimedia coding techniques field, the player method of stand-by period before particularly a kind of audio/video coding method and shortening program request are play.
Background technology
A kind of implementation of Streaming Media is that player connects network, from network, download the audio-video document data in real time, data downloaded is resolved, and the valid data that parsing obtains are submitted to player play, realize the effect that limit bottom is broadcast, this is the knowledge that Streaming Media field those of ordinary skill has been known, and this paper no longer describes in detail.
Common audio-video document, comprise moov atom and mdat atom as the MP4 file, and player depends on moov atom to the parsing of mdat atom, in other words, player need obtain the total data of moov atom just can resolve mdat atom afterwards, plays the audio frequency and video sample data among the mdat atom then.And the data volume that comprises among the moov atom is bigger, and for example, playing duration is 1 hour audio-video document, and the size of its moov atom is about 1.5~2Mbytes.Suppose that the user is is the ADSL download data of 1Mb/s by downlink bandwidth, the data of this part are just downloaded so needs 12~16 seconds, computing formula is 1.5 * 1024 * 8/1024=12 second, at least need to spend 12 seconds before the user begins to play and download moov atom, could download the data of mdat atom afterwards and play.Prolong reproduction time, reduced the efficient that audio frequency and video are play.
Summary of the invention
(1) technical problem that will solve
The technical problem to be solved in the present invention is: how to realize that a kind of energy shortens online audio/video on-demand and plays preceding stand-by period audio-video document coding method.And shorten online audio/video on-demand by it and play the preceding stand-by period, to improve playing efficiency.
(2) technical scheme
For solving the problems of the technologies described above, the invention provides a kind of audio/video coding method, may further comprise the steps:
S1: in audio-video document, arrange according to the ascending order of the timestamp of sampled data section smaple, if the media data timestamp of different rails is identical, then arrange according to the sequencing of the rail that records in the described audio-video document head;
S2: be that the border is divided into some groups with some sample with the audio frequency and video key frame, and be that every group of sample increases by second index in original audio-video document, record the broadcast information of each sample in every group, the sample number in described every group is more than or equal to 1;
S3: be followed successively by each second index and set up first index, record the information of described each second index in audio-video document, the information of described second index in audio-video document comprises: second index side-play amount hereof, the frame number of the size of second index and the beginning sample of each rail in second index;
S4: described first index is encoded in the described audio-video document, and the side-play amount of the position of described first index in audio-video document is respectively less than second index and sample side-play amount hereof.
Wherein, described second index is positioned in described audio-video document before the corresponding sample grouping.
Wherein, the sample grouping that described second index is corresponding with it is deposited continuously.
Wherein, described first index in described audio-video document located just after metadata information.
Wherein, described first index is by the sequencing coding of second index corresponding with it.
Wherein, described audio-video document is fixedly RMVB file, WMV file, mpeg file or the avi file of frame per second.
The present invention also provides a kind of audio frequency and video player method that the preceding stand-by period is play in program request that shortens, and the audio-video document of the audio-video document of program request for obtaining by above-mentioned audio/video coding method coding may further comprise the steps:
A1: the user end to server end of Online Video VOD system sends request, begins the progressive download data from described audio-video document;
A2: client stops to download the data of back after downloading and having resolved described first index;
A3: client finds the side-play amount of first second index in audio-video document in the audio-video document according to the index information in first index;
A4: client is sent request to server end again, and indicates server to ignore the data of the afterbody from current location to the audio-video document head, and directly begins to download data from first second index;
A5: client is resolved data downloaded, downloads when having finished the download of first second index when being resolved to this, and the information of resolving this second index obtains the broadcast information of each sample in the corresponding audio frequency and video segmentation;
A6: client is downloaded corresponding sample according to the broadcast information of described sample from server end, and the sample that downloads is submitted to player plays.
Wherein, in the described steps A 6 when playing set by step the mode of A5 continue to download the second follow-up index and the sample of the broadcast information correspondence of record wherein, download until all sample and finish.
Wherein, in playing process, if player receives the user when dragging or clicking the message of playing progress bar, the timestamp in the broadcast information that player provides according to first index and second index is repositioned onto the key frame place that drags a correspondence to the document misregistration amount of key frame.
(3) beneficial effect
The present invention is by the time setting up the secondary index of sample at coding, and broadcast immediately after the broadcast information of downloading and having resolved in first second index before broadcast, thereby has shortened the preceding stand-by period of broadcast.
Description of drawings
Fig. 1 is a kind of audio/video coding method flow diagram of the embodiment of the invention;
Fig. 2 is the stored logic structure chart of coding method after to the MP4 document No. that utilizes Fig. 1;
Fig. 3 is that the audio-video document that utilizes the coding method of Fig. 1 to obtain is realized a kind of shorten program request and play before the audio frequency and video player method flow chart of stand-by period.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples are used for explanation the present invention, but are not used for limiting the scope of the invention.
Below in conjunction with the fixing MP4 audio-video document of frame per second coding method of the present invention is described, flow process as shown in Figure 1, the MP4 file after coding is finished as shown in Figure 2, this method specifically comprises step:
Step S101 arranges according to the ascending order of the timestamp of sampled data section sample in audio-video document, if the sample timestamp of different rails is identical, then arranges according to the sequencing of the rail that records in the audio-video document head.For the MP4 file its sample is sorted by the mode of this step.
Step S102, be that the border is divided into some groups with some sample with the audio frequency and video key frame, and be that every group of sample increases by second an index sbix atom in original audio-video document, recording the broadcast information of each sample in this group, the sample number in every group is more than or equal to 1.Wherein broadcast information comprises: the side-play amount hereof of sample, size, information such as reproduction time stamp.Preferably, the second index sbix atom is positioned in audio-video document before the corresponding sample grouping, and the sample corresponding with it grouping is deposited continuously.
Step S103, be followed successively by each second index sbix atom and set up the first index bfhd atom, record the information of described each second index sbix atom in audio-video document, it is sbixatom side-play amount hereof, the size of the second index sbix atom has also recorded the frame number of the beginning sample of each rail among each sbix atom.
Step S104, the first index bfhd atom is encoded in the audio-video document, and side-play amount hereof is respectively less than second index and sample side-play amount hereof, be arranged in the less position of side-play amount of the file of coding back generation, as: the located just of the first index bfhd atom in audio-video document is after metadata information mvhd atom.Preferably, the first index bfhd atom namely once stores first sbix atom to the information of last sbix atom by the sequencing coding of the second index sbix atom corresponding with it among the bfhd atom.
The coding finish after, the stored logic structure of MP4 file as shown in Figure 2, wherein every implication is:
Ftype atom: indicating this document is the mp4 file; Moov atom: file header; Mvhd atom: the explanation to the globality of file as total time, has several rails etc.; Bfhd atom: first index; Trak atom: the specifying and index an of rail; Mdat atom: data field; Sbix atom: second index; Sample: sampled data section.
As shown in Figure 3, realize shortening the audio frequency and video player method flow process that the preceding stand-by period is play in program request for the audio-video document (MP4 file) that the coding method that utilizes Fig. 1 obtains, specifically comprise:
Step S301, the user end to server end of Online Video VOD system sends request, begins the progressive download data from described audio-video document;
Step S302, client stops to download the data of back after downloading and having resolved the described first index bfhd atom;
Step S303, client finds the side-play amount of first second index sbix atom in audio-video document in the audio-video document according to the index information among the first index bfhd atom;
Step S304, client is sent request to server end again, and the indication server ignores data from current location (being the position of bfhd atom file header) to the afterbody of audio-video document head, and directly begins the download data from first second index sbix atom;
Step S305, client is resolved data downloaded, download when having finished the download of first second index sbix atom when being resolved to this, the information of resolving this second index sbix atom obtains the broadcast information of each sample in the corresponding audio frequency and video segmentation;
Step S306, client is downloaded corresponding sample according to the broadcast information of described sample from server end, and the sample that downloads is submitted to player plays.
Wherein, among the step S306 when playing set by step the mode of S305 continue to download the second follow-up index sbix atom and the sample of the broadcast information correspondence of record wherein, download until all sample and finish.Realize the function that limit bottom is broadcast like this, guaranteed smooth playing.
Wherein, in playing process, if player receives the user when dragging or clicking the message of playing progress bar, player is repositioned onto the key frame place that drags a correspondence, and bfhd atom and sbix atom provide the mapping method of reproduction time to key frame of video document misregistration amount.
Can be found out that by above step because do not need to download the index information of the script among the moov atom, and single sbix atom data volume is far smaller than moov atom, play the preceding required data volume of downloading so reduced.
Because the structure of having added the mp4 file of bfhd atom and sbix atom still meets the regulation of ISO/IEC14496-14 standard, so, for identifying and support bfhd atom among the Ben Geshi and the player of sbix atom, still can use the information among the former moov atom, resolve this mp4 file and play.
Because the sample in the file is tactic in strict accordance with reproduction time, so the order of client downloads sample is exactly the order of the back sample that need play, so, simplify the mutual of client-server end, improved the efficient of server end file disk read-write.
Because each sbix atom sample segmentation sequential storage corresponding with it together, so after beginning to play, only need the data on the progressive download file, the centre does not need redirect.
The user drags or clicks the key frame place that playing progress bar can cause player to be repositioned onto dragging a correspondence, and bfhd atom and sbix atom provide the mapping method of reproduction time to key frame of video document misregistration amount, make things convenient for the reorientation of player to realize.For the fixing mp4 file of frame per second, the broadcast point time corresponding multiply by frame per second, can calculate the frame number of this time point correspondence.In bfhd atom, recorded the frame number that each sbix atom begins, can obtain this frame thus and specifically belong to which sbix atom.Because first frame among each sbix atom is key frame.So the document misregistration amount of first frame among this sbix atom is exactly the document misregistration amount of the final key frame that needs.
With example beneficial effect of the present invention is described below.
Still doing example with 1 hour mp4 file of playing duration contrasts, its bfhd atom size is about 32~64k bytes, its first sbix atom size is about 3k bytes, the user still downloads data by the adsl of 1Mb/s, this part data of so best situation are downloaded and to be needed (32+3) * 8/1000=0.28 second approximately, the poorlyest need (64+3) * 8/1000=0.53 second approximately, compared with described 12~16 seconds before, the time shortened greatly.
Coding method of the present invention also is widely used in common audio-video documents such as RMVB, AVI, WMV and MPEG.
Above execution mode only is used for explanation the present invention; and be not limitation of the present invention; the those of ordinary skill in relevant technologies field; under the situation that does not break away from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all technical schemes that are equal to also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.

Claims (9)

1. an audio/video coding method is characterized in that, may further comprise the steps:
S1: in audio-video document, arrange according to the ascending order of the timestamp of sampled data section smaple, if the media data timestamp of different rails is identical, then arrange according to the sequencing of the rail that records in the described audio-video document head;
S2: be that the border is divided into some groups with some sample with the audio frequency and video key frame, and be that every group of sample increases by second index in original audio-video document, record the broadcast information of each sample in every group, the sample number in described every group is more than or equal to 1;
S3: be followed successively by each second index and set up first index, record the information of described each second index in audio-video document, the information of described second index in audio-video document comprises: second index side-play amount hereof, the frame number of the size of second index and the beginning sample of each rail in second index;
S4: described first index is encoded in the described audio-video document, and the side-play amount of the position of described first index in audio-video document is respectively less than second index and sample side-play amount hereof.
2. audio/video coding method as claimed in claim 1 is characterized in that, described second index is positioned in described audio-video document before the corresponding sample grouping.
3. audio/video coding method as claimed in claim 2 is characterized in that, the sample grouping that described second index is corresponding with it is deposited continuously.
4. audio/video coding method as claimed in claim 1 is characterized in that, described first index in described audio-video document located just after metadata information.
5. audio/video coding method as claimed in claim 1 is characterized in that, described first index is by the sequencing coding of second index corresponding with it.
6. as each described audio/video coding method in the claim 1~5, it is characterized in that described audio-video document is fixedly RMVB file, WMV file, mpeg file or the avi file of frame per second.
7. one kind is shortened the audio frequency and video player method that the preceding stand-by period is play in program request, it is characterized in that, the audio-video document of the audio-video document of program request for obtaining by the arbitrary described audio/video coding method coding of claim 1~5 may further comprise the steps:
A1: the user end to server end of Online Video VOD system sends request, begins the progressive download data from described audio-video document;
A2: client stops to download the data of back after downloading and having resolved described first index;
A3: client finds the side-play amount of first second index in audio-video document in the audio-video document according to the index information in first index;
A4: client is sent request to server end again, and indicates server to ignore the data of the afterbody from current location to the audio-video document head, and directly begins to download data from first second index;
A5: client is resolved data downloaded, downloads when having finished the download of first second index when being resolved to this, and the information of resolving this second index obtains the broadcast information of each sample in the corresponding audio frequency and video segmentation;
A6: client is downloaded corresponding sample according to the broadcast information of described sample from server end, and the sample that downloads is submitted to player plays.
8. the audio frequency and video player method of stand-by period before shortening program request as claimed in claim 7 is play, it is characterized in that, in the described steps A 6 when playing set by step the mode of A5 continue to download the second follow-up index and the sample of the broadcast information correspondence of record wherein, download until all sample and finish.
9. the audio frequency and video player method of stand-by period before shortening program request as claimed in claim 8 is play, it is characterized in that, in playing process, if player receives the user when dragging or clicking the message of playing progress bar, the timestamp in the broadcast information that player provides according to first index and second index is repositioned onto the key frame place that drags a correspondence to the document misregistration amount of key frame.
CN 201110138701 2011-05-26 2011-05-26 Audio and video coding method and playing method for shortening waiting time before on demand playing Active CN102170453B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110138701 CN102170453B (en) 2011-05-26 2011-05-26 Audio and video coding method and playing method for shortening waiting time before on demand playing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110138701 CN102170453B (en) 2011-05-26 2011-05-26 Audio and video coding method and playing method for shortening waiting time before on demand playing

Publications (2)

Publication Number Publication Date
CN102170453A CN102170453A (en) 2011-08-31
CN102170453B true CN102170453B (en) 2013-08-28

Family

ID=44491430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110138701 Active CN102170453B (en) 2011-05-26 2011-05-26 Audio and video coding method and playing method for shortening waiting time before on demand playing

Country Status (1)

Country Link
CN (1) CN102170453B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104661058B (en) * 2013-11-20 2018-01-16 深圳市云帆世纪科技有限公司 Data flow transmission method, client and the VOD system of MP4 video request programs
CN105451098A (en) * 2014-08-15 2016-03-30 北京风行在线技术有限公司 Method and device for providing multimedia file
CN105898531A (en) * 2015-12-07 2016-08-24 乐视云计算有限公司 Video cache file packaging method and system
CN105847990B (en) * 2016-03-30 2019-03-19 华为技术有限公司 The method and apparatus for playing media file
CN110225351B (en) * 2019-06-20 2021-07-09 北京达佳互联信息技术有限公司 Video file processing method and device, electronic equipment and storage medium
CN112511886B (en) * 2020-11-25 2023-03-21 杭州当虹科技股份有限公司 Audio and video synchronous playing method based on audio expansion and contraction
CN114697722A (en) * 2022-04-01 2022-07-01 湖南快乐阳光互动娱乐传媒有限公司 Video playing method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753947A (en) * 2008-12-08 2010-06-23 北京中星微电子有限公司 Method and device for video-on-demand playback of video monitoring recording
CN101984663A (en) * 2010-10-18 2011-03-09 中兴通讯股份有限公司 Play control method and system of monitoring audio/video

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200632691A (en) * 2005-03-03 2006-09-16 Ulead Systems Inc System and method for extracting data from a storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753947A (en) * 2008-12-08 2010-06-23 北京中星微电子有限公司 Method and device for video-on-demand playback of video monitoring recording
CN101984663A (en) * 2010-10-18 2011-03-09 中兴通讯股份有限公司 Play control method and system of monitoring audio/video

Also Published As

Publication number Publication date
CN102170453A (en) 2011-08-31

Similar Documents

Publication Publication Date Title
CN102170453B (en) Audio and video coding method and playing method for shortening waiting time before on demand playing
US11917323B2 (en) System and method for modifying media streams using metadata
US10459943B2 (en) System and method for splicing media files
US9654815B2 (en) Advertising detection in adaptive bitrate streaming
US8886896B2 (en) Storage format for media streams
CN103858440B (en) The hand off signaling method for improving switching is provided between the expression flowed for adaptive H TTP
CN102648609B (en) The stream method and apparatus that main contents are operated are inserted into by by other contents
CN101415069B (en) Server and method for sending on-line play video
US11616855B2 (en) Fragmenting media content
US20120272281A1 (en) Method and apparatus for transmitting media data, and method and apparatus for receving media data
US20090320060A1 (en) Advertisement signature tracking
US20090320063A1 (en) Local advertisement insertion detection
CN103069492A (en) Storage file format for multimedia streaming file, and storage method and client apparatus using the same
CN104661058A (en) MP4 video on demand data stream transmission method, client side and video on demand system
CN102647626B (en) Method and system for inserting advertisements in time shift program
CN106385525A (en) Video play method and device
CN101202894B (en) Method, system for playing program sequence and digital television receiver
KR101520788B1 (en) Method for Playing Movie Synchronous
JP2016213709A (en) Moving image reproduction system, client device, server device, and program
EP2812813B1 (en) Methods and systems for providing file data for a media file
US20130124699A1 (en) Apparatus and method for transceiving a streaming service
EP2524502B1 (en) Method and apparatus for processing transport streams
WO2019188485A1 (en) Information processing device, information processing device, and program
WO2013039042A1 (en) Reproduction device, reproduction method, distribution device, distribution system, reproduction program, and recording medium
EP2810446A1 (en) Methods and systems for providing file data for a media file

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent for invention or patent application
CB02 Change of applicant information

Address after: 100191, Haidian District, Xueyuan Road, No. 51, the first to enjoy the 13 floor of science and technology building, Beijing

Applicant after: Beijing Baofeng Technology Co., Ltd.

Address before: 100191, Haidian District, Xueyuan Road, No. 51, the first to enjoy the 13 floor of science and technology building, Beijing

Applicant before: Beijing Baofeng Network Tech. Co., Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: BEIJING BAOFENG NETWORK TECH. CO., LTD. TO: BEIJING BAOFENG TECHNOLOGY CO., LTD.

C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: 100191, Haidian District, Xueyuan Road, No. 51, the first to enjoy the 13 floor of science and technology building, Beijing

Patentee after: Storm group Limited by Share Ltd

Address before: 100191, Haidian District, Xueyuan Road, No. 51, the first to enjoy the 13 floor of science and technology building, Beijing

Patentee before: Beijing Baofeng Technology Co., Ltd.

PP01 Preservation of patent right

Effective date of registration: 20191018

Granted publication date: 20130828

PP01 Preservation of patent right
PD01 Discharge of preservation of patent
PD01 Discharge of preservation of patent

Date of cancellation: 20211018

Granted publication date: 20130828

PP01 Preservation of patent right

Effective date of registration: 20211018

Granted publication date: 20130828

PP01 Preservation of patent right