WO2018192518A1 - Data processing method and device and storage medium - Google Patents

Data processing method and device and storage medium Download PDF

Info

Publication number
WO2018192518A1
WO2018192518A1 PCT/CN2018/083501 CN2018083501W WO2018192518A1 WO 2018192518 A1 WO2018192518 A1 WO 2018192518A1 CN 2018083501 W CN2018083501 W CN 2018083501W WO 2018192518 A1 WO2018192518 A1 WO 2018192518A1
Authority
WO
WIPO (PCT)
Prior art keywords
transcoding
classification information
data
transcoded
preset
Prior art date
Application number
PCT/CN2018/083501
Other languages
French (fr)
Chinese (zh)
Inventor
张宏顺
韩冰杰
林四新
李雅卿
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2018192518A1 publication Critical patent/WO2018192518A1/en

Links

Images

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
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties

Definitions

  • the embodiments of the present invention relate to the field of Internet technologies, and in particular, to a data processing method and apparatus.
  • the embodiments of the present invention provide a data processing method, apparatus, and storage medium, which are used to solve the problem of low coding efficiency of an encoding device.
  • an embodiment of the present invention provides a data processing method, including:
  • an embodiment of the present invention provides a data processing apparatus including one or more processors and one or more memories, the one or more memories including computer readable instructions; The configuration is performed by the one or more processors to:
  • the present application also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the methods described above.
  • FIG. 1 is a schematic flowchart of a data processing method according to an embodiment of the present invention.
  • FIG. 2 is another schematic flowchart of a data processing method according to an embodiment of the present invention.
  • step S202 is a schematic flowchart of an implementation manner of step S202 provided by the present invention.
  • FIG. 4 is a schematic flowchart of a coding configuration according to an embodiment of the present invention.
  • FIG. 5 is still another schematic flowchart of a data processing method according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic flowchart diagram of an implementation manner of step S501 provided by the present invention.
  • FIG. 7 is a schematic flowchart diagram of an implementation manner of step S603 provided by the present invention.
  • FIG. 8 is a functional block diagram of a data processing apparatus according to an embodiment of the present invention.
  • FIG. 9 is a functional block diagram of a first processing unit according to an embodiment of the present invention.
  • FIG. 10 is a functional block diagram of a second configuration unit according to an embodiment of the present disclosure.
  • FIG. 11 is a functional block diagram of a second processing unit according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of a data processing device according to an embodiment of the present invention.
  • first, second, third, etc. may be used to describe the classification information in embodiments of the present invention, such classification information should not be limited to these terms. These terms are only used to distinguish classification information from each other.
  • first classification information may also be referred to as second classification information without departing from the scope of the embodiments of the present invention.
  • second classification information may also be referred to as first classification information.
  • the word “if” as used herein may be interpreted as “when” or “when” or “in response to determining” or “in response to detecting.”
  • the phrase “if determined” or “if detected (conditions or events stated)” may be interpreted as “when determined” or “in response to determination” or “when detected (stated condition or event) “Time” or “in response to a test (condition or event stated)”.
  • each channel encodes the same parameters when transcoding different frame images. Since the video scenes with different complexity use the same coding parameters and the same number of coding channels when encoding, when the complexity of the video scene is high, the transcoding speed of each channel will be slower, resulting in the output of the transcoded content. Case. Correspondingly, when the complexity of the video scene is low, there is a case where the transcoding device processes the waste of resources.
  • the embodiments of the present invention provide corresponding Solution: By configuring the encoding parameters and adjusting the encoding parameters, the corresponding encoding parameters can be configured based on different types of data to be transcoded, and different number of transcoding channels can be configured for different data to be transcoded.
  • the data processing method provided by the present application may be applied to the encoding of the collected media content (for example, captured video) by the terminal device at the collecting end, and may also be applied to the server.
  • the encoding at the same time can also be applied to the encoding of the terminal device at the playing end (for example, when the user interacts with the live broadcast party, the terminal device at the playback end also needs to perform video transcoding).
  • the embodiments of the present invention provide the following embodiments.
  • FIG. 1 it is a schematic flowchart of a data processing method according to an embodiment of the present invention. As shown in the figure, the method includes the following steps:
  • Step S101 Acquire first classification information and second classification information of data to be transcoded.
  • the first classification information in the embodiment of the present invention specifically refers to image classification information of each frame of the data to be transcoded, that is, the type of each frame image, for example, each frame image can be classified into slow motion and general motion. And one of the violent.
  • the second classification information is classification information of the video that is to be transcoded based on the first classification information, that is, the type of the video, for example, the data to be transcoded can be classified into a slow motion video scene, general motion. One of a video scene and a strenuous motion video scene.
  • Step S102 configuring an encoding parameter corresponding to the first classification information.
  • the first classification information is classification information of each frame of the data to be transcoded
  • the corresponding coding parameter is an encoding parameter of each frame image
  • each frame image in the transcoding data is classified according to the first classification of the frame image.
  • the information sets different coding parameters, which improves the coding efficiency of the coding device.
  • Step S103 acquiring the number of transcoding channels corresponding to the second classification information according to the correspondence between the second classification information and the number of transcoding channels, and performing the transcoding according to the encoding parameter and the number of transcoding channels.
  • the data is transcoded.
  • different number of transcoding channels are set for the data to be encoded according to the second classification information of the data to be encoded. For example, when the data to be encoded belongs to a strenuous motion video scene, the number of channels to be set is small, and when the data to be encoded belongs to a general motion video scene, the number of channels is set. Therefore, the output encoding data jam phenomenon caused by the encoding device adopting the same number of paths for different data to be transcoded is avoided, and the resources of the encoding device are reasonably utilized, thereby improving the encoding efficiency.
  • the transcoding device is transcoded according to the encoding parameter and the number of transcoding paths.
  • the code is also called transcoding.
  • the first classification information is classification information corresponding to each frame of the image to be transcoded
  • the encoding parameter is an encoding parameter of the encoder corresponding to each frame of the image when encoding.
  • the number of transcoding channels is the number of encoding channels set in the transcoding device.
  • the encoding parameter is adjusted to refer to, in the process of encoding, not only the transcoding data is to be transcoded according to the encoding parameter, but also the transcoding data is transcoded according to the number of transcoding lines, that is, according to the transcoding parameter And the number of transcoding channels is transcoded.
  • FIG. 2 is another schematic flowchart of a data processing method according to an embodiment of the present invention. As shown in FIG. 2, in an implementation manner, before performing step S101, the following steps may be further included:
  • Step S201 receiving data to be transcoded.
  • the data to be transcoded may include video data, audio data, and text content.
  • the video data may be collected by a camera
  • the audio data is collected by a microphone
  • the text content obtained by inputting a dialog box.
  • Step S202 Determine first classification information and second classification information corresponding to the to-be-transcoded data according to a preset processing policy.
  • the determination parameter (also referred to as a motion parameter) of each frame image is first calculated according to a preset processing strategy, and then the first image of each frame is determined based on the determination condition in the preset processing strategy and the motion parameter.
  • Classification information calculating the proportion of each category in the first classification information according to the preset processing strategy, and calculating the classification parameter of the data to be transcoded, based on another determination condition in the preset processing strategy and The classification parameter determines the second classification information.
  • the data to be transcoded includes one or more frames, and the first classification information corresponding to the data to be transcoded includes the first classification information corresponding to each frame of the one or more frames;
  • FIG. 3 is a schematic flowchart of the implementation manner of step S202 provided by the present invention. As shown in FIG. 3, the method includes:
  • Step S301 After acquiring motion vector information of the data to be transcoded, calculate a motion parameter corresponding to each frame of the data to be transcoded.
  • Step S301 After acquiring motion vector information of the data to be transcoded, calculate a motion parameter corresponding to each frame of the data to be transcoded.
  • the motion estimation algorithm includes: dividing each frame of the image sequence into sub-blocks that do not overlap each other, and setting all the sub-blocks.
  • the displacement of the pixels is the same, and then the block most similar to the current block is found according to a certain matching criterion for each sub-block to reference frame within a given specific search range, that is, the matching block, the matching block and the current block are relative.
  • the displacement is the motion vector.
  • the motion vector includes a relative displacement between the plurality of sub-blocks in the frame image to be transcoded and the respective matching block, and the motion vector is used to represent the sub-block and the reference frame image in the frame image in the data to be transcoded. Match the differences in the blocks.
  • the motion parameter is used to characterize the difference between the frame image and the reference image in the data to be transcoded. Therefore, during the transcoding of the video data, the video data can be classified according to the motion vector of the current input code stream.
  • the present embodiment can record each frame of image by the following three parameters, that is, motion information of the picture (a parameter that represents motion information is called a motion parameter):
  • the variance of the motion vector of the sub-block whose motion vector is greater than zero in each frame of image is represented by mv_var.
  • the embodiment may also select other motion vector-based statistical parameters to represent the motion information of each frame of the image, which is not limited herein.
  • Step S302 Determine, according to the motion parameter, the first classification information corresponding to each frame of the screen based on the preset first processing policy.
  • the present embodiment divides each frame into three types: strenuous motion, slow motion, and general motion.
  • the frame picture is judged to be strenuous motion;
  • the condition 1 may be, for example, move_ratio ⁇ 0.07 and mv_avg ⁇ 15 and mv_var ⁇ 200
  • the condition 2 may be, for example, move_ratio ⁇ 0.3 and mv_avg ⁇ 5 and mv_var ⁇ 30
  • Condition 3 may be, for example, move_ratio ⁇ 0.8 and mv_avg ⁇ 3 and mv_var ⁇ 4.
  • the frame picture is judged to be strenuous motion;
  • the condition 1 may be, for example, move_ratio ⁇ 0.15 and mv_avg ⁇ 4 and mv_var ⁇ 10
  • the condition 2 may be, for example, move_ratio ⁇ 0.05 and mv_avg ⁇ 10 and mv_var ⁇ 60
  • Condition 3 may be, for example, move_ratio ⁇ 0.02.
  • the frame picture is judged to be a general motion.
  • Step S303 calculating, according to the first classification information, a classification parameter of the data to be transcoded based on the first preset condition.
  • the classification parameter of the data to be transcoded is determined according to the first classification information and the first preset condition.
  • the embodiment calculates the proportion of strenuous motion, general motion, and slow motion in the video data to be transcoded, and is represented by r_fast, r_common, and r_static, respectively. Then, the classification parameter of the data to be transcoded is calculated based on the first preset condition, for example, the first preset condition may satisfy the following formula:
  • mv_score represents the classification parameter of the data to be transcoded
  • r_fast represents the proportion of the severe motion classification in the transcoded video data
  • r_common represents the proportion of the general motion classification in the transcoded video data.
  • Step S304 determining, according to the classification parameter, the second classification information of the data to be transcoded based on the preset second processing policy.
  • the second processing policy of this embodiment may meet the following conditions, for example:
  • the data to be transcoded is determined to be a slow motion video scene
  • the data to be transcoded is determined to be a general motion video scene
  • the data to be transcoded is determined to be a strenuous motion video scene.
  • the coding parameter may be corresponding to the first classification information.
  • the medium encoding configuration corresponds to a slowly moving image frame
  • the faster encoding configuration corresponds to a general moving image frame
  • the superfast encoding configuration corresponds to a vigorously moving image frame.
  • the process of encoding mainly includes the following steps:
  • S401 Receive data to be transcoded, and determine a motion vector of the data to be transcoded.
  • S402 The controller determines first classification information and second classification information of the data to be transcoded according to the motion vector.
  • the controller determines, according to the first classification information and the second classification information, a transcoding parameter and a number of transcoding channels of the data to be transcoded (the transcoding parameter is also referred to as an encoding parameter, and the number of transcoding channels is also referred to as an encoding channel number).
  • S404 Perform x264 transcoding on the transcoded data according to the transcoding parameter and the number of transcoding lines to form a transcoded code stream.
  • the number of transcoding channels corresponding to the second classification information may be acquired according to the correspondence between the second classification information and the number of transcoding paths, and the coding parameters are performed. Adjustment.
  • the number of transcoding channels is the number of encoding channels set in the transcoding device, and the encoding parameters are adjusted, and when the transcoding process is performed, the encoding process is performed according to the encoding parameters and the number of encoding channels.
  • the number of transcoding channels corresponding to a slow motion video scene is 14 channels
  • the number of transcoding channels corresponding to a general motion video scene is 10 channels
  • the number of transcoding channels corresponding to a strenuous motion video scene is 7 channels, which can be converted in a coding parameter.
  • the number of code channels is adjusted to the corresponding number of ways.
  • FIG. 5 it is a schematic flowchart of a data processing method according to an embodiment of the present invention. As shown in FIG. 5, in an implementation manner, before performing step S101, the method may further include the following steps:
  • Step S501 configuring a correspondence between the second classification information and the number of transcoding channels.
  • step S103 the number of transcoding channels corresponding to the second classification information needs to be acquired according to the correspondence between the second classification information and the number of transcoding paths, and then the encoding parameters are adjusted, and the second classification information is
  • the correspondence relationship of the number of transcoding paths is generated by the configuration of step S501.
  • an embodiment of the present invention provides an embodiment herein.
  • FIG. 6 is a schematic flowchart of an implementation manner of step S501 according to an embodiment of the present invention. As shown in FIG. 6 , the method includes:
  • Step S601 acquiring first classification information and second classification information of the test data.
  • step S601 the following steps may also be included:
  • first classification information and the second classification information determination manner based on the test data are the same as the first classification information and the second classification information determination manner of the previously described data to be transcoded, and therefore are not described herein. .
  • step b) likewise comprises the following steps:
  • the first classification information and the second classification information determination process regarding the test data first calculate move_ratio, mv_avg, and mv_var of each frame image, and then determine, according to the determination condition, that each frame image belongs to slow motion, general motion, and strenuous exercise. In that category, the first classification information is obtained; then the proportions r_fast, r_common, and r_static of each frame image of the strenuous motion, general motion, and slow motion type in the video data to be transcoded are calculated, and the calculation is performed based on the calculation formula.
  • the classification parameter of the data to be transcoded determines, according to the determination condition, the test data belongs to the category of the slow motion video scene, the general motion video scene, and the strenuous motion video scene, that is, the second classification information is obtained.
  • each step has been described in detail when describing the data to be transcoded. Since the two methods are the same, that is, the same strategy, the same decision condition and the same calculation formula are used to obtain The first classification information and the second classification information of the test data are not described herein.
  • each test data should cover all the second classification information, and each test data should include a slow motion video scene, a general motion video scene, and a strenuous motion video scene.
  • the correspondence between the final second classification information and the number of transcoding channels is complete, and regardless of the classification type of the data to be transcoded, the correspondence between the second classification information and the number of transcoding lines can be retrieved.
  • the corresponding number of transcoding channels is used to complete the adjustment of the coding parameters.
  • Step S602 configuring coding parameters corresponding to the first classification information.
  • the encoding parameter configuration process based on the test data is the same as the previously described configuration process of the data to be transcoded, and the medium encoding configuration is still corresponding to the slowly moving image frame, and the fast encoding configuration corresponds to the image frame of the general motion.
  • the superfast coding configuration corresponds to the image frame of strenuous motion, and will not be described here.
  • Step S603 calculating the maximum number of transcoding paths that satisfy the second preset condition.
  • a calculation calculates a maximum number of transcoding paths corresponding to the second preset condition when the transcoding device performs the transcoding operation.
  • the working performance of the transcoding device can be characterized by using corresponding parameters
  • the second preset condition is a parameter range in which the transcoding device maintains a lower carding rate under the premise of rationally utilizing the processing resource thereof, and of course satisfies this
  • step S603 an embodiment of the present invention provides an embodiment herein.
  • FIG. 6 is a schematic flowchart of the implementation manner of step S603 according to an embodiment of the present invention. As shown in FIG. 7 , the method includes:
  • Step S701 calculating an overload rate and a maximum carding rate under the first preset number of transcoding paths.
  • Step S701 calculating an overload rate and a maximum carding rate under the first preset number of transcoding paths.
  • test data When determining the maximum number of transcoding paths corresponding to the test data, different types of test data are separately acquired. For one type of test data, a plurality of ways are preset, for example, 5 channels, 6 channels, and 7 channels, and the test data of the type is input into a preset number of channels for transcoding, and the number of each channel is determined.
  • the overload rate and the maximum card rate of the transcoding device are set to the maximum number of ways that the overload rate and the maximum card rate meet the preset conditions as the maximum number of channels corresponding to the test data.
  • the present embodiment defines an overload rate and a carding rate.
  • the overload rate may be a ratio of the number of acquisition times of the processing device CPU load rate greater than 80% to the specified collection times in the specified collection times collected according to the specified collection period. Setting the number of transcoding channels in the transcoding device for a first preset number of transcoding channels, and inputting the same number of test data (for example, a strenuous motion video scene) into the transcoding device respectively. Each channel performs transcoding processing, and periodically collects the load rate of the transcoding device.
  • the card rate is the ratio of the real-time frame rate of each transcoding channel to the reference frame rate, where the reference frame rate can be the value after the input frame rate is decremented by one.
  • the first preset number of transcoding channels refers to the total number of transcoding channels in the testing process, and the maximum carding rate is the maximum value of each cardton rate value corresponding to the number of transcoding channels per channel. For example, if the number of the first preset transcoding channels includes the number of 7 transcoding channels, it is necessary to calculate the respective cardon rates of the 7 transcoding channels, and then select the maximum value as the maximum card among the 7 card rates. Rate.
  • Step S702 obtaining the second preset number of transcoding channels corresponding to the preset overload rate and the preset maximum card rate respectively.
  • Step S702 performing one or more second preset transcoding paths corresponding to determining that the overload rate and the maximum card rate are less than a preset overload rate and a preset maximum card rate, respectively.
  • the corresponding overload rate and the maximum card rate are calculated, and when 5 to 7 are satisfied, the overload is satisfied.
  • the rate and the maximum carding rate are respectively less than the preset overload rate and the preset maximum card rate, and the 5th to 7th channels are represented by the second preset number of transcoding channels.
  • the preset overload rate of the implementation is 10%, and the preset maximum card rate is 1%.
  • other reasonable value ranges may be selected, and the embodiment of the present invention does not do this. limited.
  • the maximum number of transcoding paths can be determined by the following expression:
  • fps is the actual encoding frame rate
  • fps th is the target encoding frame rate
  • Frame(fps ⁇ fps th )/Frame indicates that the encoding frame rate is smaller than the target encoding frame rate and the ratio of the total number of frames
  • the CPU is the transcoding device.
  • the load consumption, CPU th is the load consumption threshold
  • T (CPU>CPU th )/T total is the ratio of the number of times the actual load of the transcoding device exceeds the load consumption threshold to the total number of acquisitions.
  • Step S703 using the maximum value of each of the second preset transcoding channels as the maximum number of transcoding channels.
  • the maximum value of the one or more second preset transcoding paths is performed as the maximum number of transcoding paths.
  • the number of the second preset transcoding channels is 5 to 7 channels, wherein the maximum value is 7 channels, so the maximum number of transcoding channels is 7 channels.
  • the embodiment of the present invention provides an implementation manner, including the following steps, in the step S701, in which the overload rate under the number of the first preset transcoding channels is calculated:
  • the load rate of the transcoding device of the first acquisition number is collected based on the preset period.
  • the load rate is one of the working performance parameters of the CPU of the transcoding device, and can be directly collected from the CPU.
  • the preset period and the first number of times can be set according to the actual application scenario. For example, every second is collected, and a total of 100 is collected. Times.
  • the first number of acquisitions is 100, and the load rate of 10 times is greater than the preset load rate threshold, and the second number of acquisitions is 10 times.
  • the first number of acquisitions is 100
  • the second number of acquisitions is 10
  • the first ratio between the second collection number and the first collection number is 10%
  • the current first preset transcoding path The overload rate under the number is 10%.
  • an embodiment of the present invention provides an embodiment, including the following steps:
  • the real-time frame rate is one of the parameters of the transcoding process, and can be directly collected from the transcoding device, and the reference frame rate is a value obtained by subtracting 1 from the input frame rate.
  • the following describes the correspondence between the configuration of the second classification information and the number of transcoding channels in a specific application scenario.
  • the classification parameters of each test video data information are calculated, and the second classification information of each test data is determined, as shown in Table 1.
  • the following takes a strenuous motion video scene as an example, and inputs a strenuous motion video scene (which may include any one of video 7-10, any two, any three, or any four) into a transcoding device to perform transcoding processing to determine the corresponding The number of transcoded roads. Taking the number of 5 channels of transcoding as the starting point, and increasing the number of transcoding channels in turn, respectively calculate the card rate and CPU overload rate under the number of 5-10 transcoding channels, as shown in Table 2.
  • the maximum value of the number of transcoding channels that satisfy the cardon rate less than 1% and the CPU overload rate is less than 10% is 7
  • the number of transcoded roads corresponding to the road, that is, the strenuous motion video scene is 7.
  • the same evaluation method is adopted.
  • the maximum value of each transcoding channel that satisfies the cardon rate less than 1% and the CPU overload rate is less than 10% is 10
  • the number of transcoding paths corresponding to the general motion video scene is 10; when processing the slow motion video scene, the maximum of the number of transcoding channels that satisfy the cardon rate less than 1% and the CPU overload rate is less than 10% is 14 channels, that is, the number of transcoding channels corresponding to the slow motion video scene is 14 channels.
  • the processing device may have a situation that when the number of transcoding channels is n, the processing resources are wasted, and when the number of transcoding channels is n+1, the carding rate occurs. Higher situation.
  • the processing device performs transcoding with a resolution of 1080P based on a strenuous motion video scene, and the number of transcoding channels is up to 7 channels. At this time, some processing resources of the processing device are not utilized, and the number of transcoding channels is increased to 8 channels.
  • the card has a high rate
  • the number of transcoding channels with a low resolution of 720P can be increased under the premise that the number of transcoded channels with the resolution of 1080P is unchanged. Therefore, the card ratio can be reduced to some extent under the premise of making full use of the processing resources.
  • Step S604 storing a correspondence between the second classification information and the maximum number of transcoding channels.
  • step S604 the correspondence between the established second classification information and the maximum number of transcoding channels is stored to the corresponding location, and when the encoding parameter adjustment needs to be performed, the corresponding number of transcoding channels is retrieved.
  • the process of configuring the coding parameter and the adjustment of the coding parameter is performed, and after acquiring different types of classification information of the data to be transcoded, the coding parameter corresponding to the first classification information is configured, and then the second and second The number of transcoding channels corresponding to the classification information is adjusted to adjust the previous coding parameters.
  • the corresponding coding parameters can be configured when processing different types of data to be transcoded, and the number of transcoding channels can be further adjusted. The waste of processing resources of the transcoding device is avoided, the carding rate in the transcoding process is reduced, and the transcoding efficiency is improved to some extent.
  • terminals involved in the embodiments of the present invention may include, but are not limited to, a personal computer (PC), a personal digital assistant (PDA), a wireless handheld device, a tablet computer, and a tablet computer.
  • PC personal computer
  • PDA personal digital assistant
  • Mobile phones MP3 players, MP4 players, etc.
  • execution body of S101 to S103 may be a data processing device, and the device may be located in an application of a local terminal, or may be a plug-in or a software development kit (SDK) located in an application of the local terminal.
  • SDK software development kit
  • the functional unit is not particularly limited in this embodiment of the present invention.
  • the application may be an application (nativeApp) installed on the terminal, or may be a web application (webApp) of the browser on the terminal, which is not limited by the embodiment of the present invention.
  • Embodiments of the present invention further provide an apparatus embodiment for implementing the steps and methods in the foregoing method embodiments.
  • FIG. 8 is a functional block diagram of a data processing apparatus according to an embodiment of the present invention. As shown in Figure 8, the device includes:
  • the obtaining unit 810 is configured to obtain first classification information and second classification information of the data to be transcoded determined by the first processing unit 800;
  • the first configuration unit 820 is configured to configure an encoding parameter corresponding to the first classification information acquired by the obtaining unit 810;
  • the adjusting unit 830 is configured to obtain the number of transcoding channels corresponding to the second classification information acquired by the obtaining unit 810 according to the correspondence between the second classification information and the number of transcoding paths, and the encoding parameter configured by the first configuration unit 820 Make adjustments.
  • the foregoing aspect and any possible implementation manner further provide an implementation manner, where the apparatus further includes:
  • the first processing unit 800 is configured to receive data to be transcoded
  • FIG. 9 is a functional block diagram of a first processing unit 800 according to an embodiment of the present invention.
  • the first processing unit 800 specifically includes the following aspects and any possible implementation manners:
  • a first calculation module 801 configured to calculate motion parameters corresponding to each frame of the data to be transcoded after acquiring motion vector information of the data to be transcoded;
  • the first determining module 802 is configured to determine, according to the motion parameter calculated by the first calculating module 801, the first category information corresponding to each frame of the screen according to the preset first processing policy;
  • the second calculation module 803 is configured to calculate, according to the first classification information determined by the first determining module 802, a classification parameter of the data to be transcoded based on the first preset condition;
  • the second determining module 804 is configured to determine, according to the classification parameter calculated by the second calculating module 803, the second classification information of the data to be transcoded based on the preset second processing policy.
  • the foregoing aspect and any possible implementation manner further provide an implementation manner, where the apparatus further includes:
  • the second configuration unit 840 is configured to configure a correspondence between the second classification information and the number of transcoding channels. Therefore, the adjusting unit 830 can adjust the correspondence between the second classification information and the number of transcoding channels to perform transcoding parameter adjustment.
  • FIG. 10 is a functional block diagram of a second configuration unit according to an embodiment of the present invention.
  • the second configuration unit 840 specifically includes:
  • the obtaining module 841 is configured to obtain first classification information and second classification information of the test data determined by the second processing unit 850;
  • the configuration module 842 is configured to configure an encoding parameter corresponding to the first classification information acquired by the obtaining module 841;
  • the processing module 843 is configured to calculate a maximum number of transcoding paths that meet the second preset condition
  • the storage module 844 is configured to store a correspondence between the second classification information acquired by the obtaining module 841 and the maximum number of transcoding paths calculated by the processing module 843.
  • the foregoing aspect and any possible implementation manner further provide an implementation manner, where the apparatus further includes:
  • a second processing unit 850 configured to receive test data
  • FIG. 11 is a functional block diagram of a second processing unit according to an embodiment of the present invention.
  • the second processing unit 850 specifically includes:
  • a third calculation module 851 configured to calculate, after acquiring the motion vector information of the test data, a motion parameter corresponding to each frame of the test data;
  • the third determining module 852 is configured to determine, according to the motion parameter calculated by the third calculating module 851, the first category information corresponding to each frame of the screen according to the preset first processing policy;
  • the fourth calculation module 853 is configured to calculate, according to the first classification information determined by the third determining module 852, a classification parameter of the test data according to a preset formula;
  • the fourth determining module 854 is configured to determine, according to the classification parameter calculated by the fourth calculating module 853, the second classification information of the test data based on the preset second policy.
  • processing module 853 specifically includes:
  • the calculating submodule 8531 is configured to calculate an overload rate and a maximum card rate under each first preset number of transcoding paths;
  • the obtaining sub-module 8532 is configured to obtain, from the calculating sub-module 8531, the corresponding second preset transcoding channels that are different from the preset overload rate and the preset maximum card rate respectively.
  • the submodule 8533 is selected to obtain the maximum value of each of the second preset transcoding channels in the submodule 8532 as the maximum number of transcoding channels.
  • calculation submodule 8531 is specifically configured to:
  • calculation submodule 8531 is specifically configured to:
  • the present application also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of any of the methods described above.
  • FIG. 12 is a schematic structural diagram of a data processing device according to an embodiment of the present invention.
  • the data processing device includes at least an input port 1210, a processor 1220, a memory 1230, and an output port 1240.
  • the memory 1230 stores computer readable instructions
  • the processor 1220 executes computer scale instructions in the memory 1230 for performing the methods illustrated in Figures 1, 2, 3, 4, 5, 6, and 7 above. And the operations performed by the devices shown in Figures 8-11.
  • the data processing device receives the data to be transcoded through the input port 1210, and the processor 1220 determines the first classification information and the second classification information corresponding to the data to be transcoded according to the preset processing policy.
  • the data processing device obtains the data through the processor 1220.
  • the coding parameters corresponding to the first classification information are configured, and the corresponding information is obtained from the memory 1230 according to the correspondence between the second classification information and the number of transcoding channels.
  • the number of transcoding channels corresponding to the second classification information is adjusted, and the encoding parameters are adjusted.
  • the data processing device outputs the transcoded data through the output port 1240.
  • the corresponding relationship between the second classification information and the number of transcoding channels is obtained after the data processing device tests through the plurality of sets of test data, and the testing process is similar to the processing process of the data to be transcoded, and therefore is not described herein.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined. Or it can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the above software functional unit is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods of the various embodiments of the present invention. Part of the steps.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

