CN107659819A - A kind of method and apparatus of video code conversion - Google Patents

A kind of method and apparatus of video code conversion Download PDF

Info

Publication number
CN107659819A
CN107659819A CN201711038561.0A CN201711038561A CN107659819A CN 107659819 A CN107659819 A CN 107659819A CN 201711038561 A CN201711038561 A CN 201711038561A CN 107659819 A CN107659819 A CN 107659819A
Authority
CN
China
Prior art keywords
code check
video
bit rate
target video
rate
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.)
Granted
Application number
CN201711038561.0A
Other languages
Chinese (zh)
Other versions
CN107659819B (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.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN201711038561.0A priority Critical patent/CN107659819B/en
Publication of CN107659819A publication Critical patent/CN107659819A/en
Application granted granted Critical
Publication of CN107659819B publication Critical patent/CN107659819B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display

Abstract

The invention discloses a kind of method and apparatus of video code conversion, belong to field of computer technology.Methods described includes:Obtain the video data bag of the target video after decapsulation;Periodically calculate the local average code check in the global average bit rate and predetermined period of the target video;According to the global average bit rate and the local average code check, encoder bit rate is adjusted;Based on the encoder bit rate after adjustment, transcoding processing is carried out to the target video.Using the present invention, it can to greatest extent ensure to export the code check of video and the code check of input video is basically identical, so as to improve the effect of video code conversion.

Description

A kind of method and apparatus of video code conversion
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and apparatus of video code conversion.
Background technology
Along with the development of Internet technology and the continuous speed-raising of modern bandwidth, what the life of internet and people contacted Increasingly closely, increasing people are keen to obtain video in internet to enrich life, instantly, high-quality high quality Video has turned into the first choice of people's daily demand.
Needs based on publicity or copyright protection, the publisher of video often add exclusive in the video data of issue Watermark, to avoid video data from being usurped by other people.(it can claim specifically, publisher can first obtain packaged initial video For input video), then the video data to initial video is decapsulated, decoded, then in each two field picture in video Watermark is added, afterwards, publisher can be encoded to the video data for add watermark, encapsulated again, so that by final video (being properly termed as exporting video) is supplied to recipient (such as relay side or spectators).The above-mentioned process to video data processing It is properly termed as the transcoding processing to video data.
During the present invention is realized, inventor has found that prior art at least has problems with:
If the code check of transcoding rear video is too small, the image quality of video will be very poor, in addition occur distortion or Mosaic phenomenon, and if the code check of transcoding rear video is excessive, then it can cause the waste for transmitting video Time Bandwidth resource, so, The code check of output video is then needed as close possible to the code check of input video.However, influenceed by different coding pattern, during transcoding It is difficult to accurately know the code check of input video, so, the effect of video code conversion is poor.
The content of the invention
In order to solve problem of the prior art, the embodiments of the invention provide a kind of method and apparatus of video code conversion.Institute It is as follows to state technical scheme:
First aspect, there is provided a kind of method of video code conversion, methods described include:
Obtain the video data bag of the target video after decapsulation;
Periodically calculate the local average code check in the global average bit rate and predetermined period of the target video;
According to the global average bit rate and the local average code check, encoder bit rate is adjusted;
Based on the encoder bit rate after adjustment, transcoding processing is carried out to the target video.
Optionally, the periodicity calculates the local average in the global average bit rate and predetermined period of the target video Code check, including:
The data volume of the video data bag is accumulate to the global data amount of the target video got and pre- If in local data's amount of the target video got in the cycle;
According to decoded time stamp corresponding to the video data bag, determine the duration of decoding of the target video and preset Cycle duration;
Using the global data amount and the business for having decoded duration as global average bit rate, and by the local data The business of amount and the predetermined period duration is as local average code check.
Optionally, it is described according to the global average bit rate and the local average code check, encoder bit rate is adjusted, Including:
If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, the office is judged Whether portion's average bit rate is more than default minimum code rate reference value;
If it is, the encoder bit rate is arranged to the local average code check, if it is not, then will be described global flat Maximum in equal code check and the minimum code rate reference value is as the encoder bit rate.
Optionally, if the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, Then judge whether the local average code check is more than default minimum code rate reference value, including:
If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, and has decoded duration More than preset duration, then judge whether the local average code check is more than default minimum code rate reference value.
Optionally, methods described also includes:
If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, and has decoded duration Less than preset duration, then using the maximum in the local average code check and default maximal rate reference value as the coding Code check.
Optionally, methods described also includes:
The attribute information of the target video is obtained, the target point of the target video is comprised at least in the attribute information Resolution and target frame rate.
Optionally, methods described also includes:
Determine the attribute information of the target video and the mathematical relationship of default standard attribute information;
According to standard code check corresponding to the mathematical relationship and the standard attribute information, the target video is determined most Small code check reference value and maximal rate reference value.
Second aspect, there is provided a kind of device of video code conversion, described device include:
First acquisition module, for obtaining the video data bag of the target video after decapsulating;
Computing module, the part in global average bit rate and predetermined period for periodically calculating the target video are put down Equal code check;
Adjusting module, for according to the global average bit rate and the local average code check, being adjusted to encoder bit rate It is whole;
Transcoding module, for based on the encoder bit rate after adjustment, transcoding processing to be carried out to the target video.
Optionally, the computing module, is specifically used for:
The data volume of the video data bag is accumulate to the global data amount of the target video got and pre- If in local data's amount of the target video got in the cycle;
According to decoded time stamp corresponding to the video data bag, determine the duration of decoding of the target video and preset Cycle duration;
Using the global data amount and the business for having decoded duration as global average bit rate, and by the local data The business of amount and the predetermined period duration is as local average code check.
Optionally, the adjusting module, is specifically used for:
If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, the office is judged Whether portion's average bit rate is more than default minimum code rate reference value;
If it is, the encoder bit rate is arranged to the local average code check, if it is not, then will be described global flat Maximum in equal code check and the minimum code rate reference value is as the encoder bit rate.
Optionally, the adjusting module, is specifically used for:
If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, and has decoded duration More than preset duration, then judge whether the local average code check is more than default minimum code rate reference value.
Optionally, the adjusting module, is additionally operable to:
If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, and has decoded duration Less than preset duration, then using the maximum in the local average code check and default maximal rate reference value as the coding Code check.
Optionally, described device also includes:
Second acquisition module, for obtaining the attribute information of the target video, institute is comprised at least in the attribute information State the target resolution and target frame rate of target video.
Optionally, described device also includes:
First determining module, for determining the attribute information of the target video and the mathematics of default standard attribute information Relation.
Optionally, described device also includes:
Second determining module, for the standard code check according to corresponding to the mathematical relationship and the standard attribute information, really The minimum code rate reference value and maximal rate reference value of the fixed target video.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
In the embodiment of the present invention, server obtains the video data bag of the target video after decapsulation, periodically calculates mesh The local average code check in the global average bit rate and predetermined period of video is marked, according to global average bit rate and local average code Rate, encoder bit rate is adjusted, based on the encoder bit rate after adjustment, transcoding processing is carried out to target video.So, to mesh During marking video progress transcoding, server can carry out real-time detection to encoder bit rate, and be adjusted in time according to result of detection Whole encoder bit rate, it can to greatest extent ensure to export the code check of video and the code check of input video is basically identical, so as to Improve the effect of video code conversion.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, make required in being described below to embodiment Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1 is a kind of method flow diagram of video code conversion provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic flow sheet for adjusting encoder bit rate provided in an embodiment of the present invention;
Fig. 3 is a kind of step schematic diagram of video code conversion provided in an embodiment of the present invention;
Fig. 4 is a kind of apparatus structure schematic diagram of video code conversion provided in an embodiment of the present invention;
Fig. 5 is a kind of apparatus structure schematic diagram of video code conversion provided in an embodiment of the present invention;
Fig. 6 is a kind of structural representation of server provided in an embodiment of the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention Formula is described in further detail.
The embodiments of the invention provide a kind of method of video code conversion, the executive agent of this method can be server.Its In, server can be the server for possessing video code conversion function, and such as the server of video distribution side, server is regarded receiving Frequency can carry out transcoding processing to video, the video after transcoding then is supplied into the external world after.Above-mentioned server can wrap Include processor, memory, transceiver, processor can be used for the processing for carrying out video code conversion in following flows, and memory can be with For storing the data needed in following processing procedures and caused data, transceiver can be used for receiving and send following places Related data during reason, such as it is used to receive input video and sends output video.Using server to be live in the present embodiment Illustrated exemplified by the management server of platform, other situations are similar, no longer introduce one by one.
Below in conjunction with embodiment, the handling process shown in Fig. 1 is described in detail, content can be as Under:
Step 101, the video data bag of the target video after decapsulation is obtained.
In force, main broadcaster direct broadcasting room start it is live after, the data acquisition equipment of main broadcaster side can gather in real time to be used for Picture, sound of live video etc. are generated, then corresponding live video is generated by video production devices, and by video transmission equipment The live video is sent to the server of live platform in real time.So, server can receive the live of main broadcaster side transmission The video data of video.Before the live video is transmitted to the spectators of direct broadcasting room by server, video can be carried out to live video Transcoding, to add watermark in video pictures.Specifically, server can first obtain the encapsulation of live video (i.e. target video) The information such as form, audio frequency and video parameter and codec parameters, then above-mentioned target video is carried out according to encapsulation format corresponding Decapsulation, so as to obtain the video data of the target video after decapsulation.Herein, the video data of target video will with regarding The form of frequency packet obtains, and each video data bag corresponds to a picture frame in video.Certainly, disclosed in the present embodiment It is a kind of method of video code conversion, is not only applicable to add watermark in video pictures, can be also used for other reasonables Processing.
Step 102, the local average code check in the global average bit rate and predetermined period of target video is periodically calculated.
In force, server can periodically calculate target video when obtaining the video data bag of target video Global average bit rate Rg and predetermined period in local average code check Rt.Specifically, it can be counted at each cycle end All data volumes (can be described as global data amount) of the target video got, and since decoding undergone till now when Long (can be described as having decoded duration), and then using global data amount and the business of duration can have been decoded as global average bit rate Rg. At the same time it can also count all data volumes of the target video got in predetermined period (can be described as local data's amount), so Afterwards using the business of local data's amount and predetermined period duration as the local average code check Rt in predetermined period.
Optionally, when calculating global average bit rate and local average bit rate, can consider currently to obtain video counts simultaneously According to bag, accordingly, the processing of step 102 can be as follows:The data volume of video data bag is accumulate to the target got to regard In local data's amount of the target video got in the global data amount and predetermined period of frequency;It is corresponding according to video data bag Decoded time stamp, determine the duration of decoding and predetermined period duration of target video;By global data amount and duration is decoded Business as global average bit rate, and using local data amount and predetermined period duration business as local average code check.
In force, server, can be by the video data bag after some video data bag of target video is obtained Data volume be accumulate to the target video that has been got in the global data amount and predetermined period of the target video got In local data's amount.Meanwhile server can also obtain the video data bag corresponding to decoded time stamp, be then based on the decoding Timestamp determines the duration of decoding and predetermined period duration of target video, for example, the decoding time corresponding to the video data bag It is t1 that stamp, which is converted to local zone time, and it is t2 that decoded time stamp corresponding to a upper video data bag, which is converted into local zone time, it is known that solution A length of T1 when code starts to undergo till now, a length of T2 during predetermined period, it is when t1-t2 is less than T2, then next without processing, wait The reception of secondary video data bag, when t1-t2 is more than T2, just calculate the average bit rate in current period.Afterwards, server can be with Using the above-mentioned global data amount calculated and the business for having decoded duration as global average bit rate Rg, and by local data's amount and in advance If the business of cycle duration is as local average code check Rt.Predetermined period duration in the present embodiment, is not necessarily fixed value, can be with Depending on actual use situation and demand.
Step 103, according to global average bit rate and local average bit rate, encoder bit rate is adjusted.
In force, local average of the server in the global average bit rate Rg and predetermined period for calculating target video After code check Rt, currently used encoder bit rate R can be adjusted according to global average bit rate Rg and local average bit rate Rt It is whole.For example, the local average code check Rt and currently used encoder bit rate can be made comparisons, if both absolute differences surpass Predetermined threshold value is crossed, then encoder bit rate can be adjusted to above-mentioned global average bit rate Rg value.If both absolute differences are not More than predetermined threshold value, then keep current encoder bit rate constant.Certainly, specifically the scheme of adjustment encoder bit rate is varied, this Place is only exemplarily to give a kind of scheme of simple possible.It is noted that for ABR (available bit- Rate, Available Bit Rate) and two kinds of different coding modes of VBR (Variable Bit Rate, dynamic bit rate), setting Encoder bit rate can be the maximal rate under VBR coding modes, or be the average bit rate under ABR coding modes.
Optionally, in order to avoid under VBR coding modes, cause certain time because video pictures are static or scene is simple Code check in section is too small, can set corresponding code check reference value, accordingly, the processing of step 103 can be as follows:It is if local The absolute difference of average bit rate and present encoding code check is more than predetermined threshold value, then it is default to judge whether local average code check is more than Minimum code rate reference value;If it is, encoder bit rate is arranged into local average code check, if it is not, then by global average code Maximum in rate and minimum code rate reference value is as encoder bit rate.
Wherein, predetermined threshold value can be that technical staff is used for during judging video code conversion, and whether code check fluctuation is excessive, is It is no to need to update encoder bit rate, an and standard value set in advance.
In force, for target video, the minimum code rate reference value of the video can be previously provided with server, i.e., Under any circumstance, the encoder bit rate of target video is not less than the minimum code rate reference value.So, server is calculating mesh After marking the local average code check Rt in the global average bit rate Rg and predetermined period of video, by local average code check Rt and it can work as Preceding encoder bit rate is compared, if both absolute difference is more than predetermined threshold value, may determine that local average code check Rt with The size of both default minimum code rate reference values.If local average code check Rt is more than above-mentioned minimum code rate reference value, can So that encoder bit rate directly is arranged into local average code check Rt;And if local average code check Rt is not more than above-mentioned minimum code rate Reference value, then the maximum in both global average bit rate Rg and minimum code rate reference value can be chosen as encoder bit rate.When So, if the absolute difference of local average code check Rt and present encoding code check keeps current coding not less than predetermined threshold value Code check is constant.
Optionally, due to the characteristic of average value, the more average values of data are closer to actual value, in the incipient stage of transcoding Because the global average bit rate of data volume is too small and causes to calculate input video stream is without reference to value, to avoid the feelings Condition, there can be following processing:If the absolute difference of local average code check and present encoding code check is more than predetermined threshold value, and has solved Code duration is more than preset duration, then judges whether local average code check is more than default minimum code rate reference value;It is if local flat The absolute difference of equal code check and present encoding code check is more than predetermined threshold value, and has decoded duration and be less than preset duration, then will be local Maximum in average bit rate and default maximal rate reference value is as encoder bit rate.
In force, it is similar with minimum code rate reference value, for target video, this can also be previously provided with server The maximal rate reference value of video, i.e., under any circumstance, the encoder bit rate of target video refer to no more than the minimum code rate Value.So, after local average code check Rt of the server in the global average bit rate Rg and predetermined period for calculating target video, Local average code check Rt and present encoding code check can be compared, if both absolute differences are more than predetermined threshold value, and Decode duration and be more than preset duration, then can carry out the big of both local average code check Rt and default minimum code rate reference value Small judgement processing, and the processing according to judged result adjustment encoder bit rate, are specifically referred to step 103.And if local Average bit rate Rt and present encoding code check absolute difference are more than predetermined threshold value, but have decoded duration and be less than preset duration, then may be used To regard the maximum in local average code check Rt and default maximal rate reference value as encoder bit rate.It is noted that In order to avoid transcoding rear video image quality is poor, can in the transcoding starting stage, by encoder bit rate value be initialized as it is above-mentioned most Big code check reference value.
Optionally, the calculating standard of minimum code rate reference value and maximal rate reference value is varied, can be according to target The attribute information of video is specifically calculated, and corresponding processing can be as follows:Obtain the attribute information of target video;Determine mesh Mark the attribute information of video and the mathematical relationship of default standard attribute information;It is corresponding according to mathematical relationship and standard attribute information Standard code check, determine the minimum code rate reference value and maximal rate reference value of target video.
Wherein, the target resolution and target frame rate of target video are comprised at least in attribute information.
In force, server can be set with the standard attribute information of video and the corresponding relation of standard code check, and this is right Should be related to can get according to historical data or empirical statistics.So, the minimum code rate reference of target video is being calculated When value and maximal rate reference value, the attribute information of target video can be first obtained, is regarded in the attribute information including at least target The target resolution and target frame rate of frequency, then determine the attribute information of target video and default standard category according to preset algorithm The mathematical relationship of property information.Preset algorithm can be carried out with varied by technical staff according to the reasonability of data herein Selection, the present embodiment do not limit specific algorithm.For example, target resolution is weight1*height1, target frame rate is Fps1, the standard resolution in standard attribute information is weight0*height0, and standard frame per second is fps0, and mathematical relationship then may be used To be:F (s)=(weight1*height1*fps1)/(weight0*height0*fps0), or mathematical relationship can be with It is:G (s)=log (weight1*height1*fps1)/log (weight0*height0*fps0).Afterwards, can be according to upper Standard code check corresponding to stating mathematical relationship and standard attribute information, determine the minimum code rate reference value and maximal rate of target video Reference value.Specifically, when standard code check is R0, then there may be R1=R0*f (s), R2=R0*g (s), and then, maximum code Rate reference value is Rmax=MAX (R1, R2);Minimum code rate reference value is Rmin=MIN (R1, R2).
Whole processing of above-mentioned adjustment encoder bit rate may be referred to shown in Fig. 2.
Step 104, based on the encoder bit rate after adjustment, transcoding processing is carried out to target video.
In force, server is entered based on above-mentioned global average bit rate Rg and local average bit rate Rt to encoder bit rate After row adjustment, transcoding processing can be carried out to target video, that is, decoded, at filter based on the encoder bit rate after adjustment The reason processing of watermark (include addition), recompile and the step such as export, up to adjusting encoder bit rate next time.
In order to make it easy to understand, Fig. 3 shows the overall flow of video code conversion, particular content can be as follows:1st, server is read Take target video;2nd, the information such as target video encapsulation format, video parameter and codec parameters are obtained;3rd, to target video solution Encapsulation, separates its audio, video data;4.1st, for video data, encoder bit rate is adjusted, and encoder bit rate is set and arrives encoder Parameter in;4.2nd, the video data of target video is decoded;4.3rd, filter processing is carried out to the picture frame of video data;4.4th, compile Video data after code filter processing;5.1st, for voice data, decoding audio data;5.2nd, to the voice data of target video Carry out filter processing;5.3rd, the voice data after filter processing is encoded;6th, according to output file type package target video;7th, it is defeated Go out target video.
In the embodiment of the present invention, server obtains the video data bag of the target video after decapsulation, periodically calculates mesh The local average code check in the global average bit rate and predetermined period of video is marked, according to global average bit rate and local average code Rate, encoder bit rate is adjusted, based on the encoder bit rate after adjustment, transcoding processing is carried out to target video.So, to mesh During marking video progress transcoding, server can carry out real-time detection to encoder bit rate, and be adjusted in time according to result of detection Whole encoder bit rate, it can to greatest extent ensure to export the code check of video and the code check of input video is basically identical, so as to Improve the effect of video code conversion.
Based on identical technical concept, the embodiment of the present invention additionally provides a kind of device of video code conversion, as shown in figure 4, Described device includes:
First acquisition module 401, for obtaining the video data bag of the target video after decapsulating;
Computing module 402, the office in global average bit rate and predetermined period for periodically calculating the target video Portion's average bit rate;
Adjusting module 403, for according to the global average bit rate and the local average code check, being carried out to encoder bit rate Adjustment;
Transcoding module 404, for based on the encoder bit rate after adjustment, transcoding processing to be carried out to the target video.
Optionally, the computing module 402, is specifically used for:
The data volume of the video data bag is accumulate to the global data amount of the target video got and pre- If in local data's amount of the target video got in the cycle;
According to decoded time stamp corresponding to the video data bag, determine the duration of decoding of the target video and preset Cycle duration;
Using the global data amount and the business for having decoded duration as global average bit rate, and by the local data The business of amount and the predetermined period duration is as local average code check.
Optionally, the adjusting module 403, is specifically used for:
If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, the office is judged Whether portion's average bit rate is more than default minimum code rate reference value;
If it is, the encoder bit rate is arranged to the local average code check, if it is not, then will be described global flat Maximum in equal code check and the minimum code rate reference value is as the encoder bit rate.
Optionally, the adjusting module 403, is specifically used for:
If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, and has decoded duration More than preset duration, then judge whether the local average code check is more than default minimum code rate reference value.
Optionally, the adjusting module, is additionally operable to:
If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, and has decoded duration Less than preset duration, then using the maximum in the local average code check and default maximal rate reference value as the coding Code check.
Optionally, as shown in figure 5, described device also includes:
Second acquisition module 405, for obtaining the attribute information of the target video, comprised at least in the attribute information The target resolution and target frame rate of the target video;
First determining module 406, for the attribute information for determining the target video and default standard attribute information Mathematical relationship;
Second determining module 407, for the standard code check according to corresponding to the mathematical relationship and the standard attribute information, Determine the minimum code rate reference value and maximal rate reference value of the target video.
In the embodiment of the present invention, server obtains the video data bag of the target video after decapsulation, periodically calculates mesh The local average code check in the global average bit rate and predetermined period of video is marked, according to global average bit rate and local average code Rate, encoder bit rate is adjusted, based on the encoder bit rate after adjustment, transcoding processing is carried out to target video.So, to mesh During marking video progress transcoding, server can carry out real-time detection to encoder bit rate, and be adjusted in time according to result of detection Whole encoder bit rate, it can to greatest extent ensure to export the code check of video and the code check of input video is basically identical, so as to Improve the effect of video code conversion.
Fig. 6 is the structural representation of server provided in an embodiment of the present invention.The server 600 can because configuration or performance not With and produce bigger difference, can include one or more central processing units 622 (for example, one or more Processor) and memory 632, the storage medium 630 (such as one of one or more storage application programs 642 or data 644 Individual or more than one mass memory unit).Wherein, memory 632 and storage medium 630 can be of short duration storage or persistently deposit Storage.One or more modules (diagram does not mark) can be included by being stored in the program of storage medium 630, and each module can be with Including being operated to the series of instructions in server.Further, central processing unit 622 could be arranged to and storage medium 630 communications, the series of instructions operation in storage medium 630 is performed on server 600.
Server 600 can also include one or more power supplys 626, one or more wired or wireless networks Interface 650, one or more input/output interfaces 658, one or more keyboards 656, and/or, one or one Above operating system 641, such as Windows Server TM, Mac OS XTM, Unix TM, Linux TM, FreeBSD TM Etc..
Server 600 can include memory, and one or more than one program, one of them or one Procedure above is stored in memory, and be configured to by one either more than one computing device it is one or one Procedure above includes the instruction for being used for carrying out above-mentioned video code conversion.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment To complete, by program the hardware of correlation can also be instructed to complete, described program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent substitution and improvements made etc., it should be included in the scope of the protection.

Claims (15)

  1. A kind of 1. method of video code conversion, it is characterised in that methods described includes:
    Obtain the video data bag of the target video after decapsulation;
    Periodically calculate the local average code check in the global average bit rate and predetermined period of the target video;
    According to the global average bit rate and the local average code check, encoder bit rate is adjusted;
    Based on the encoder bit rate after adjustment, transcoding processing is carried out to the target video.
  2. 2. according to the method for claim 1, it is characterised in that the overall situation that the periodicity calculates the target video is averaged Local average code check in code check and predetermined period, including:
    The data volume of the video data bag is accumulate to the global data amount of the target video got and default week In local data's amount of the target video got in phase;
    According to decoded time stamp corresponding to the video data bag, the duration of decoding and predetermined period of the target video are determined Duration;
    Using the global data amount and the business for having decoded duration as global average bit rate, and by the local data amount and The business of the predetermined period duration is as local average code check.
  3. 3. according to the method for claim 1, it is characterised in that described to be put down according to the global average bit rate and the part Equal code check, is adjusted to encoder bit rate, including:
    If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, judge that the part is put down Whether equal code check is more than default minimum code rate reference value;
    If it is, the encoder bit rate is arranged into the local average code check, if it is not, then by the global average code Maximum in rate and the minimum code rate reference value is as the encoder bit rate.
  4. 4. according to the method for claim 3, it is characterised in that if the local average code check and present encoding code The absolute difference of rate is more than predetermined threshold value, then judges whether the local average code check is more than default minimum code rate reference value, Including:
    If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, and has decoded duration and be more than Preset duration, then judge whether the local average code check is more than default minimum code rate reference value.
  5. 5. according to the method for claim 4, it is characterised in that methods described also includes:
    If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, and has decoded duration and be less than Preset duration, then using the maximum in the local average code check and default maximal rate reference value as the coding code Rate.
  6. 6. the method according to any one of claim 3 to 5, it is characterised in that methods described also includes:
    The attribute information of the target video is obtained, the target resolution of the target video is comprised at least in the attribute information And target frame rate.
  7. 7. the method according to any one of claim 3 to 5, it is characterised in that methods described also includes:
    Determine the attribute information of the target video and the mathematical relationship of default standard attribute information;
    According to standard code check corresponding to the mathematical relationship and the standard attribute information, the minimum code of the target video is determined Rate reference value and maximal rate reference value.
  8. 8. a kind of device of video code conversion, it is characterised in that described device includes:
    First acquisition module, for obtaining the video data bag of the target video after decapsulating;
    Computing module, the local average code in global average bit rate and predetermined period for periodically calculating the target video Rate;
    Adjusting module, for according to the global average bit rate and the local average code check, being adjusted to encoder bit rate;
    Transcoding module, for based on the encoder bit rate after adjustment, transcoding processing to be carried out to the target video.
  9. 9. device according to claim 8, it is characterised in that the computing module, be specifically used for:
    The data volume of the video data bag is accumulate to the global data amount of the target video got and default week In local data's amount of the target video got in phase;
    According to decoded time stamp corresponding to the video data bag, the duration of decoding and predetermined period of the target video are determined Duration;
    Using the global data amount and the business for having decoded duration as global average bit rate, and by the local data amount and The business of the predetermined period duration is as local average code check.
  10. 10. device according to claim 8, it is characterised in that the adjusting module, be specifically used for:
    If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, judge that the part is put down Whether equal code check is more than default minimum code rate reference value;
    If it is, the encoder bit rate is arranged into the local average code check, if it is not, then by the global average code Maximum in rate and the minimum code rate reference value is as the encoder bit rate.
  11. 11. device according to claim 10, it is characterised in that the adjusting module, be specifically used for:
    If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, and has decoded duration and be more than Preset duration, then judge whether the local average code check is more than default minimum code rate reference value.
  12. 12. device according to claim 11, it is characterised in that the adjusting module, be additionally operable to:
    If the absolute difference of the local average code check and present encoding code check is more than predetermined threshold value, and has decoded duration and be less than Preset duration, then using the maximum in the local average code check and default maximal rate reference value as the coding code Rate.
  13. 13. the device according to any one of claim 10 to 12, it is characterised in that described device also includes:
    Second acquisition module, for obtaining the attribute information of the target video, the mesh is comprised at least in the attribute information Mark the target resolution and target frame rate of video.
  14. 14. the device according to any one of claim 10 to 12, it is characterised in that described device also includes:
    First determining module, for determining that the attribute information of the target video and the mathematics of default standard attribute information close System.
  15. 15. device according to claim 14, it is characterised in that described device also includes:
    Second determining module, for the standard code check according to corresponding to the mathematical relationship and the standard attribute information, determine institute State the minimum code rate reference value and maximal rate reference value of target video.
CN201711038561.0A 2017-10-30 2017-10-30 A kind of method and apparatus of video code conversion Active CN107659819B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711038561.0A CN107659819B (en) 2017-10-30 2017-10-30 A kind of method and apparatus of video code conversion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711038561.0A CN107659819B (en) 2017-10-30 2017-10-30 A kind of method and apparatus of video code conversion

Publications (2)

Publication Number Publication Date
CN107659819A true CN107659819A (en) 2018-02-02
CN107659819B CN107659819B (en) 2019-10-25

Family

ID=61096563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711038561.0A Active CN107659819B (en) 2017-10-30 2017-10-30 A kind of method and apparatus of video code conversion

Country Status (1)

Country Link
CN (1) CN107659819B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109379630A (en) * 2018-11-27 2019-02-22 Oppo广东移动通信有限公司 Method for processing video frequency, device, electronic equipment and storage medium
CN109788316A (en) * 2019-02-27 2019-05-21 腾讯科技(深圳)有限公司 Code rate control, video transcoding method and device, computer equipment and storage medium
CN109862442A (en) * 2019-02-22 2019-06-07 伟乐视讯科技股份有限公司 A kind of input method for stream processing and processing unit based on IP transmission
CN110913245A (en) * 2019-11-08 2020-03-24 网宿科技股份有限公司 Method and device for controlling video transcoding code rate
CN111193924A (en) * 2019-12-26 2020-05-22 腾讯科技(深圳)有限公司 Method and device for determining video code rate, computer equipment and storage medium
CN117478958A (en) * 2023-09-19 2024-01-30 广州开得联软件技术有限公司 Video playing method, device, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020168007A1 (en) * 2001-04-19 2002-11-14 Sarnoff Corporation Apparatus and method for allocating bits temporaly between frames in a coding system
KR20060104933A (en) * 2005-03-28 2006-10-09 가시오 히타치 모바일 커뮤니케이션즈 컴퍼니 리미티드 Image processing apparatus and computer-readable storage medium
US20090161697A1 (en) * 2007-12-19 2009-06-25 General Instrument Corporation Method and System for Interleaving Video and Data for Transmission over a Network at a Selected Bit Rate
CN104159109A (en) * 2014-05-28 2014-11-19 百视通网络电视技术发展有限责任公司 Bit rate control method and system based on VBR video encoding
CN104717507A (en) * 2015-03-31 2015-06-17 北京奇艺世纪科技有限公司 Video transcoding method and device
CN105451099A (en) * 2014-08-19 2016-03-30 北京大学 Method and device for adjusting video code rate
CN105847805A (en) * 2016-03-30 2016-08-10 乐视控股(北京)有限公司 Sliding window-based code rate control method and apparatus
CN106331704A (en) * 2015-07-07 2017-01-11 杭州海康威视数字技术股份有限公司 Video code rate control method and video coding device
US9769231B1 (en) * 2011-04-01 2017-09-19 Arris Enterprises Llc QoS for adaptable HTTP video

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020168007A1 (en) * 2001-04-19 2002-11-14 Sarnoff Corporation Apparatus and method for allocating bits temporaly between frames in a coding system
KR20060104933A (en) * 2005-03-28 2006-10-09 가시오 히타치 모바일 커뮤니케이션즈 컴퍼니 리미티드 Image processing apparatus and computer-readable storage medium
US20090161697A1 (en) * 2007-12-19 2009-06-25 General Instrument Corporation Method and System for Interleaving Video and Data for Transmission over a Network at a Selected Bit Rate
US9769231B1 (en) * 2011-04-01 2017-09-19 Arris Enterprises Llc QoS for adaptable HTTP video
CN104159109A (en) * 2014-05-28 2014-11-19 百视通网络电视技术发展有限责任公司 Bit rate control method and system based on VBR video encoding
CN105451099A (en) * 2014-08-19 2016-03-30 北京大学 Method and device for adjusting video code rate
CN104717507A (en) * 2015-03-31 2015-06-17 北京奇艺世纪科技有限公司 Video transcoding method and device
CN106331704A (en) * 2015-07-07 2017-01-11 杭州海康威视数字技术股份有限公司 Video code rate control method and video coding device
CN105847805A (en) * 2016-03-30 2016-08-10 乐视控股(北京)有限公司 Sliding window-based code rate control method and apparatus

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109379630A (en) * 2018-11-27 2019-02-22 Oppo广东移动通信有限公司 Method for processing video frequency, device, electronic equipment and storage medium
CN109379630B (en) * 2018-11-27 2021-03-12 Oppo广东移动通信有限公司 Video processing method and device, electronic equipment and storage medium
CN109862442A (en) * 2019-02-22 2019-06-07 伟乐视讯科技股份有限公司 A kind of input method for stream processing and processing unit based on IP transmission
CN109862442B (en) * 2019-02-22 2022-05-17 伟乐视讯科技股份有限公司 Input stream processing method and processing device based on IP transmission
CN109788316A (en) * 2019-02-27 2019-05-21 腾讯科技(深圳)有限公司 Code rate control, video transcoding method and device, computer equipment and storage medium
CN109788316B (en) * 2019-02-27 2020-08-14 腾讯科技(深圳)有限公司 Code rate control method and device, video transcoding method and device, computer equipment and storage medium
CN110913245A (en) * 2019-11-08 2020-03-24 网宿科技股份有限公司 Method and device for controlling video transcoding code rate
WO2021088263A1 (en) * 2019-11-08 2021-05-14 网宿科技股份有限公司 Method and device for controlling video transcoding code rate
EP3840390A4 (en) * 2019-11-08 2021-06-23 Wangsu Science & Technology Co., Ltd. Method and device for controlling video transcoding code rate
CN111193924A (en) * 2019-12-26 2020-05-22 腾讯科技(深圳)有限公司 Method and device for determining video code rate, computer equipment and storage medium
CN117478958A (en) * 2023-09-19 2024-01-30 广州开得联软件技术有限公司 Video playing method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN107659819B (en) 2019-10-25

Similar Documents

Publication Publication Date Title
CN107659819A (en) A kind of method and apparatus of video code conversion
CN104918133B (en) A kind of playing method and device for regarding video flowing in networking
CN104125429B (en) The adjusting method and device of video data transmission
US20160119398A1 (en) Informative data streaming server
RU2009116472A (en) DYNAMIC MODIFICATION OF VIDEO PROPERTIES
CN104735470A (en) Streaming media data transmission method and device
TW201021576A (en) System and method for dynamic video encoding in multimedia streaming
CN110868600A (en) Target tracking video plug-flow method, display method, device and storage medium
CN103634594A (en) Method and apparatus for obtaining video coding compression quality
CN104394484A (en) Wireless live streaming media transmission method
US8873590B2 (en) Apparatus and method for correcting jitter
CN106713913A (en) Video picture frame sending method and device and video picture frame receiving method and device
CN105262699A (en) Network adaptive coding adjustment method and device
JP7011941B2 (en) Client and receiving method
CN113766317A (en) Video transmission method, video transmission device, electronic equipment and storage medium
EP3777218B1 (en) Congestion response for timely media delivery
CN106817588A (en) Transcoding control method and device, net cast method and system
CN107147916A (en) A kind of method for transmitting H.265 encoded video data on the level of the transport layer
CN104703051B (en) Code stream sending method and device
CN110602522A (en) Multi-path real-time live webRTC stream synthesis method
CN108924631A (en) A kind of video recording generation method shunting storage based on audio-video
JP2004320667A (en) Real-time content editing method, system and program therefor
CN104967871B (en) A kind of statistic multiplexing system and method for Video coding code stream
CN114339445B (en) Real-time video stream self-adaptive coordination system and method
WO2022206016A1 (en) Data layering transport method, apparatus and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant