Summary of the invention
In view of this, the invention provides a kind of audio frequency and video playing method and device, to solve the problem of broadcasting existing blank screen that opens.
Particularly, described method comprises:
The multi-medium data receiving is buffered in data buffer storage region;
According to the processing speed of demultiplexing, from described data buffer storage region, read multi-medium data;
By described multi-medium data demultiplexing, be voice data and video data;
Decode described voice data and video data;
With the speed described decoded voice data of output and the video data be scheduled to, described predetermined speed is slower than the speed of the normal output of described multi-medium data.
Further, with the described decoded voice data of speed output be scheduled to and the process of video data, comprise:
By controlling the speed of frame of video output, control the speed of video data output;
The speed of controlling voice data output is synchronizeed with the speed of described video data output.
Further, the process that reads multi-medium data according to the processing speed of demultiplexing from described data buffer storage region comprises:
Judge in described data buffer storage region and whether be cached with multi-medium data;
If be cached with multi-medium data, further judge whether to carry out demultiplexing processing;
If can carry out demultiplexing processing, the multi-medium data in reading out data buffer zone.
Further, described predetermined speed is half of the normal output speed of described multi-medium data.
Further, described method also comprises:
When the multi-medium data amount in described data buffer storage region reaches the threshold value of setting, with the normal output speed described decoded voice data of output of described multi-medium data and video data.
Described audio and video display device comprises:
Data reception module, for being buffered in data buffer storage region by the multi-medium data receiving;
Demultiplexing module for reading multi-medium data according to the processing speed of demultiplexing from described data buffer storage region, and is voice data and video data by described multi-medium data demultiplexing;
Decoder module, for described voice data and the video data of decoding;
Audio frequency and video output module, for the speed described decoded voice data of output and video data to be scheduled to, described predetermined speed is slower than the speed of the normal output of described multi-medium data.
Further, described audio frequency and video output module comprises with the described decoded voice data of speed output be scheduled to and the process of video data: by controlling the speed of frame of video output, control the speed of video data output, and control the speed that the speed of voice data output exports with described video data and synchronize.
Further, the process that described decoder module reads multi-medium data from described data buffer storage region according to the processing speed of demultiplexing comprises:
Judge in described data buffer storage region and whether be cached with multi-medium data;
If be cached with multi-medium data, further judge whether to carry out demultiplexing processing;
If can carry out demultiplexing processing, the multi-medium data in reading out data buffer zone.
Further, described predetermined speed is half of the normal output speed of described multi-medium data.
Further, when the multi-medium data amount in described data buffer storage region reaches the threshold value of setting, described audio frequency and video output module is with the normal output speed described decoded voice data of output of described multi-medium data and video data.
As can be seen from the above step, the present invention, when video opens and broadcasts, without the multi-medium data receiving being cached to the threshold value of setting, just reads out according to the processing speed of demultiplexing the multi-medium data receiving from described data buffer storage region; To carrying out respectively the decoding of Voice & Video after the multi-medium data demultiplexing reading out, and the audio, video data after broadcast decoder, thereby the blank screen time of having avoided opening multimedia playing apparatus sowing time.Meanwhile, the present invention, by controlling the output speed of decoded voice data and video data, makes it to carry out playing audio-video data lower than normal playback speed, and the broadcasting of avoiding audio, video data is affected by network speed and the jitter phenomenon that occurs.
Embodiment
For video in above-mentioned prior art, open and occur the problems such as blank screen sowing time, the invention provides a kind of audio frequency and video player method, the method is applied in and includes: the terminal that intelligent television, panel computer, mobile phone etc. can displaying videos.For further illustrating the present invention, provide the following example:
Embodiment mono-
Please refer to Fig. 1, the audio frequency and video player method of the present embodiment comprises the following steps:
Step 101, is buffered in the multi-medium data receiving in data buffer storage region, so that demultiplexing is processed.
Step 102 reads multi-medium data according to the processing speed of demultiplexing from above-mentioned data buffer storage region, and is voice data and video data by this multi-medium data demultiplexing.
The multi-medium data reading from data buffer storage region is TS stream (Transport Stream, transport stream), and this TS stream is a kind of encapsulation format, and all voice datas, video data and some other supplementary all can be encapsulated into TS bag.After reading above-mentioned multi-medium data, carry out demultiplexing processing, it is voice data and video data that TS is wrapped to demultiplexing, for subsequent decoding and broadcasting.Particularly, the processing speed according to demultiplexing reads multi-medium data from data buffer storage region.The processing speed of described demultiplexing is the data volume that each second can demultiplexing, and for different chips, the maximum amount of data that each second can demultiplexing is different.As long as the multi-medium data reading does not reach above-mentioned maximum amount of data, just can from data buffer storage region, read again, to improve demultiplexing efficiency.
Step 103, decode above-mentioned voice data and video data.
Step 104, with the speed above-mentioned decoded voice data of output and the video data be scheduled to, described predetermined speed is slower than the speed of the normal output of described multi-medium data.
In above-mentioned steps, at video, open sowing time, without the multi-medium data receiving being cached to the threshold value of setting, just the multi-medium data receiving is read out from described data buffer storage region according to the processing speed of demultiplexing.To carrying out respectively the decoding of Voice & Video after multi-medium data demultiplexing, and the audio, video data after broadcast decoder, thereby avoided opening blank screen time of sowing time.
After completing the demultiplexing of multi-medium data, voice data and video data after decoding demultiplexing.Due to when receiving multi-medium data, do not carry out the control of multi-medium data amount, decoded amount of audio data and the video data volume just likely can not meet so that normal speed is smooth to be play.Meanwhile, the present invention, by controlling the output speed of decoded voice data and video data, makes it to carry out playing audio-video data lower than the speed of the normal output of multi-medium data, and the broadcasting of avoiding audio, video data is affected by network speed and the jitter phenomenon that causes.
In whole process, owing to having saved the time that multi-medium data amount is controlled, and then reach the object of quick broadcasting, reduce the blank screen time.Meanwhile, by regulating the output speed of voice data and video data, reduce the phenomenon that card pauses, shakes, realize smooth playing.
Embodiment bis-
The present embodiment further limits the process of exporting decoded voice data and video data with the speed of being scheduled on the basis of embodiment mono-: by controlling the speed of frame of video output, control the speed of video data output, and control the speed that the speed of voice data output exports with described video data and synchronize.
The present embodiment provides the concrete grammar of controlling video data output speed.Output speed for video data realizes by controlling the speed of frame of video output.Particularly, the normal output speed of video data of take is example as 30 frames are per second, if control video data output speed, is half of above-mentioned normal output speed, controls so decoded video data with the speed output per second of 15 frames.
The speed that can adopt known audio-visual synchronization algorithm to control voice data output is simultaneously synchronizeed with the speed of video data output.Such as, for the output speed Negotiation speed control algolithm (speed control algorithm) of voice data, realize.This speed control algorithm is ripe audio speed algorithm, and the algorithm based on time-frequency conversion and frequency spectrum processing carries out the variable-speed processing of audio frequency.By original digital audio being resampled with transformed samples rate, then the digital audio that has changed sample rate is transformed into the frequency spectrum that frequency domain obtains audio frequency, subsequently frequency spectrum is carried out to frequency spectrum shift, Spectrum Conversion after processing is returned to time domain, the general use of this algorithm can perfect reconstruction Short Time Fourier Transform realize, can effectively avoid because the voice distortion that speed change outputting audio data causes.
Embodiment tri-
The present embodiment further limits the process of multi-medium data that reads from described data buffer storage region according to the processing speed of demultiplexing on the basis of embodiment mono-:
Judge in described data buffer storage region and whether be cached with multi-medium data;
If be cached with multi-medium data, further judge whether to carry out demultiplexing processing;
If can carry out demultiplexing processing, the multi-medium data in reading out data buffer zone.
In actual applications, to multi-medium data demultiplexing, conventionally can use special-purpose demultiplexing chip, to reduce the processing pressure of CPU.For different demultiplexing chips, its processing speed is different, and the maximum amount of data that namely each second can demultiplexing is different.So in the present embodiment, in the unsaturated situation of demultiplexing disposal ability, namely the current multi-medium data amount reading does not reach above-mentioned maximum amount of data that can demultiplexing,, can also carry out, in the situation of demultiplexing processing, from data buffer storage region, reading multi-medium data, and carry out demultiplexing processing, improve demultiplexing efficiency, and then accelerate the broadcasting of multi-medium data.
Embodiment tetra-
The present embodiment, on the basis of embodiment mono-, further limits half that above-mentioned predetermined speed is the normal output speed of multi-medium data.
The present invention does not arrange the control to multi-medium data buffer memory, just carries out de-multiplex operation while having multi-medium data in data buffer storage region, by multi-medium data demultiplexing, is to carry out decode operation after voice data and video data.Owing to not carrying out buffer memory before broadcasting, so decoded amount of audio data and the video data volume may be play with normal output speed flow process not in the situation that of Bandwidth-Constrained, now, if export with normal output speed the situation that float or card just may appear in decoded voice data and video data.
For addressing this problem, the present embodiment setting is slower than the speed of the normal output of multi-medium data and exports decoded voice data and video data.Although it is slower that picture changes, and also can perceive the variation of picture.For the videos such as film, in a period of time starting at video, conventionally there is no essentiality content, can play publicity picture or the advertisement of some film companies, and also often can not be concerned by these contents, so even if picture changes slower, also easily perceived.User can notice be exactly the film of having selected to want to see after, player demonstrates the speed of picture than fast before a lot.
Preferably, above-mentioned predetermined speed be the normal output speed of multi-medium data half.If take, export at a slow speed two seconds as example, so within this time of two seconds, because output speed reduces by half, will save the cache-time of a second, utilize the cache-time of this second, can the more multi-medium data of buffer memory, further assurance can, in the situations such as Bandwidth-Constrained, realize smooth playing.
Embodiment five
The present embodiment is on the basis of embodiment mono-, when the multi-medium data amount in described data buffer storage region of being further limited to reaches the threshold value of setting, with the normal output speed described decoded voice data of output of multi-medium data and video data.
In order to open at video when broadcasting, present as early as possible picture, so the present invention controls the output speed of voice data and video data.The multi-medium data amount of above-mentioned data buffer storage region buffer memory arrive can normal play in, just with the normal output speed of multi-medium data, export decoded voice data and video data.
With current bandwidth and the disposal ability of player, conventionally opening the control of output at a slow speed of doing voice data and video data in two seconds that broadcast.That is to say, enough data buffer storages of time region buffer memory of two seconds can meet the multi-medium data amount with normal output speed smooth playing.
Embodiment six
The present invention also provides a kind of video play device of applying above-mentioned audio frequency and video player method, please refer to Fig. 2, and this device includes: data reception module 210, demultiplexing module 220, decoder module 230 and audio frequency and video output module 240.
Data reception module 210, is buffered in the multi-medium data receiving in data buffer storage region.
Demultiplexing module 220 reads multi-medium data according to the processing speed of demultiplexing from above-mentioned data buffer storage region, and is voice data and video data by multi-medium data demultiplexing;
Decoder module 230, decode above-mentioned voice data and video data;
Audio frequency and video output module 240, with the speed above-mentioned decoded voice data of output and the video data be scheduled to, described predetermined speed is slower than the speed of the normal output of above-mentioned multi-medium data.
In the present embodiment, at video, open sowing time, data reception module 210 is without being cached to the multi-medium data receiving the threshold value of setting, and demultiplexing module 220 reads out according to the processing speed of demultiplexing the multi-medium data receiving from described data buffer storage region.After 230 pairs of multi-medium data demultiplexings of decoder module, carry out respectively the decoding of Voice & Video, the audio, video data after audio frequency and video output module 240 broadcast decoders, thereby the blank screen time of having avoided opening multimedia playing apparatus sowing time.
After completing the demultiplexing of multi-medium data, voice data and video data after decoder module 230 decoding demultiplexings.Due to when receiving multi-medium data, do not carry out the control of multi-medium data amount, decoded amount of audio data and the video data volume just likely can not meet so that normal speed is smooth to be play.Simultaneously, the present invention controls the output speed of decoded voice data and video data by audio frequency and video output module 240, make it to carry out playing audio-video data lower than normal playback speed, the broadcasting of avoiding audio, video data affected by network speed and the card that causes pauses, jitter phenomenon.
In whole process, owing to having saved the time that multi-medium data amount is controlled, and then reach the object of quick broadcasting, reduce the blank screen time.Meanwhile, by regulating the output speed of voice data and video data, reduce the phenomenon that card pauses, shakes, realize smooth playing.
Further, the process that audio frequency and video output module 240 is exported decoded voice data and video data with the speed of being scheduled to comprises: by controlling the speed of frame of video output, control the speed of video data output, and control the speed that the speed of voice data output exports with above-mentioned video data and synchronize.
Audio frequency and video output module 240 is realized by controlling the speed of frame of video output for the output speed of video data.Particularly, the normal output speed of video data of take is example as 30 frames are per second, if control video data output speed, is half of above-mentioned normal output speed, controls so decoded video data with the speed output per second of 15 frames.The speed that audio frequency and video output module 240 adopts known audio-visual synchronization algorithm to control voice data output is simultaneously synchronizeed with the speed of video data output, has reached the object of output at a slow speed.
Further, the process that decoder module 230 reads multi-medium data from data buffer storage region according to the processing speed of demultiplexing comprises: judge in data buffer storage region, whether to be cached with multi-medium data; If be cached with multi-medium data, further judge whether to carry out demultiplexing processing; If can carry out demultiplexing processing, the multi-medium data in reading out data buffer zone.
Due to multi-medium data demultiplexing can be used to special-purpose demultiplexing chip conventionally, to reduce the processing pressure of CPU.For different demultiplexing chips, its disposal ability is different.So in the present embodiment, in the unsaturated situation of demultiplexing disposal ability, namely can also carry out in the situation of demultiplexing processing, from data buffer storage region, read multi-medium data, and carry out demultiplexing processing, improve demultiplexing efficiency, and then accelerate the broadcasting of multi-medium data.
Further, above-mentioned predetermined speed be the normal output speed of multi-medium data half.
Further, when the multi-medium data amount in data buffer storage region reaches the threshold value of setting, audio frequency and video output module 240 is exported decoded voice data and video data with the normal output speed of multi-medium data.
In order to open at video when broadcasting, present as early as possible picture, so control the output speed of voice data and video data.The multi-medium data amount of above-mentioned data buffer storage region buffer memory arrive can normal play in, just with normal speed, export decoded voice data and video data.
By above description, can be found out, the present invention when opening and broadcasting, the buffer control of the multi-medium data amount of not doing, carry out immediately demultiplexing, and by exporting at a slow speed decoded voice data and video data, the very first time presents picture, reducing card pauses and shake, smooth playing.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of making, be equal to replacement, improvement etc., within all should being included in the scope of protection of the invention.