Provided in embodiments of the present invention are a data processing method and device and storage medium. The method comprises: acquiring first category information and second category information of data to be transcoded; configuring an encoding parameter corresponding to the first category information; acquiring a transcoding path number corresponding to the second category information according to the corresponding relationship between the second category information and the transcoding path number; and performing transcoding processing on the data to be transcoded according to the encoding parameter and the transcoding path number. Also provided in the present application are a corresponding device and storage medium.

Description

数据处理方法、装置及存储介质Data processing method, device and storage medium
本申请要求于2017年4月19日提交中国专利局、申请号为201710258739.6、申请名称为“一种数据处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 200910258739.6, filed on Apr. 19, 2017, the entire contents of which is hereby incorporated by reference. .
技术领域Technical field
本发明实施例涉及互联网技术领域,尤其涉及一种数据处理方法及装置。The embodiments of the present invention relate to the field of Internet technologies, and in particular, to a data processing method and apparatus.
背景技术Background technique
随着互联网的普及,多媒体、智能设备及互联网应用等技术也得到了快速发展。目前,无论是体育比赛,音乐演出,还是个人直播,直播业务受到了越来越多用户的喜爱,为了保证较好的直播体验,需要保证直播过程中转码内容的稳定输出,这对于实时转码提出了较高的要求。With the popularity of the Internet, technologies such as multimedia, smart devices and Internet applications have also developed rapidly. At present, whether it is a sports competition, a music performance, or a personal live broadcast, the live broadcast service has been favored by more and more users. In order to ensure a better live broadcast experience, it is necessary to ensure the stable output of the transcoded content during the live broadcast, which is for real-time transcoding. A higher requirement was put forward.
技术内容Technical content
有鉴于此,本发明实施例提供了数据处理方法、装置及存储介质,用以解决编码设备编码效率低的问题。In view of this, the embodiments of the present invention provide a data processing method, apparatus, and storage medium, which are used to solve the problem of low coding efficiency of an encoding device.
一方面,本发明实施例提供了一种数据处理方法,包括:In one aspect, an embodiment of the present invention provides a data processing method, including:
获取待转码数据的第一分类信息和第二分类信息;Obtaining first classification information and second classification information of the data to be transcoded;
配置与所述第一分类信息对应的编码参数;And configuring an encoding parameter corresponding to the first classification information;
根据第二分类信息与转码路数的对应关系,获取与所述第二分类信息对应的转码路数,根据所述编码参数及所述转码路数对所述待转 码数据进行转码处理。Obtaining, according to the correspondence between the second classification information and the number of transcoding channels, the number of transcoding channels corresponding to the second classification information, and transposing the to-be-transcoded data according to the encoding parameter and the number of transcoding channels Code processing.
另一方面,本发明实施例提供了一种数据处理装置,包括一个或一个以上处理器和一个或一个以上存储器,所述一个或一个以上存储器包括计算机可读指令;所述计算机可读指令经配置由所述一个或多个处理器执行以下操作:In another aspect, an embodiment of the present invention provides a data processing apparatus including one or more processors and one or more memories, the one or more memories including computer readable instructions; The configuration is performed by the one or more processors to:
获取待转码数据的第一分类信息和第二分类信息;Obtaining first classification information and second classification information of the data to be transcoded;
配置与所述第一分类信息对应的编码参数;And configuring an encoding parameter corresponding to the first classification information;
根据第二分类信息与转码路数的对应关系,获取与所述第二分类信息对应的转码路数;Obtaining, according to the correspondence between the second classification information and the number of transcoding paths, the number of transcoding channels corresponding to the second classification information;
根据所述编码参数及所述转码路数对所述待转码数据进行转码处理。Transcoding the data to be transcoded according to the encoding parameter and the number of transcoding channels.
本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述所述的方法中的步骤。The present application also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the methods described above.
附图说明DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. One of ordinary skill in the art can also obtain other drawings based on these drawings without paying for inventive labor.
图1是本发明实施例所提供的一种数据处理方法的流程示意图;1 is a schematic flowchart of a data processing method according to an embodiment of the present invention;
图2是本发明实施例所提供的数据处理方法的另一种流程示意图;2 is another schematic flowchart of a data processing method according to an embodiment of the present invention;
图3是本发明所提供的步骤S202的实现方式的流程示意图;3 is a schematic flowchart of an implementation manner of step S202 provided by the present invention;
图4为本发明实施例所提供的编码配置的流程示意图;4 is a schematic flowchart of a coding configuration according to an embodiment of the present invention;
图5为本发明实施例所提供的数据处理方法的又一种流程示意 图;FIG. 5 is still another schematic flowchart of a data processing method according to an embodiment of the present disclosure;
图6为本发明所提供的步骤S501的实现方式的流程示意图;FIG. 6 is a schematic flowchart diagram of an implementation manner of step S501 provided by the present invention;
图7为本发明所提供的步骤S603的实现方式的流程示意图;FIG. 7 is a schematic flowchart diagram of an implementation manner of step S603 provided by the present invention;
图8为本发明实施例所提供的数据处理装置的功能方块图;FIG. 8 is a functional block diagram of a data processing apparatus according to an embodiment of the present invention;
图9为本发明实施例所提供的第一处理单元的功能方块图;FIG. 9 is a functional block diagram of a first processing unit according to an embodiment of the present invention;
图10为本发明实施例所提供的第二配置单元的功能方块图;FIG. 10 is a functional block diagram of a second configuration unit according to an embodiment of the present disclosure;
图11为本发明实施例所提供的第二处理单元的功能方块图;FIG. 11 is a functional block diagram of a second processing unit according to an embodiment of the present invention;
图12为本发明实施例所提供的数据处理设备的结构示意图。FIG. 12 is a schematic structural diagram of a data processing device according to an embodiment of the present invention.
具体实施方式detailed description
为了更好的理解本发明实施例的技术方案,下面结合附图对本发明实施例进行详细描述。For a better understanding of the technical solutions of the embodiments of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
应当明确,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本发明实施例保护的范围。It should be understood that the described embodiments are only a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without departing from the inventive scope are the scope of the embodiments of the present invention.
在本发明实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明实施例。在本发明实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。The terms used in the embodiments of the present invention are for the purpose of describing particular embodiments only, and are not intended to limit the embodiments of the present invention. The singular forms "a", "the" and "the"
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" as used herein is merely an association describing the associated object, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists separately, while A and B, there are three cases of B alone. In addition, the character "/" in this article generally indicates that the contextual object is an "or" relationship.
应当理解,尽管在本发明实施例中可能采用术语第一、第二、第 三等来描述分类信息,但这些分类信息不应限于这些术语。这些术语仅用来将分类信息彼此区分开。例如,在不脱离本发明实施例范围的情况下,第一分类信息也可以被称为第二分类信息,类似地,第二分类信息也可以被称为第一分类信息。It should be understood that although the terms first, second, third, etc. may be used to describe the classification information in embodiments of the present invention, such classification information should not be limited to these terms. These terms are only used to distinguish classification information from each other. For example, the first classification information may also be referred to as second classification information without departing from the scope of the embodiments of the present invention. Similarly, the second classification information may also be referred to as first classification information.
取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to determining" or "in response to detecting." Similarly, depending on the context, the phrase "if determined" or "if detected (conditions or events stated)" may be interpreted as "when determined" or "in response to determination" or "when detected (stated condition or event) "Time" or "in response to a test (condition or event stated)".
在一些实例中,针对实时转码,不同的视频场景采用相同的转码参数,将转码任务随机分配至各台转码设备进行转码处理,每台转码设备的转码路数均设置为某一固定值,每一路在对不同的帧图像进行转码时编码参数相同。由于不同复杂度的视频场景在编码时采用相同的编码参数及相同的编码路数,当视频场景复杂度较高时,每一路的转码速度将会变慢,从而造成转码内容输出卡顿的情况。相应地,当视频场景复杂度较低时,存在转码设备处理资源浪费的情况。In some examples, for real-time transcoding, different video scenarios adopt the same transcoding parameters, and the transcoding tasks are randomly assigned to each transcoding device for transcoding processing, and the number of transcoding channels of each transcoding device is set. For a fixed value, each channel encodes the same parameters when transcoding different frame images. Since the video scenes with different complexity use the same coding parameters and the same number of coding channels when encoding, when the complexity of the video scene is high, the transcoding speed of each channel will be slower, resulting in the output of the transcoded content. Case. Correspondingly, when the complexity of the video scene is low, there is a case where the transcoding device processes the waste of resources.
为了解决上述实例中存在的,由于针对不同类型的待处理数据配置同样的编码参数带来的转码设备处理资源的浪费,或者转码过程中卡顿的问题,本发明实施例提供了相应的解决方案:通过配置编码参数与调整编码参数两个过程,能够基于不同类型的待转码数据配置相应的编码参数,同时还可对不同的待转码数据配置不同的转码路数。In order to solve the problem that the transcoding device processing resources caused by configuring the same encoding parameters for different types of data to be processed, or the problem of jamming during the transcoding process, the embodiments of the present invention provide corresponding Solution: By configuring the encoding parameters and adjusting the encoding parameters, the corresponding encoding parameters can be configured based on different types of data to be transcoded, and different number of transcoding channels can be configured for different data to be transcoded.
当本申请提供的数据处理方法应用在直播场景中时,本申请提供的数据处理方法可以应用于采集端处终端设备对采集的媒体内容(例如,拍摄的视频)的编码,还可以应用于服务器处的编码,同时还可应用在播放端处的终端设备的编码(例如,当用户与直播方存在互动 的情况下,播放端处的终端设备也需要进行视频转码)。When the data processing method provided by the present application is applied in a live broadcast scenario, the data processing method provided by the application may be applied to the encoding of the collected media content (for example, captured video) by the terminal device at the collecting end, and may also be applied to the server. The encoding at the same time can also be applied to the encoding of the terminal device at the playing end (for example, when the user interacts with the live broadcast party, the terminal device at the playback end also needs to perform video transcoding).
在该思路的引导下,本发明实施例提供了以下实施方案。Under the guidance of the idea, the embodiments of the present invention provide the following embodiments.
本发明实施例给出一种数据处理方法,请参考图1,其为本发明实施例所提供的一种数据处理方法的流程示意图,如图所示,该方法包括以下步骤:An embodiment of the present invention provides a data processing method. Referring to FIG. 1 , it is a schematic flowchart of a data processing method according to an embodiment of the present invention. As shown in the figure, the method includes the following steps:
步骤S101,获取待转码数据的第一分类信息和第二分类信息。Step S101: Acquire first classification information and second classification information of data to be transcoded.
需要说明的是,本发明实施例第一分类信息具体指的是待转码数据的每帧图像分类信息,即每帧图像所属的类型,例如,可以将每帧图像分类为缓慢运动、一般运动和剧烈中的一种。第二分类信息是在第一分类信息的基础上得出待转码数据的这个视频的分类信息,即该视频所属的类型,例如,可以将待转码数据分类为缓慢运动视频场景、一般运动视频场景和剧烈运动视频场景中的一种。It should be noted that, the first classification information in the embodiment of the present invention specifically refers to image classification information of each frame of the data to be transcoded, that is, the type of each frame image, for example, each frame image can be classified into slow motion and general motion. And one of the violent. The second classification information is classification information of the video that is to be transcoded based on the first classification information, that is, the type of the video, for example, the data to be transcoded can be classified into a slow motion video scene, general motion. One of a video scene and a strenuous motion video scene.
步骤S102,配置与所述第一分类信息对应的编码参数。Step S102, configuring an encoding parameter corresponding to the first classification information.
如上所述,第一分类信息为待转码数据中每帧图像的分类信息,对应的编码参数为每帧图像的编码参数,对待转码数据中的各帧图像,根据帧图像的第一分类信息设置不同的编码参数,提高了编码设备的编码效率。As described above, the first classification information is classification information of each frame of the data to be transcoded, the corresponding coding parameter is an encoding parameter of each frame image, and each frame image in the transcoding data is classified according to the first classification of the frame image. The information sets different coding parameters, which improves the coding efficiency of the coding device.
步骤S103,根据第二分类信息与转码路数的对应关系,获取与所述第二分类信息对应的转码路数,根据所述编码参数及所述转码路数对所述待转码数据进行转码处理。Step S103, acquiring the number of transcoding channels corresponding to the second classification information according to the correspondence between the second classification information and the number of transcoding channels, and performing the transcoding according to the encoding parameter and the number of transcoding channels. The data is transcoded.
在对不同的待编码数据进行编码时,根据待编码数据的第二分类信息为待编码数据设置不同的转码路数。例如,当待编码数据属于剧烈运动视频场景时,设置的路数较少,当待编码数据属于一般运动视频场景时,设置的路数较多。从而避免了编码设备在对不同的待转码数据采用同样的路数时导致的输出编码数据卡顿现象,同时合理利用 了编码设备的资源,提高了编码效率。When encoding different data to be encoded, different number of transcoding channels are set for the data to be encoded according to the second classification information of the data to be encoded. For example, when the data to be encoded belongs to a strenuous motion video scene, the number of channels to be set is small, and when the data to be encoded belongs to a general motion video scene, the number of channels is set. Therefore, the output encoding data jam phenomenon caused by the encoding device adopting the same number of paths for different data to be transcoded is avoided, and the resources of the encoding device are reasonably utilized, thereby improving the encoding efficiency.
在获取了所述编码参数及所述转码路数后,在对待转码数据进行转码处理时,根据所述编码参数及所述转码路数对待转码设备进行转码处理。其中,编码也称为转码。其中,第一分类信息为待转码数据中的每帧图像对应的分类信息,所述编码参数为每帧图像在编码时对应的编码器的编码参数。所述转码路数为转码设备中设置的编码路数。所述将编码参数进行调整指,在编码的过程中,不仅要根据编码参数对待转码数据进行转码处理,还要根据转码路数对待转码数据进行转码处理,即根据转码参数及转码路数进行转码处理。请参考图2,其为本发明实施例所提供的数据处理方法的另一种流程示意图,如图2所示,在一种实现方式中,在执行步骤S101之前,还可以包括如下步骤:After the encoding parameter and the number of transcoding channels are obtained, when the transcoding data is transcoded, the transcoding device is transcoded according to the encoding parameter and the number of transcoding paths. Among them, the code is also called transcoding. The first classification information is classification information corresponding to each frame of the image to be transcoded, and the encoding parameter is an encoding parameter of the encoder corresponding to each frame of the image when encoding. The number of transcoding channels is the number of encoding channels set in the transcoding device. The encoding parameter is adjusted to refer to, in the process of encoding, not only the transcoding data is to be transcoded according to the encoding parameter, but also the transcoding data is transcoded according to the number of transcoding lines, that is, according to the transcoding parameter And the number of transcoding channels is transcoded. Please refer to FIG. 2, which is another schematic flowchart of a data processing method according to an embodiment of the present invention. As shown in FIG. 2, in an implementation manner, before performing step S101, the following steps may be further included:
步骤S201,接收待转码数据。Step S201, receiving data to be transcoded.
所述待转码数据可以包括视频数据、音频数据和文本内容。本发明实施例中,可以通过摄像头采集所述视频数据,通过麦克风采集所述音频数据,通过输入对话框获取的所述文本内容。The data to be transcoded may include video data, audio data, and text content. In the embodiment of the present invention, the video data may be collected by a camera, and the audio data is collected by a microphone, and the text content obtained by inputting a dialog box.
步骤S202,根据预设处理策略确定所述待转码数据对应的第一分类信息和第二分类信息。Step S202: Determine first classification information and second classification information corresponding to the to-be-transcoded data according to a preset processing policy.
需要说明的是,先根据预设处理策略计算出每帧图像的判定参数(也称为运动参数),然后基于预设处理策略中的判定条件以及所述运动参数确定出每帧图像的第一分类信息;再根据预设处理策略计算出各帧画像中,第一分类信息中各分类的占比,并计算出待转码数据的分类参数,基于预设处理策略中的另一判定条件及所述分类参数确定出第二分类信息。It should be noted that the determination parameter (also referred to as a motion parameter) of each frame image is first calculated according to a preset processing strategy, and then the first image of each frame is determined based on the determination condition in the preset processing strategy and the motion parameter. Classification information; calculating the proportion of each category in the first classification information according to the preset processing strategy, and calculating the classification parameter of the data to be transcoded, based on another determination condition in the preset processing strategy and The classification parameter determines the second classification information.
针对步骤S202的实现,本发明实施例在此提供了一种实施方式。 其中,所述待转码数据包括一帧或多帧画面,所述待转码数据对应的第一分类信息包括所述一帧或多帧画面中每帧画面对应的第一分类信息;请参考图3,其为本发明所提供的步骤S202的实现方式的流程示意图,如图3所示,包括:For the implementation of step S202, an embodiment of the present invention provides an embodiment herein. The data to be transcoded includes one or more frames, and the first classification information corresponding to the data to be transcoded includes the first classification information corresponding to each frame of the one or more frames; FIG. 3 is a schematic flowchart of the implementation manner of step S202 provided by the present invention. As shown in FIG. 3, the method includes:
步骤S301,获取所述待转码数据的运动矢量信息后,计算所述待转码数据中每帧画面对应的运动参数。在执行该步骤时,执行确定所述待转码数据的运动矢量信息,根据所述运动矢量信息确定所述待转码数据中每帧画面对应的运动参数。Step S301: After acquiring motion vector information of the data to be transcoded, calculate a motion parameter corresponding to each frame of the data to be transcoded. When performing the step, performing motion vector information for determining the data to be transcoded, and determining a motion parameter corresponding to each frame of the data to be transcoded according to the motion vector information.
需要说明的是,视频数据编码过程的复杂度主要集中在帧间预测的运动估计部分,运动估计算法包括:将图像序列的每一帧分成互不重叠的子块,并设定子块内所有象素的位移量都相同,然后对每个子块到参考帧某一给定特定搜索范围内根据一定的匹配准则找出与当前块最相似的块,即匹配块,匹配块与当前块的相对位移即为运动矢量。运动矢量包括待转码数据中的帧图像中的多个子块与各自的匹配块之间的相对位移,运动矢量用以表征待转码数据中的帧图像中的子块与参考帧图像中的匹配块的差别。运动参数用以表征待转码数据中的帧图像与参考图像的差别。因此,在视频数据的转码过程中,可以根据当前输入码流的运动矢量对视频数据进行分类。It should be noted that the complexity of the video data encoding process mainly focuses on the motion estimation part of the interframe prediction. The motion estimation algorithm includes: dividing each frame of the image sequence into sub-blocks that do not overlap each other, and setting all the sub-blocks. The displacement of the pixels is the same, and then the block most similar to the current block is found according to a certain matching criterion for each sub-block to reference frame within a given specific search range, that is, the matching block, the matching block and the current block are relative. The displacement is the motion vector. The motion vector includes a relative displacement between the plurality of sub-blocks in the frame image to be transcoded and the respective matching block, and the motion vector is used to represent the sub-block and the reference frame image in the frame image in the data to be transcoded. Match the differences in the blocks. The motion parameter is used to characterize the difference between the frame image and the reference image in the data to be transcoded. Therefore, during the transcoding of the video data, the video data can be classified according to the motion vector of the current input code stream.
在本申请一方案中,本实施例可通过以下三个参数来记录每帧图像,即画面的运动信息(表征运动信息的参数称为运动参数):In an aspect of the present application, the present embodiment can record each frame of image by the following three parameters, that is, motion information of the picture (a parameter that represents motion information is called a motion parameter):
1、每帧图像中运动矢量大于零的子块所占比例,用move_ratio进行表示;1. The proportion of sub-blocks whose motion vector is greater than zero in each frame of image is represented by move_ratio;
2、每帧图像中运动矢量大于零的子块的运动矢量平均值,用mv_avg进行表示;2. The average value of the motion vector of the sub-block whose motion vector is greater than zero in each frame image is represented by mv_avg;
3、每帧图像中运动矢量大于零的子块的运动矢量的方差,用 mv_var进行表示。3. The variance of the motion vector of the sub-block whose motion vector is greater than zero in each frame of image is represented by mv_var.
当然,本实施例还可以选择其他基于运动矢量的统计参数,来对每帧图像的运动信息进行表征,本发明实施例在此不做限定。Of course, the embodiment may also select other motion vector-based statistical parameters to represent the motion information of each frame of the image, which is not limited herein.
步骤S302,根据所述运动参数,并基于预设第一处理策略确定每帧画面对应的第一分类信息。Step S302: Determine, according to the motion parameter, the first classification information corresponding to each frame of the screen based on the preset first processing policy.
在本申请一方案中,本实施例将每帧画面分为剧烈运动、缓慢运动和一般运动三种类型。In one aspect of the present application, the present embodiment divides each frame into three types: strenuous motion, slow motion, and general motion.
1、剧烈运动1, strenuous exercise
当满足条件1、条件2和条件3中任意一个时,该帧画面被判断为剧烈运动;其中,条件1例如可以为move_ratio≥0.07且mv_avg≥15且mv_var≥200,条件2例如可以为move_ratio≥0.3且mv_avg≥5且mv_var≥30,条件3例如可以为move_ratio≥0.8且mv_avg≥3且mv_var≥4。When any one of the condition 1, the condition 2, and the condition 3 is satisfied, the frame picture is judged to be strenuous motion; wherein the condition 1 may be, for example, move_ratio≥0.07 and mv_avg≥15 and mv_var≥200, and the condition 2 may be, for example, move_ratio≥ 0.3 and mv_avg≥5 and mv_var≥30, Condition 3 may be, for example, move_ratio≥0.8 and mv_avg≥3 and mv_var≥4.
2、缓慢运动2, slow movement
当满足条件1、条件2和条件3中任意一个时,该帧画面被判断为剧烈运动;其中,条件1例如可以为move_ratio≤0.15且mv_avg≤4且mv_var≤10,条件2例如可以为move_ratio≤0.05且mv_avg≤10且mv_var≤60,条件3例如可以为move_ratio≤0.02。When any one of the condition 1, the condition 2, and the condition 3 is satisfied, the frame picture is judged to be strenuous motion; wherein the condition 1 may be, for example, move_ratio ≤ 0.15 and mv_avg ≤ 4 and mv_var ≤ 10, and the condition 2 may be, for example, move_ratio ≤ 0.05 and mv_avg ≤ 10 and mv_var ≤ 60, and Condition 3 may be, for example, move_ratio ≤ 0.02.
3、一般运动3. General sports
当步骤S301计算出的三个参数,既不满足剧烈运动三个条件中的任意一个,也不满足缓慢运动三个条件中的任意一个时,该帧画面被判断为一般运动。When the three parameters calculated in step S301 neither satisfy any of the three conditions of strenuous motion nor satisfy any of the three conditions of slow motion, the frame picture is judged to be a general motion.
可以理解的是,除了上述实施例给出的判定条件,只要能够将每帧画面进行复杂度分类,还可以采取其他判定方式,比如,可以更加细化各帧画面的分类信息,增加更多的判定条件,或者调整判定条件 的数值范围等,本发明实施例对此不做限定。It can be understood that, besides the determination conditions given in the above embodiments, as long as the complexity classification can be performed on each frame of the screen, other determination manners can be adopted. For example, the classification information of each frame picture can be further refined, and more The determination of the condition, or the adjustment of the numerical range of the determination condition, etc., is not limited in this embodiment of the present invention.
步骤S303,根据所述第一分类信息,并基于第一预设条件计算所述待转码数据的分类参数。在执行该步骤时,执行根据所述第一分类信息,及第一预设条件确定所述待转码数据的分类参数。Step S303, calculating, according to the first classification information, a classification parameter of the data to be transcoded based on the first preset condition. When the step is performed, the classification parameter of the data to be transcoded is determined according to the first classification information and the first preset condition.
在一种实现方案中,本实施例计算出待转码视频数据中剧烈运动、一般运动和缓慢运动所占比例,分别以r_fast、r_common和r_static进行表示。然后,基于第一预设条件计算所述待转码数据的分类参数,例如第一预设条件可以满足如下公式:In an implementation, the embodiment calculates the proportion of strenuous motion, general motion, and slow motion in the video data to be transcoded, and is represented by r_fast, r_common, and r_static, respectively. Then, the classification parameter of the data to be transcoded is calculated based on the first preset condition, for example, the first preset condition may satisfy the following formula:
mv_score=(r_fast*2+r_common)*100Mv_score=(r_fast*2+r_common)*100
其中,mv_score表示待转码数据的分类参数,r_fast表示转码视频数据中剧烈运动分类的占比,r_common表示转码视频数据中一般运动分类的占比。Where mv_score represents the classification parameter of the data to be transcoded, r_fast represents the proportion of the severe motion classification in the transcoded video data, and r_common represents the proportion of the general motion classification in the transcoded video data.
可以理解的是,除了上述实施例给出的计算公式,只要能够将待转码数据进行复杂度分类,可以调整上述计算公式,还可以采取其他合理的计算方式,本发明实施例对此不做限定。It can be understood that, in addition to the calculation formulas given in the foregoing embodiments, as long as the complexity of the data to be transcoded can be classified, the above calculation formula can be adjusted, and other reasonable calculation manners can be adopted, which is not performed by the embodiment of the present invention. limited.
步骤S304,根据所述分类参数,基于预设第二处理策略确定所述待转码数据的第二分类信息。Step S304, determining, according to the classification parameter, the second classification information of the data to be transcoded based on the preset second processing policy.
在一种实现方案中,本实施例的第二处理策略例如可以满足如下条件:In an implementation, the second processing policy of this embodiment may meet the following conditions, for example:
当mv_score<70时,所述待转码数据被判断为缓慢运动视频场景;When mv_score<70, the data to be transcoded is determined to be a slow motion video scene;
当110≥mv_score≥70时,所述待转码数据被判断为一般运动视频场景;When 110≥mv_score≥70, the data to be transcoded is determined to be a general motion video scene;
当mv_score>110时,所述待转码数据被判断为剧烈运动视频场景。When mv_score>110, the data to be transcoded is determined to be a strenuous motion video scene.
请参考图4,其为本发明实施例所提供的编码配置的流程示意图,如图4所示,在一种实现方案中,本实施例步骤S102中,编码参数可以根据第一分类信息对应分为缓慢运动编码(medium)、一般运动编码(faster)和剧烈运动编码(superfast)三种编码配置,该三种编码配置对应不同的编码器的配置参数。其中,medium编码配置与缓慢运动的图像帧对应,faster编码配置与一般运动的图像帧对应,superfast编码配置与剧烈运动的图像帧对应。Please refer to FIG. 4 , which is a schematic flowchart of a coding configuration according to an embodiment of the present invention. As shown in FIG. 4 , in an implementation manner, in step S102 of the embodiment, the coding parameter may be corresponding to the first classification information. Three coding configurations for slow motion coding, general motion, and superfast coding, which correspond to different encoder configuration parameters. The medium encoding configuration corresponds to a slowly moving image frame, the faster encoding configuration corresponds to a general moving image frame, and the superfast encoding configuration corresponds to a vigorously moving image frame.
进行编码的过程,如图4所示,主要包括以下步骤:The process of encoding, as shown in Figure 4, mainly includes the following steps:
S401:接收待转码数据,确定待转码数据的运动矢量。S401: Receive data to be transcoded, and determine a motion vector of the data to be transcoded.
S402:控制器根据运动矢量确定待转码数据的第一分类信息及第二分类信息。S402: The controller determines first classification information and second classification information of the data to be transcoded according to the motion vector.
S403:控制器根据第一分类信息及第二分类信息确定待转码数据的转码参数及转码路数(转码参数也称为编码参数,转码路数也称为编码路数)。S403: The controller determines, according to the first classification information and the second classification information, a transcoding parameter and a number of transcoding channels of the data to be transcoded (the transcoding parameter is also referred to as an encoding parameter, and the number of transcoding channels is also referred to as an encoding channel number).
S404:根据转码参数及转码路数对待转码数据进行x264转码,形成转码码流。S404: Perform x264 transcoding on the transcoded data according to the transcoding parameter and the number of transcoding lines to form a transcoded code stream.
在一种实现方案中,本实施例步骤S103中,可以根据第二分类信息与转码路数的对应关系,获取与所述第二分类信息对应的转码路数,将所述编码参数进行调整。其中,转码路数为转码设备中设置的编码路数,所述将编码参数进行调整,指在进行转码处理时,同时根据上述编码参数及编码路数进行编码处理。例如,缓慢运动视频场景对应的转码路数为14路,一般运动视频场景对应的转码路数为10路,剧烈运动视频场景对应的转码路数为7路,可以编码参数中的转码路数调整到对应的路数。In an implementation, in step S103 of the embodiment, the number of transcoding channels corresponding to the second classification information may be acquired according to the correspondence between the second classification information and the number of transcoding paths, and the coding parameters are performed. Adjustment. The number of transcoding channels is the number of encoding channels set in the transcoding device, and the encoding parameters are adjusted, and when the transcoding process is performed, the encoding process is performed according to the encoding parameters and the number of encoding channels. For example, the number of transcoding channels corresponding to a slow motion video scene is 14 channels, the number of transcoding channels corresponding to a general motion video scene is 10 channels, and the number of transcoding channels corresponding to a strenuous motion video scene is 7 channels, which can be converted in a coding parameter. The number of code channels is adjusted to the corresponding number of ways.
请参考图5,其为本发明实施例所提供的数据处理方法的又一种 流程示意图,如图5所示,在一种实现方式中,在执行步骤S101之前,还可以包括如下步骤:Referring to FIG. 5, it is a schematic flowchart of a data processing method according to an embodiment of the present invention. As shown in FIG. 5, in an implementation manner, before performing step S101, the method may further include the following steps:
步骤S501,配置第二分类信息与转码路数的对应关系。Step S501, configuring a correspondence between the second classification information and the number of transcoding channels.
在步骤S103中,需要根据第二分类信息与转码路数的对应关系,来获取与所述第二分类信息对应的转码路数,然后将所述编码参数进行调整,第二分类信息与转码路数的对应关系通过步骤S501配置生成的。针对步骤S501的实现,本发明实施例在此提供了一种实施方式。请参考图6,其为本发明实施例所提供的步骤S501的实现方式的流程示意图,如图6所示,包括:In step S103, the number of transcoding channels corresponding to the second classification information needs to be acquired according to the correspondence between the second classification information and the number of transcoding paths, and then the encoding parameters are adjusted, and the second classification information is The correspondence relationship of the number of transcoding paths is generated by the configuration of step S501. For the implementation of step S501, an embodiment of the present invention provides an embodiment herein. Please refer to FIG. 6 , which is a schematic flowchart of an implementation manner of step S501 according to an embodiment of the present invention. As shown in FIG. 6 , the method includes:
步骤S601,获取测试数据的第一分类信息和第二分类信息。Step S601, acquiring first classification information and second classification information of the test data.
需要说明的是,在步骤S601之前,还可以包括如下步骤:It should be noted that, before step S601, the following steps may also be included:
a)接收测试数据。a) Receive test data.
b)根据预设处理策略确定所述测试数据对应的第一分类信息和第二分类信息。b) determining first classification information and second classification information corresponding to the test data according to a preset processing policy.
可以看出,基于测试数据的第一分类信息和第二分类信息确定方式,和之前描述的待转码数据的第一分类信息和第二分类信息确定方式是相同的,故在此不做赘述。It can be seen that the first classification information and the second classification information determination manner based on the test data are the same as the first classification information and the second classification information determination manner of the previously described data to be transcoded, and therefore are not described herein. .
相应地,步骤b)同样包括如下步骤:Correspondingly, step b) likewise comprises the following steps:
1)获取所述测试数据的运动矢量信息后,计算出所述测试数据中每帧画面对应的运动参数。1) After acquiring motion vector information of the test data, calculating motion parameters corresponding to each frame of the test data.
2)根据所述运动参数,并基于预设的第一处理策略确定每帧画面对应的第一分类信息。2) determining, according to the motion parameter, the first classification information corresponding to each frame of the screen based on the preset first processing policy.
3)根据所述第一分类信息,并基于预设公式计算出测试数据的分类参数。3) calculating a classification parameter of the test data according to the first classification information and based on a preset formula.
4)根据所述分类参数,基于预设的第二策略确定所述测试数据 的第二分类信息。4) determining, according to the classification parameter, second classification information of the test data based on a preset second policy.
上述关于测试数据的第一分类信息和第二分类信息确定过程,首先计算出每帧图像的move_ratio、mv_avg和mv_var,然后基于判定条件判断出每帧图像属于缓慢运动、一般运动和剧烈运动中的那一类别,即得出第一分类信息;然后计算出待转码视频数据中剧烈运动、一般运动和缓慢运动类型的各帧图像所占比例r_fast、r_common和r_static,并基于计算公式计算所述待转码数据的分类参数,根据判定条件判断出测试数据属于缓慢运动视频场景、一般运动视频场景和剧烈运动视频场景中的那一类别,即得出第二分类信息。The first classification information and the second classification information determination process regarding the test data first calculate move_ratio, mv_avg, and mv_var of each frame image, and then determine, according to the determination condition, that each frame image belongs to slow motion, general motion, and strenuous exercise. In that category, the first classification information is obtained; then the proportions r_fast, r_common, and r_static of each frame image of the strenuous motion, general motion, and slow motion type in the video data to be transcoded are calculated, and the calculation is performed based on the calculation formula. The classification parameter of the data to be transcoded determines, according to the determination condition, the test data belongs to the category of the slow motion video scene, the general motion video scene, and the strenuous motion video scene, that is, the second classification information is obtained.
关于每个步骤的具体实现方式在描述待转码数据时,已作出详细说明,由于二者的处理方式是相同的,即采用了同样的策略、同样的判定条件和同样的计算公式,来得到测试数据的第一分类信息和第二分类信息,故在此不做赘述。The specific implementation of each step has been described in detail when describing the data to be transcoded. Since the two methods are the same, that is, the same strategy, the same decision condition and the same calculation formula are used to obtain The first classification information and the second classification information of the test data are not described herein.
需要说明是,各测试数据的最终目的是要生成第二分类信息与转码路数的对应关系,或者说建立第二分类信息与转码路数的映射表。所以各测试数据要涵盖所有的第二分类信息,各测试数据要包括缓慢运动视频场景、一般运动视频场景和剧烈运动视频场景。这样,最终的第二分类信息与转码路数的对应关系才会完整,无论待转码数据是哪一种分类类型,都能够从第二分类信息与转码路数的对应关系中调取对应的转码路数信息,完成编码参数的调整。It should be noted that the final purpose of each test data is to generate a correspondence between the second classification information and the number of transcoding channels, or to establish a mapping table between the second classification information and the number of transcoding channels. Therefore, each test data should cover all the second classification information, and each test data should include a slow motion video scene, a general motion video scene, and a strenuous motion video scene. In this way, the correspondence between the final second classification information and the number of transcoding channels is complete, and regardless of the classification type of the data to be transcoded, the correspondence between the second classification information and the number of transcoding lines can be retrieved. The corresponding number of transcoding channels is used to complete the adjustment of the coding parameters.
步骤S602,配置与所述第一分类信息对应的编码参数。Step S602, configuring coding parameters corresponding to the first classification information.
其中,基于测试数据的编码参数配置过程,和之前描述的待转码数据的配置过程是相同的,仍然是medium编码配置与缓慢运动的图像帧对应,faster编码配置与一般运动的图像帧对应,superfast编码配置与剧烈运动的图像帧对应,在此不做赘述。The encoding parameter configuration process based on the test data is the same as the previously described configuration process of the data to be transcoded, and the medium encoding configuration is still corresponding to the slowly moving image frame, and the fast encoding configuration corresponds to the image frame of the general motion. The superfast coding configuration corresponds to the image frame of strenuous motion, and will not be described here.
步骤S603,计算满足第二预设条件的最大转码路数。在执行该步骤时,执行计算当对所述测试数据进行转码操作时,转码设备满足第二预设条件时对应的最大转码路数。Step S603, calculating the maximum number of transcoding paths that satisfy the second preset condition. When the step is performed, a calculation calculates a maximum number of transcoding paths corresponding to the second preset condition when the transcoding device performs the transcoding operation.
其中,转码设备的工作性能可以利用相应地参数进行表征,第二预设条件为转码设备在合理利用其处理资源前提下,维持较低的卡顿率的一种参数范围,当然满足此条件下的转码路数越大对应的转码效率越高。Wherein, the working performance of the transcoding device can be characterized by using corresponding parameters, and the second preset condition is a parameter range in which the transcoding device maintains a lower carding rate under the premise of rationally utilizing the processing resource thereof, and of course satisfies this The larger the number of transcoding channels under the condition, the higher the transcoding efficiency.
针对步骤S603的实现,本发明实施例在此提供了一种实施方式。请参考图6,其为本发明实施例所提供的步骤S603的实现方式的流程示意图,如图7所示,包括:For the implementation of step S603, an embodiment of the present invention provides an embodiment herein. Please refer to FIG. 6 , which is a schematic flowchart of the implementation manner of step S603 according to an embodiment of the present invention. As shown in FIG. 7 , the method includes:
步骤S701,计算出各第一预设转码路数下的超载率和最大卡顿率。在执行该步骤时,执行计算出所述测试数据在各第一预设转码路数下进行转码时,所述转码设备的超载率和最大卡顿率。Step S701, calculating an overload rate and a maximum carding rate under the first preset number of transcoding paths. When performing the step, performing an operation to calculate an overload rate and a maximum carding rate of the transcoding device when the test data is transcoded under each of the first preset transcoding paths.
在确定测试数据对应的最大转码路数时,不同类型的测试数据分别进行获取。对于一个类型的测试数据,预设多个路数,例如,5路、6路、7路,将所述类型的测试数据分别输入预设的路数进行转码处理,确定各路数下的转码设备的超载率和最大卡顿率,将超载率及最大卡顿率满足预设条件的最大的路数设置为测试数据对应的最大路数。When determining the maximum number of transcoding paths corresponding to the test data, different types of test data are separately acquired. For one type of test data, a plurality of ways are preset, for example, 5 channels, 6 channels, and 7 channels, and the test data of the type is input into a preset number of channels for transcoding, and the number of each channel is determined. The overload rate and the maximum card rate of the transcoding device are set to the maximum number of ways that the overload rate and the maximum card rate meet the preset conditions as the maximum number of channels corresponding to the test data.
在一种实现方案中,本实施定义了超载率和卡顿率。其中,超载率可以为基于指定采集周期采集的指定采集次数中处理设备CPU负载率大于80%的采集次数与指定采集次数的比值。针对一个第一预设转码路数,在转码设备中设置所述转码路数,将与所述路数相同数量的将测试数据(例如,剧烈运动视频场景)分别输入转码设备的各路进行转码处理,周期采集转码设备的负载率。卡顿率为每路转码路数的实时帧率与参考帧率的比值,其中参考帧率可以为输入帧率减1后 的数值。第一预设转码路数是指测试过程的全部转码路数,最大卡顿率为每路转码路数对应的各卡顿率值中的最大值。例如,若第一预设转码路数包括7路转码路数时,则需要计算出7路转码路数各自的卡顿率,然后在7个卡顿率中选取最大值作为最大卡顿率。In one implementation, the present embodiment defines an overload rate and a carding rate. The overload rate may be a ratio of the number of acquisition times of the processing device CPU load rate greater than 80% to the specified collection times in the specified collection times collected according to the specified collection period. Setting the number of transcoding channels in the transcoding device for a first preset number of transcoding channels, and inputting the same number of test data (for example, a strenuous motion video scene) into the transcoding device respectively. Each channel performs transcoding processing, and periodically collects the load rate of the transcoding device. The card rate is the ratio of the real-time frame rate of each transcoding channel to the reference frame rate, where the reference frame rate can be the value after the input frame rate is decremented by one. The first preset number of transcoding channels refers to the total number of transcoding channels in the testing process, and the maximum carding rate is the maximum value of each cardton rate value corresponding to the number of transcoding channels per channel. For example, if the number of the first preset transcoding channels includes the number of 7 transcoding channels, it is necessary to calculate the respective cardon rates of the 7 transcoding channels, and then select the maximum value as the maximum card among the 7 card rates. Rate.
步骤S702,获取所述超载率和所述最大卡顿率分别小于预设超载率和预设最大卡顿率的对应各第二预设转码路数。在执行该步骤时,执行确定所述超载率和所述最大卡顿率分别小于预设超载率和预设最大卡顿率时对应的一个或多个第二预设转码路数。Step S702, obtaining the second preset number of transcoding channels corresponding to the preset overload rate and the preset maximum card rate respectively. When performing the step, performing one or more second preset transcoding paths corresponding to determining that the overload rate and the maximum card rate are less than a preset overload rate and a preset maximum card rate, respectively.
在一种实现方案中,若第一预设转码路数为5路至10路,则会计算出5组对应的超载率和最大卡顿率,当5路至7路时,满足所述超载率和所述最大卡顿率分别小于预设超载率和预设最大卡顿率,则5路至7路以第二预设转码路数进行表示。In an implementation, if the number of the first preset transcoding channels is 5 to 10, the corresponding overload rate and the maximum card rate are calculated, and when 5 to 7 are satisfied, the overload is satisfied. The rate and the maximum carding rate are respectively less than the preset overload rate and the preset maximum card rate, and the 5th to 7th channels are represented by the second preset number of transcoding channels.
在一种实现方案中,本实施的预设超载率为10%,预设最大卡顿率1%,在具体的实施过程中,可以选择其他合理的数值范围,本发明实施例对此不做限定。具体地,最大转码路数可以通过如下的表达式进行确定:In an implementation, the preset overload rate of the implementation is 10%, and the preset maximum card rate is 1%. In a specific implementation process, other reasonable value ranges may be selected, and the embodiment of the present invention does not do this. limited. Specifically, the maximum number of transcoding paths can be determined by the following expression:
Figure PCTCN2018083501-appb-000001
Figure PCTCN2018083501-appb-000001
其中,fps为实际编码帧率,fps th为目标编码帧率,Frame(fps<fps th)/Frame表征编码帧率小于目标编码帧率的帧数与总帧数的比值;CPU为转码设备的负载消耗,CPU th为负载消耗阈值,T(CPU>CPU th)/T total为采集次数中转码设备的实际负载超过负载消耗阈值的次数与采集总次数的比值。 Where fps is the actual encoding frame rate, fps th is the target encoding frame rate, and Frame(fps<fps th )/Frame indicates that the encoding frame rate is smaller than the target encoding frame rate and the ratio of the total number of frames; the CPU is the transcoding device. The load consumption, CPU th is the load consumption threshold, and T (CPU>CPU th )/T total is the ratio of the number of times the actual load of the transcoding device exceeds the load consumption threshold to the total number of acquisitions.
步骤S703,以各所述第二预设转码路数中的最大值作为最大转码路数。在执行该步骤时,执行将所述一个或多个第二预设转码路数中 的最大值作为所述最大转码路数。Step S703, using the maximum value of each of the second preset transcoding channels as the maximum number of transcoding channels. When the step is performed, the maximum value of the one or more second preset transcoding paths is performed as the maximum number of transcoding paths.
可选地,延续上述的说明,第二预设转码路数为5路至7路,其中最大值为7路,所以最大转码路数为7路。Optionally, continuing the above description, the number of the second preset transcoding channels is 5 to 7 channels, wherein the maximum value is 7 channels, so the maximum number of transcoding channels is 7 channels.
其中,关于步骤S701中计算出各第一预设转码路数下的超载率,本发明实施例在此提供了一种实施方式,包括如下步骤:The embodiment of the present invention provides an implementation manner, including the following steps, in the step S701, in which the overload rate under the number of the first preset transcoding channels is calculated:
a)在所述测试数据在当前第一预设转码路数下进行转码时,基于预设周期采集第一采集次数的所述转码设备的负载率。a) when the test data is transcoded under the current first preset number of transcodes, the load rate of the transcoding device of the first acquisition number is collected based on the preset period.
其中,负载率为转码设备CPU的工作性能参数之一,可直接从CPU进行采集,预设周期和第一采集次数可以根据实际应用场景进行设置,比如,每一秒采集一次,共采集100次。The load rate is one of the working performance parameters of the CPU of the transcoding device, and can be directly collected from the CPU. The preset period and the first number of times can be set according to the actual application scenario. For example, every second is collected, and a total of 100 is collected. Times.
b)在所述第一采集次数的负载率中,确定负载率大于预设负载率阈值的负载率的第二采集次数。b) determining, in the load ratio of the first collection times, the second collection number of the load rate whose load rate is greater than the preset load rate threshold.
比如,第一采集次数为100次,其中有10次的负载率大于预设负载率阈值,则第二采集次数为10次。For example, the first number of acquisitions is 100, and the load rate of 10 times is greater than the preset load rate threshold, and the second number of acquisitions is 10 times.
c)计算所述第二采集次数和所述第一采集次数之间的第一比值,并以所述第一比值作为当前第一预设转码路数下所述转码设备的超载率。And calculating a first ratio between the second collection number and the first collection number, and using the first ratio as the overload rate of the transcoding device under the current first preset transcoding path.
比如,第一采集次数为100次,第二采集次数为10次,所述第二采集次数和所述第一采集次数之间的第一比值为10%,则当前第一预设转码路数下的超载率为10%。For example, the first number of acquisitions is 100, the second number of acquisitions is 10, and the first ratio between the second collection number and the first collection number is 10%, and the current first preset transcoding path The overload rate under the number is 10%.
关于步骤S701中计算出各第一预设转码路数下的最大卡顿率,本发明实施例在此提供了一种实施方式,包括如下步骤:With regard to the calculation of the maximum card rate under the first preset number of transcodings in step S701, an embodiment of the present invention provides an embodiment, including the following steps:
a)在当前第一预设转码路数下,采集每路所对应的各实时帧率。a) Under the current first preset number of transcoding channels, collect the real-time frame rates corresponding to each path.
b)计算各所述实时帧率与参考帧率的各第二比值,并以各所述第二比值中的最大值作为当前第一预设转码路数下的最大卡顿率。b) calculating a second ratio of each of the real-time frame rate and the reference frame rate, and using the maximum value of each of the second ratios as the maximum cardon rate under the current first preset number of transcoding paths.
其中,实时帧率为转码过程的参数之一,可直接从转码设备进行采集,参考帧率为输入帧率减1后的数值。The real-time frame rate is one of the parameters of the transcoding process, and can be directly collected from the transcoding device, and the reference frame rate is a value obtained by subtracting 1 from the input frame rate.
下面通过具体应用场景对配置第二分类信息与转码路数的对应关系进行详细说明。The following describes the correspondence between the configuration of the second classification information and the number of transcoding channels in a specific application scenario.
计算出各测试视频数据信息的分类参数,并确定各测试数据的第二分类信息,具体如表1所示。The classification parameters of each test video data information are calculated, and the second classification information of each test data is determined, as shown in Table 1.
Figure PCTCN2018083501-appb-000002
Figure PCTCN2018083501-appb-000002
表1Table 1
下面以剧烈运动视频场景为例,将剧烈运动视频场景(可以包括视频7-10中任一者、任两者、任三者或任四者)输入转码设备进行转码处理,确定其对应的转码路数。以5路转码路数为起点,依次增加一路转码路数的方式,分别计算出5-10路转码路数下的各卡顿率和CPU超载率,具体如表2所示。The following takes a strenuous motion video scene as an example, and inputs a strenuous motion video scene (which may include any one of video 7-10, any two, any three, or any four) into a transcoding device to perform transcoding processing to determine the corresponding The number of transcoded roads. Taking the number of 5 channels of transcoding as the starting point, and increasing the number of transcoding channels in turn, respectively calculate the card rate and CPU overload rate under the number of 5-10 transcoding channels, as shown in Table 2.
转码路数Number of transcoded roads 卡顿率Caton rate 超载率Overload rate
55 0.13%0.13% 0.00%0.00%
66 0.28%0.28% 0.00%0.00%
77 0.05%0.05% 5.842%5.842%
88 3.74%3.74% 32.990%32.990%
99 27.93%27.93% 91.837%91.837%
1010 43.35%43.35% 95.973%95.973%
表2Table 2
从表2中可以看出,对于当前处理设备来说,在处理剧烈运动视频场景时,满足卡顿率低于1%且CPU超载率小于10%的各转码路数中的最大值为7路,即剧烈运动视频场景对应的转码路数为7路。As can be seen from Table 2, for the current processing device, when processing a strenuous motion video scene, the maximum value of the number of transcoding channels that satisfy the cardon rate less than 1% and the CPU overload rate is less than 10% is 7 The number of transcoded roads corresponding to the road, that is, the strenuous motion video scene is 7.
相应地,采用同样的评估方式,对于当前处理设备来说,处理一般运动视频场景时,满足卡顿率低于1%且CPU超载率小于10%的各转码路数中的最大值为10路,即一般运动视频场景对应的转码路数为10路;处理缓慢运动视频场景时,满足卡顿率低于1%且CPU超载率小于10%的各转码路数中的最大值为14路,即缓慢运动视频场景对应的转码路数为14路。当执行完步骤S603后,所述第二分类信息与所述最大转码路数的对应关系建立完成。Correspondingly, the same evaluation method is adopted. For the current processing device, when processing a general motion video scene, the maximum value of each transcoding channel that satisfies the cardon rate less than 1% and the CPU overload rate is less than 10% is 10 The number of transcoding paths corresponding to the general motion video scene is 10; when processing the slow motion video scene, the maximum of the number of transcoding channels that satisfy the cardon rate less than 1% and the CPU overload rate is less than 10% is 14 channels, that is, the number of transcoding channels corresponding to the slow motion video scene is 14 channels. After the step S603 is performed, the correspondence between the second classification information and the maximum number of transcoding paths is established.
需要说明的是,在实际处理过程中,处理设备可能会出现当转码路数为n路时,出现处理资源浪费的情况,而当转码路数为n+1路时,出现卡顿率较高的情况。比如,处理设备基于剧烈运动视频场景进行分辨率为1080P的转码,转码路数最大为7路,此时处理设备会有部分的处理资源未被利用,当转码路数增加为8路时,则卡顿率较高,此时可以在保证7路分辨率为1080P的转码路数不变的前提下,增加几路低分辨率的转码路数,如分辨率为720P等,从而可以在充分利用处理 资源的前提下,一定程度上降低卡顿率。It should be noted that in the actual processing process, the processing device may have a situation that when the number of transcoding channels is n, the processing resources are wasted, and when the number of transcoding channels is n+1, the carding rate occurs. Higher situation. For example, the processing device performs transcoding with a resolution of 1080P based on a strenuous motion video scene, and the number of transcoding channels is up to 7 channels. At this time, some processing resources of the processing device are not utilized, and the number of transcoding channels is increased to 8 channels. When the card has a high rate, the number of transcoding channels with a low resolution of 720P can be increased under the premise that the number of transcoded channels with the resolution of 1080P is unchanged. Therefore, the card ratio can be reduced to some extent under the premise of making full use of the processing resources.
步骤S604,存储所述第二分类信息与所述最大转码路数的对应关系。Step S604, storing a correspondence between the second classification information and the maximum number of transcoding channels.
具体地,步骤S604将建立的所述第二分类信息与所述最大转码路数的对应关系存储至对应位置处,在当需要进行编码参数调整时,调取对应的转码路数。Specifically, in step S604, the correspondence between the established second classification information and the maximum number of transcoding channels is stored to the corresponding location, and when the encoding parameter adjustment needs to be performed, the corresponding number of transcoding channels is retrieved.
本发明实施例中,包括配置编码参数与调整编码参数两个过程,能够在获取待转码数据的不同类型的分类信息后,先配置与第一分类信息对应的编码参数,再获取与第二分类信息对应的转码路数,以将之前的编码参数进行调整,与现有技术相比,可以在处理不同类型待转码数据时配置相应的编码参数,还可以进一步调整转码路数,避免了转码设备处理资源的浪费,减少了转码过程中的卡顿率,在一定程度上提高了转码效率。In the embodiment of the present invention, the process of configuring the coding parameter and the adjustment of the coding parameter is performed, and after acquiring different types of classification information of the data to be transcoded, the coding parameter corresponding to the first classification information is configured, and then the second and second The number of transcoding channels corresponding to the classification information is adjusted to adjust the previous coding parameters. Compared with the prior art, the corresponding coding parameters can be configured when processing different types of data to be transcoded, and the number of transcoding channels can be further adjusted. The waste of processing resources of the transcoding device is avoided, the carding rate in the transcoding process is reduced, and the transcoding efficiency is improved to some extent.
需要说明的是,本发明实施例中所涉及的终端可以包括但不限于个人计算机(Personal Computer,PC)、个人数字助理(Personal Digital Assistant,PDA)、无线手持设备、平板电脑(Tablet Computer)、手机、MP3播放器、MP4播放器等。It should be noted that the terminals involved in the embodiments of the present invention may include, but are not limited to, a personal computer (PC), a personal digital assistant (PDA), a wireless handheld device, a tablet computer, and a tablet computer. Mobile phones, MP3 players, MP4 players, etc.
需要说明的是,S101~S103的执行主体可以为数据处理装置,该装置可以位于本地终端的应用,或者还可以为位于本地终端的应用中的插件或软件开发工具包(Software Development Kit,SDK)等功能单元,本发明实施例对此不进行特别限定。It should be noted that the execution body of S101 to S103 may be a data processing device, and the device may be located in an application of a local terminal, or may be a plug-in or a software development kit (SDK) located in an application of the local terminal. The functional unit is not particularly limited in this embodiment of the present invention.
可以理解的是,所述应用可以是安装在终端上的应用程序(nativeApp),或者还可以是终端上的浏览器的一个网页程序(webApp),本发明实施例对此不进行限定。It is to be understood that the application may be an application (nativeApp) installed on the terminal, or may be a web application (webApp) of the browser on the terminal, which is not limited by the embodiment of the present invention.
本发明实施例进一步给出实现上述方法实施例中各步骤及方法 的装置实施例。Embodiments of the present invention further provide an apparatus embodiment for implementing the steps and methods in the foregoing method embodiments.
请参考图8,其为本发明实施例所提供的数据处理装置的功能方块图。如图8所示,该装置包括:Please refer to FIG. 8 , which is a functional block diagram of a data processing apparatus according to an embodiment of the present invention. As shown in Figure 8, the device includes:
获取单元810,用于获取第一处理单元800确定出的待转码数据的第一分类信息和第二分类信息;The obtaining unit 810 is configured to obtain first classification information and second classification information of the data to be transcoded determined by the first processing unit 800;
第一配置单元820,用于配置与获取单元810获取的第一分类信息对应的编码参数;The first configuration unit 820 is configured to configure an encoding parameter corresponding to the first classification information acquired by the obtaining unit 810;
调整单元830,用于根据第二分类信息与转码路数的对应关系,获取与获取单元810获取的第二分类信息对应的转码路数,将第一配置单元820配置的所述编码参数进行调整。The adjusting unit 830 is configured to obtain the number of transcoding channels corresponding to the second classification information acquired by the obtaining unit 810 according to the correspondence between the second classification information and the number of transcoding paths, and the encoding parameter configured by the first configuration unit 820 Make adjustments.
请参考图8,如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述装置还包括:Referring to FIG. 8 , the foregoing aspect and any possible implementation manner further provide an implementation manner, where the apparatus further includes:
第一处理单元800,用于接收待转码数据;The first processing unit 800 is configured to receive data to be transcoded;
根据预设处理策略确定所述待转码数据对应的第一分类信息和第二分类信息。Determining the first classification information and the second classification information corresponding to the to-be-transcoded data according to a preset processing policy.
请参考图9,其为本发明实施例所提供的第一处理单元800的功能方块图。如图9所示,如上所述的方面和任一可能的实现方式,所述第一处理单元800具体包括:Please refer to FIG. 9 , which is a functional block diagram of a first processing unit 800 according to an embodiment of the present invention. As shown in FIG. 9, the first processing unit 800 specifically includes the following aspects and any possible implementation manners:
第一计算模块801,用于在获取所述待转码数据的运动矢量信息后,计算所述待转码数据中每帧画面对应的运动参数;a first calculation module 801, configured to calculate motion parameters corresponding to each frame of the data to be transcoded after acquiring motion vector information of the data to be transcoded;
第一确定模块802,用于根据第一计算模块801计算出的所述运动参数,并基于预设第一处理策略确定每帧画面对应的第一分类信息;The first determining module 802 is configured to determine, according to the motion parameter calculated by the first calculating module 801, the first category information corresponding to each frame of the screen according to the preset first processing policy;
第二计算模块803,用于根据第一确定模块802确定出的所述第一分类信息,并基于第一预设条件计算所述待转码数据的分类参数;The second calculation module 803 is configured to calculate, according to the first classification information determined by the first determining module 802, a classification parameter of the data to be transcoded based on the first preset condition;
第二确定模块804,用于根据第二计算模块803计算出的所述分类 参数,基于预设第二处理策略确定所述待转码数据的第二分类信息。The second determining module 804 is configured to determine, according to the classification parameter calculated by the second calculating module 803, the second classification information of the data to be transcoded based on the preset second processing policy.
请参考图8,如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述装置还包括:Referring to FIG. 8 , the foregoing aspect and any possible implementation manner further provide an implementation manner, where the apparatus further includes:
第二配置单元840,用于配置第二分类信息与转码路数的对应关系。从而,调整单元830可以调取第二分类信息与转码路数的对应关系来进行转码参数调整。The second configuration unit 840 is configured to configure a correspondence between the second classification information and the number of transcoding channels. Therefore, the adjusting unit 830 can adjust the correspondence between the second classification information and the number of transcoding channels to perform transcoding parameter adjustment.
请参考图10,其为本发明实施例所提供的第二配置单元的功能方块图。如图10所示,如上所述的方面和任一可能的实现方式,所述第二配置单元840具体包括:Please refer to FIG. 10 , which is a functional block diagram of a second configuration unit according to an embodiment of the present invention. As shown in FIG. 10, in the aspect and any possible implementation manner, the second configuration unit 840 specifically includes:
获取模块841,用于获取第二处理单元850确定的测试数据的第一分类信息和第二分类信息;The obtaining module 841 is configured to obtain first classification information and second classification information of the test data determined by the second processing unit 850;
配置模块842,用于配置与获取模块841获取的所述第一分类信息对应的编码参数;The configuration module 842 is configured to configure an encoding parameter corresponding to the first classification information acquired by the obtaining module 841;
处理模块843,用于计算满足第二预设条件的最大转码路数;The processing module 843 is configured to calculate a maximum number of transcoding paths that meet the second preset condition;
存储模块844,用于存储获取模块841获取的所述第二分类信息与处理模块843计算的所述最大转码路数的对应关系。The storage module 844 is configured to store a correspondence between the second classification information acquired by the obtaining module 841 and the maximum number of transcoding paths calculated by the processing module 843.
请参考图8,如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述装置还包括:Referring to FIG. 8 , the foregoing aspect and any possible implementation manner further provide an implementation manner, where the apparatus further includes:
第二处理单元850,用于接收测试数据;a second processing unit 850, configured to receive test data;
根据预设处理策略确定所述测试数据对应的第一分类信息和第二分类信息。Determining the first classification information and the second classification information corresponding to the test data according to a preset processing policy.
请参考图11,其为本发明实施例所提供的第二处理单元的功能方块图。如图11所示,如上所述的方面和任一可能的实现方式,所述第二处理单元850具体包括:Please refer to FIG. 11 , which is a functional block diagram of a second processing unit according to an embodiment of the present invention. As shown in FIG. 11, in the aspect and any possible implementation manner, the second processing unit 850 specifically includes:
第三计算模块851,用于在获取所述测试数据的运动矢量信息后, 计算出所述测试数据中每帧画面对应的运动参数;a third calculation module 851, configured to calculate, after acquiring the motion vector information of the test data, a motion parameter corresponding to each frame of the test data;
第三确定模块852,用于根据第三计算模块851计算出的所述运动参数,并基于预设的第一处理策略确定每帧画面对应的第一分类信息;The third determining module 852 is configured to determine, according to the motion parameter calculated by the third calculating module 851, the first category information corresponding to each frame of the screen according to the preset first processing policy;
第四计算模块853,用于根据第三确定模块852确定出的所述第一分类信息,并基于预设公式计算出测试数据的分类参数;The fourth calculation module 853 is configured to calculate, according to the first classification information determined by the third determining module 852, a classification parameter of the test data according to a preset formula;
第四确定模块854,用于根据第四计算模块853计算出的所述分类参数,基于预设的第二策略确定所述测试数据的第二分类信息。The fourth determining module 854 is configured to determine, according to the classification parameter calculated by the fourth calculating module 853, the second classification information of the test data based on the preset second policy.
请参考图10,如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述处理模块853具体包括:Referring to FIG. 10, the foregoing aspect and any possible implementation manner further provide an implementation manner, where the processing module 853 specifically includes:
计算子模块8531,用于计算出各第一预设转码路数下的超载率和最大卡顿率;The calculating submodule 8531 is configured to calculate an overload rate and a maximum card rate under each first preset number of transcoding paths;
获取子模块8532,用于从计算子模块8531中获取所述超载率和所述最大卡顿率分别小于预设超载率和预设最大卡顿率的对应各第二预设转码路数;The obtaining sub-module 8532 is configured to obtain, from the calculating sub-module 8531, the corresponding second preset transcoding channels that are different from the preset overload rate and the preset maximum card rate respectively.
选择子模块8533,以获取子模块8532中各所述第二预设转码路数中的最大值作为最大转码路数。The submodule 8533 is selected to obtain the maximum value of each of the second preset transcoding channels in the submodule 8532 as the maximum number of transcoding channels.
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述计算子模块8531具体用于:An implementation manner is further provided, where the calculation submodule 8531 is specifically configured to:
在当前第一预设转码路数下,基于预设周期采集第一采集次数的各负载率;Collecting, according to the preset period, the respective load rates of the first collection times according to the current preset number of transcoding paths;
获取所述第一采集次数中各所述负载率大于预设负载率阈值时的第二采集次数;Acquiring the second collection times when the load rate of the first collection times is greater than a preset load rate threshold;
计算所述第二采集次数和所述第一采集次数之间的第一比值,并以所述第一比值作为当前第一预设转码路数下的超载率。Calculating a first ratio between the second number of acquisitions and the first number of acquisitions, and using the first ratio as the overload rate under the current first preset number of retransmissions.
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述计算子模块8531具体用于:An implementation manner is further provided, where the calculation submodule 8531 is specifically configured to:
在当前第一预设转码路数下,采集每路所对应的各实时帧率;Collecting each real-time frame rate corresponding to each path under the current first preset transcoding path;
计算各所述实时帧率与参考帧率的各第二比值,并以各所述第二比值中的最大值作为当前第一预设转码路数下的最大卡顿率。Calculating a second ratio of each of the real-time frame rate and the reference frame rate, and using a maximum value of each of the second ratios as a maximum carding rate under the current first preset number of transcoding paths.
由于本实施例中的各单元能够执行图1至图7所示的方法,本实施例未详细描述的部分,可参考对图1至图7的相关说明。Since the units in this embodiment can perform the methods shown in FIG. 1 to FIG. 7, and the portions not described in detail in this embodiment, reference may be made to the related descriptions of FIGS. 1 to 7.
本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的方法中的步骤。The present application also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of any of the methods described above.
请参考图12,其为本发明实施例所提供的数据处理设备的结构示意图。如图12所示,数据处理设备至少包括输入端口1210、处理器1220、存储器1230和输出端口1240。该存储器1230存储计算机可读指令,该处理器1220执行该存储器1230中的计算机刻度指令用于执行上述图1、图2、图3、图4、图5、图6和图7所示的方法以及图8至图11所示装置所执行的操作。首先,数据处理设备通过输入端口1210接收待转码数据,处理器1220根据预设处理策略确定待转码数据对应的第一分类信息和第二分类信息;然后,数据处理设备通过处理器1220获取待转码数据对应的第一分类信息和第二分类信息后,配置与第一分类信息对应的编码参数,并根据第二分类信息与转码路数的对应关系,从存储器1230中获取与所述第二分类信息对应的转码路数,将所述编码参数进行调整;最后,数据处理设备通过输出端口1240将转码后的数据输出。其中,第二分类信息与转码路数的对应关系是数据处理设备通过多组测试数据测试后得到的,测试过程和上述待转码数据的处理过程类似,故在此不做赘述。Please refer to FIG. 12 , which is a schematic structural diagram of a data processing device according to an embodiment of the present invention. As shown in FIG. 12, the data processing device includes at least an input port 1210, a processor 1220, a memory 1230, and an output port 1240. The memory 1230 stores computer readable instructions, and the processor 1220 executes computer scale instructions in the memory 1230 for performing the methods illustrated in Figures 1, 2, 3, 4, 5, 6, and 7 above. And the operations performed by the devices shown in Figures 8-11. First, the data processing device receives the data to be transcoded through the input port 1210, and the processor 1220 determines the first classification information and the second classification information corresponding to the data to be transcoded according to the preset processing policy. Then, the data processing device obtains the data through the processor 1220. After the first classification information and the second classification information corresponding to the transcoded data, the coding parameters corresponding to the first classification information are configured, and the corresponding information is obtained from the memory 1230 according to the correspondence between the second classification information and the number of transcoding channels. The number of transcoding channels corresponding to the second classification information is adjusted, and the encoding parameters are adjusted. Finally, the data processing device outputs the transcoded data through the output port 1240. The corresponding relationship between the second classification information and the number of transcoding channels is obtained after the data processing device tests through the plurality of sets of test data, and the testing process is similar to the processing process of the data to be transcoded, and therefore is not described herein.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的***,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本发明所提供的几个实施例中,应该理解到,所揭露的***,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如,多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined. Or it can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机装置(可以是个人计算机,服务器,或者网络装置等)或处理器(Processor)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random  Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium. The above software functional unit is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods of the various embodiments of the present invention. Part of the steps. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明实施例,凡在本发明实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明实施例保护的范围之内。The above is only the preferred embodiment of the present invention, and is not intended to limit the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc. within the spirit and principles of the embodiments of the present invention should be It is included in the scope of protection of the embodiments of the present invention.

Claims (15)

  1. 一种数据处理方法,其特征在于,所述方法包括:A data processing method, the method comprising:
    获取待转码数据的第一分类信息和第二分类信息;Obtaining first classification information and second classification information of the data to be transcoded;
    配置与所述第一分类信息对应的编码参数;And configuring an encoding parameter corresponding to the first classification information;
    根据第二分类信息与转码路数的对应关系,获取与所述第二分类信息对应的转码路数;Obtaining, according to the correspondence between the second classification information and the number of transcoding paths, the number of transcoding channels corresponding to the second classification information;
    根据所述编码参数及所述转码路数对所述待转码数据进行转码处理。Transcoding the data to be transcoded according to the encoding parameter and the number of transcoding channels.
  2. 根据权利要求1所述的方法,其中,所述待转码数据包括一帧或多帧画面,所述待转码数据对应的第一分类信息包括所述一帧或多帧画面中每帧画面对应的第一分类信息;The method according to claim 1, wherein the data to be transcoded comprises one or more frames, and the first classification information corresponding to the data to be transcoded includes each frame of the one or more frames. Corresponding first classification information;
    获取所述待转码数据的第一分类信息和第二分类信息包括:Obtaining the first classification information and the second classification information of the data to be transcoded includes:
    确定所述待转码数据的运动矢量信息,根据所述运动矢量信息确定所述待转码数据中每帧画面对应的运动参数;Determining motion vector information of the data to be transcoded, and determining a motion parameter corresponding to each frame of the data to be transcoded according to the motion vector information;
    根据所述运动参数,确定每帧画面对应的第一分类信息;Determining, according to the motion parameter, first classification information corresponding to each frame of the screen;
    根据所述第一分类信息,及第一预设条件确定所述待转码数据的分类参数;Determining, according to the first classification information, and the first preset condition, a classification parameter of the data to be transcoded;
    根据所述分类参数,确定所述待转码数据的第二分类信息。Determining, according to the classification parameter, second classification information of the data to be transcoded.
  3. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    配置第二分类信息与转码路数的对应关系。The correspondence between the second classification information and the number of transcoding channels is configured.
  4. 根据权利要求3所述的方法,其中,所述配置第二分类信息与转码路数的对应关系,具体包括:The method according to claim 3, wherein the mapping the correspondence between the second classification information and the number of transcoding channels comprises:
    获取测试数据的第二分类信息;Obtaining second classification information of the test data;
    计算当对所述测试数据进行转码操作时,转码设备满足第二预设 条件时对应的最大转码路数;Calculating a maximum number of transcoding paths corresponding to the second preset condition when the transcoding device satisfies the second predetermined condition when performing the transcoding operation on the test data;
    存储所述第二分类信息与所述最大转码路数的对应关系。And storing a correspondence between the second classification information and the maximum number of transcoding channels.
  5. 根据权利要求4所述的方法,其中,在获取测试数据的第二分类信息之前,所述方法还包括:The method of claim 4, wherein before acquiring the second classification information of the test data, the method further comprises:
    接收所述测试数据;Receiving the test data;
    确定所述测试数据的运动矢量信息,根据所述运动矢量确定所述测试数据中每帧画面对应的运动参数;Determining motion vector information of the test data, and determining, according to the motion vector, a motion parameter corresponding to each frame of the test data;
    根据所述运动参数,确定所述测试数据的每帧画面对应的第一分类信息;Determining, according to the motion parameter, first classification information corresponding to each frame of the test data;
    根据所述第一分类信息,并基于预设公式计算出所述测试数据的分类参数;Calculating, according to the first classification information, a classification parameter of the test data according to a preset formula;
    根据所述分类参数,确定所述测试数据的第二分类信息。Determining, according to the classification parameter, second classification information of the test data.
  6. 根据权利要求4所述的方法,其中,所述计算当对所述测试数据进行转码时,转码设备满足第二预设条件时对应的最大转码路数,具体包括:The method according to claim 4, wherein the calculating the maximum number of transcoding paths corresponding to the second preset condition when the transcoding device satisfies the second preset condition when transcoding the test data comprises:
    计算出所述测试数据在各第一预设转码路数下进行转码时,所述转码设备的超载率和最大卡顿率;Calculating an overload rate and a maximum carding rate of the transcoding device when the test data is transcoded under each of the first preset transcoding lines;
    确定所述超载率和所述最大卡顿率分别小于预设超载率和预设最大卡顿率时对应的一个或多个第二预设转码路数;Determining, that the overload rate and the maximum card rate are less than a preset overload rate and a preset maximum card rate, and corresponding one or more second preset number of transcoding channels;
    将所述一个或多个第二预设转码路数中的最大值作为所述最大转码路数。The maximum value of the one or more second preset transcoding paths is used as the maximum number of transcoding paths.
  7. 根据权利要求6所述的方法,其中,所述计算出所述测试数据在各第一预设转码路数下进行转码时,所述转码设备的超载率,具体包括:The method according to claim 6, wherein the calculating the overload rate of the transcoding device when the test data is transcoded under the first preset number of transcoding channels comprises:
    在所述测试数据在当前第一预设转码路数下进行转码时,基于预 设周期采集第一采集次数的所述转码设备的负载率;When the test data is transcoded under the current first preset number of transcodes, the load rate of the transcoding device of the first collection number is collected based on the preset period;
    在所述第一采集次数的负载率中,确定负载率大于预设负载率阈值的负载率的第二采集次数;Determining, in the load ratio of the first collection times, a second collection number of load ratios whose load ratio is greater than a preset load rate threshold;
    计算所述第二采集次数和所述第一采集次数之间的第一比值,并以所述第一比值作为当前第一预设转码路数下所述转码设备的超载率。Calculating a first ratio between the second collection number and the first collection number, and using the first ratio as the overload rate of the transcoding device under the current first preset transcoding path.
  8. 一种数据处理装置,包括一个或一个以上处理器和一个或一个以上存储器,所述一个或一个以上存储器包括计算机可读指令;所述计算机可读指令经配置由所述一个或多个处理器执行以下操作:A data processing apparatus comprising one or more processors and one or more memories, the one or more memories comprising computer readable instructions; the computer readable instructions being configured by the one or more processors Do the following:
    获取待转码数据的第一分类信息和第二分类信息;Obtaining first classification information and second classification information of the data to be transcoded;
    配置与所述第一分类信息对应的编码参数;And configuring an encoding parameter corresponding to the first classification information;
    根据第二分类信息与转码路数的对应关系,获取与所述第二分类信息对应的转码路数;Obtaining, according to the correspondence between the second classification information and the number of transcoding paths, the number of transcoding channels corresponding to the second classification information;
    根据所述编码参数及所述转码路数对所述待转码数据进行转码处理。Transcoding the data to be transcoded according to the encoding parameter and the number of transcoding channels.
  9. 根据权利要求8所述的装置,其中,所述待转码数据包括一帧或多帧画面,所述待转码数据对应的第一分类信息包括所述一帧或多帧画面中每帧画面对应的第一分类信息;所述计算机可读指令经配置由所述一个或多个处理器执行以下操作:The device according to claim 8, wherein the data to be transcoded comprises one or more frames, and the first classification information corresponding to the data to be transcoded comprises each frame of the one or more frames. Corresponding first classification information; the computer readable instructions configured to perform the following operations by the one or more processors:
    确定所述待转码数据的运动矢量信息,根据所述运动矢量信息确定所述待转码数据中每帧画面对应的运动参数;Determining motion vector information of the data to be transcoded, and determining a motion parameter corresponding to each frame of the data to be transcoded according to the motion vector information;
    根据所述运动参数,确定每帧画面对应的第一分类信息;Determining, according to the motion parameter, first classification information corresponding to each frame of the screen;
    根据所述第一分类信息,及第一预设条件确定所述待转码数据的分类参数;Determining, according to the first classification information, and the first preset condition, a classification parameter of the data to be transcoded;
    根据所述分类参数,确定所述待转码数据的第二分类信息。Determining, according to the classification parameter, second classification information of the data to be transcoded.
  10. 根据权利要求8所述的装置,其中,所述计算机可读指令经配置由所述一个或多个处理器执行以下操作:The apparatus of claim 8, wherein the computer readable instructions are configured by the one or more processors to:
    配置第二分类信息与转码路数的对应关系。The correspondence between the second classification information and the number of transcoding channels is configured.
  11. 根据权利要求10所述的装置,其中,所述计算机可读指令经配置由所述一个或多个处理器执行以下操作:The apparatus of claim 10, wherein the computer readable instructions are configured by the one or more processors to:
    获取测试数据的第二分类信息;Obtaining second classification information of the test data;
    计算当对所述测试数据进行转码操作时,转码设备满足第二预设条件时对应的最大转码路数;Calculating a maximum number of transcoding paths corresponding to the second preset condition when the transcoding device satisfies the second predetermined condition when performing the transcoding operation on the test data;
    存储所述第二分类信息与所述最大转码路数的对应关系。And storing a correspondence between the second classification information and the maximum number of transcoding channels.
  12. 根据权利要求11所述的装置,其中,在获取测试数据的第二分类信息之前,所述计算机可读指令经配置由所述一个或多个处理器执行以下操作:The apparatus of claim 11, wherein the computer readable instructions are configured by the one or more processors to perform the following operations prior to acquiring the second classification information of the test data:
    接收所述测试数据;Receiving the test data;
    确定所述测试数据的运动矢量信息,根据所述运动矢量确定所述测试数据中每帧画面对应的运动参数;Determining motion vector information of the test data, and determining, according to the motion vector, a motion parameter corresponding to each frame of the test data;
    根据所述运动参数,确定所述测试数据的每帧画面对应的第一分类信息;Determining, according to the motion parameter, first classification information corresponding to each frame of the test data;
    根据所述第一分类信息,并基于预设公式计算出所述测试数据的分类参数;Calculating, according to the first classification information, a classification parameter of the test data according to a preset formula;
    根据所述分类参数,确定所述测试数据的第二分类信息。Determining, according to the classification parameter, second classification information of the test data.
  13. 根据权利要求11所述的装置,其中,所述计算机可读指令经配置由所述一个或多个处理器执行以下操作:The apparatus of claim 11 wherein the computer readable instructions are configured by the one or more processors to:
    计算出所述测试数据在各第一预设转码路数下进行转码时,所述转码设备的超载率和最大卡顿率;Calculating an overload rate and a maximum carding rate of the transcoding device when the test data is transcoded under each of the first preset transcoding lines;
    确定所述超载率和所述最大卡顿率分别小于预设超载率和预设 最大卡顿率时对应的一个或多个第二预设转码路数;Determining, according to the preset overload rate and the preset maximum jam ratio, the one or more second preset transcoding channels;
    将所述一个或多个第二预设转码路数中的最大值作为所述最大转码路数。The maximum value of the one or more second preset transcoding paths is used as the maximum number of transcoding paths.
  14. 根据权利要求13所述的装置,其中,所述计算机可读指令经配置由所述一个或多个处理器执行以下操作:The apparatus of claim 13 wherein the computer readable instructions are configured by the one or more processors to:
    在所述测试数据在当前第一预设转码路数下进行转码时,基于预设周期采集第一采集次数的所述转码设备的负载率;When the test data is transcoded under the current first preset transcoding path, the load rate of the transcoding device of the first collection number is collected based on the preset period;
    在所述第一采集次数的负载率中,确定负载率大于预设负载率阈值的负载率的第二采集次数;Determining, in the load ratio of the first collection times, a second collection number of load ratios whose load ratio is greater than a preset load rate threshold;
    计算所述第二采集次数和所述第一采集次数之间的第一比值,并以所述第一比值作为当前第一预设转码路数下所述转码设备的超载率。Calculating a first ratio between the second collection number and the first collection number, and using the first ratio as the overload rate of the transcoding device under the current first preset transcoding path.
  15. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的方法中的步骤。A computer readable storage medium having stored thereon a computer program, wherein the computer program is executed by a processor to perform the steps of the method of any one of claims 1 to 7.
PCT/CN2018/083501 2017-04-19 2018-04-18 Data processing method and device and storage medium WO2018192518A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710258739.6 2017-04-19
CN201710258739.6A CN108737831B (en) 2017-04-19 2017-04-19 Data processing method and device

Publications (1)

Publication Number Publication Date
WO2018192518A1 true WO2018192518A1 (en) 2018-10-25

Family

ID=63856503

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/083501 WO2018192518A1 (en) 2017-04-19 2018-04-18 Data processing method and device and storage medium

Country Status (2)

Country Link
CN (1) CN108737831B (en)
WO (1) WO2018192518A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110677653A (en) * 2019-09-27 2020-01-10 腾讯科技(深圳)有限公司 Video encoding and decoding method and device and storage medium
CN115589489A (en) * 2022-10-19 2023-01-10 抖音视界有限公司 Video transcoding method, device, equipment, storage medium and video on demand system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404767A (en) * 2008-11-24 2009-04-08 崔天龙 Parameter-variable automated video transcoding method based on image analysis and artificial intelligence
CN101583036A (en) * 2009-06-22 2009-11-18 浙江大学 Method for determining the relation between movement characteristics and high efficient coding mode in pixel-domain video transcoding
US20110002382A1 (en) * 2009-07-02 2011-01-06 Takahiro Takimoto Moving image encoding apparatus, moving image encoding method, and video device
CN103686206A (en) * 2014-01-02 2014-03-26 中安消技术有限公司 Video transcoding method and system in cloud environment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001061153A (en) * 1999-08-24 2001-03-06 Denso Corp Dynamic image coder
CN101459848B (en) * 2008-12-26 2010-11-10 西安交通大学 Distributed multi-format digital video transcoding construction design method
CN101583037A (en) * 2009-06-22 2009-11-18 浙江大学 Method for designing pixel-domain video transcoding structure by utilizing movement characteristics
US9973767B2 (en) * 2014-09-05 2018-05-15 Arris Enterprises Llc Adaptive bit rate co-operative transcoding
CN104602018B (en) * 2014-10-21 2018-09-18 腾讯科技(北京)有限公司 The acquisition methods and device of the movable information of video data, coding method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404767A (en) * 2008-11-24 2009-04-08 崔天龙 Parameter-variable automated video transcoding method based on image analysis and artificial intelligence
CN101583036A (en) * 2009-06-22 2009-11-18 浙江大学 Method for determining the relation between movement characteristics and high efficient coding mode in pixel-domain video transcoding
US20110002382A1 (en) * 2009-07-02 2011-01-06 Takahiro Takimoto Moving image encoding apparatus, moving image encoding method, and video device
CN103686206A (en) * 2014-01-02 2014-03-26 中安消技术有限公司 Video transcoding method and system in cloud environment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110677653A (en) * 2019-09-27 2020-01-10 腾讯科技(深圳)有限公司 Video encoding and decoding method and device and storage medium
CN110677653B (en) * 2019-09-27 2024-01-09 腾讯科技(深圳)有限公司 Video encoding and decoding method and device and storage medium
US11979577B2 (en) 2019-09-27 2024-05-07 Tencent Technology (Shenzhen) Company Limited Video encoding method, video decoding method, and related apparatuses
CN115589489A (en) * 2022-10-19 2023-01-10 抖音视界有限公司 Video transcoding method, device, equipment, storage medium and video on demand system
CN115589489B (en) * 2022-10-19 2024-04-19 抖音视界有限公司 Video transcoding method, device, equipment, storage medium and video on demand system

Also Published As

Publication number Publication date
CN108737831A (en) 2018-11-02
CN108737831B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
JP6472872B2 (en) Real time video summary
US10601891B2 (en) Cloud streaming service system and cloud streaming service method for utilizing an optimal GPU for video decoding based on resource conditions, and apparatus for the same
JP6109956B2 (en) Utilize encoder hardware to pre-process video content
WO2019001006A1 (en) Method and device for encoding and decoding image data
CN107454446A (en) Video frame management method and its device based on Quality of experience analysis
KR101643026B1 (en) Method and device for calculating blur in video images
CN104469398B (en) A kind of Internet video picture processing method and device
CN106961603A (en) Intracoded frame code rate allocation method and device
WO2023005140A1 (en) Video data processing method, apparatus, device, and storage medium
CN108156459A (en) Telescopic video transmission method and system
KR20130115341A (en) Method and apparatus for providing a mechanism for gesture recognition
Zeng et al. 3D-SSIM for video quality assessment
WO2023134523A1 (en) Content adaptive video coding method and apparatus, device and storage medium
WO2018192518A1 (en) Data processing method and device and storage medium
CA3182110A1 (en) Reinforcement learning based rate control
CN103929640A (en) Techniques For Managing Video Streaming
CN105208388A (en) Method and system for dynamically adjusting encoding frame rate in video communication
CN112104867B (en) Video processing method, video processing device, intelligent equipment and storage medium
US20140099039A1 (en) Image processing device, image processing method, and image processing system
CN114945097B (en) Video stream processing method and device
US20230018087A1 (en) Data coding method and apparatus, and computer-readable storage medium
CN116980662A (en) Streaming media playing method, streaming media playing device, electronic equipment, storage medium and program product
CN107547913B (en) Video data playing and processing method, client and equipment
CN106254873B (en) Video coding method and video coding device
US11880966B2 (en) Image quality assessment apparatus and image quality assessment method thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18787171

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18787171

Country of ref document: EP

Kind code of ref document: A1