Movatterモバイル変換


[0]ホーム

URL:


CN112312135A - Video publishing method and device, computer equipment and storage medium - Google Patents

Video publishing method and device, computer equipment and storage medium
Download PDF

Info

Publication number
CN112312135A
CN112312135ACN202011148247.XACN202011148247ACN112312135ACN 112312135 ACN112312135 ACN 112312135ACN 202011148247 ACN202011148247 ACN 202011148247ACN 112312135 ACN112312135 ACN 112312135A
Authority
CN
China
Prior art keywords
video
coding
time
information
encoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011148247.XA
Other languages
Chinese (zh)
Other versions
CN112312135B (en
Inventor
王新宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Baiguoyuan Network Technology Co Ltd
Original Assignee
Guangzhou Baiguoyuan Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Baiguoyuan Network Technology Co LtdfiledCriticalGuangzhou Baiguoyuan Network Technology Co Ltd
Priority to CN202011148247.XApriorityCriticalpatent/CN112312135B/en
Publication of CN112312135ApublicationCriticalpatent/CN112312135A/en
Application grantedgrantedCritical
Publication of CN112312135BpublicationCriticalpatent/CN112312135B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention discloses a video publishing method, a video publishing device, computer equipment and a storage medium. The method comprises the following steps: acquiring image attribute information of a video to be released, and determining target coding information from coding information of each alternative coding parameter according to the image attribute information; predicting the release time of a coded file obtained by coding a video to be released by adopting each alternative coding parameter according to the current network state information and the target coding information; and determining target coding parameters from the alternative coding parameters according to the release time, coding the video to be released by adopting the target coding parameters to obtain a coding file, uploading the coding file, flexibly selecting the coding parameters according to the network state and the image attribute information, and coding the video to be released by adopting the selected target coding parameters, thereby achieving the effect of shortening the video release time on the basis of ensuring the picture quality and avoiding the problem of prolonging the video release time due to longer video uploading time or longer video generation time.

Description

Video publishing method and device, computer equipment and storage medium
Technical Field
The present invention relates to image processing technologies, and in particular, to a video distribution method and apparatus, a computer device, and a storage medium.
Background
Generally, before uploading a video file, a video file in an original video format needs to be converted into a video file in another video format through an encoding mode.
Currently, the mainstream coding methods include a hard coding method and a soft coding method. The hard coding scheme is a coding scheme that performs coding using a non-CPU. The soft coding scheme is a coding scheme for coding using a CPU. The two encoding modes have respective advantages. For example, the hard coding method has an advantage of faster coding speed. The soft coding mode has the advantages of saving video code rate as much as possible and reducing file data volume under the condition of keeping the picture quality basically unchanged.
However, the above encoding method has the problem of long video uploading time or long video generating time, which results in long video publishing time and poor user experience.
Disclosure of Invention
The embodiment of the invention provides a video distribution method, a video distribution device, computer equipment and a storage medium, which can shorten video distribution time.
In a first aspect, an embodiment of the present invention provides a video publishing method, including:
acquiring image attribute information of a video to be released, and determining target coding information from coding information of each alternative coding parameter according to the image attribute information;
predicting the release time of the coded file obtained by coding the video to be released by adopting each alternative coding parameter according to the current network state information and the target coding information;
and determining target coding parameters from the alternative coding parameters according to the release time, coding the video to be released by adopting the target coding parameters to obtain a coded file, and uploading the coded file.
In a second aspect, an embodiment of the present invention further provides a video distribution apparatus, including:
the information acquisition module is used for acquiring image attribute information of a video to be published and determining target coding information from coding information of each alternative coding parameter according to the image attribute information;
the time prediction module is used for predicting the release time of the coded file obtained by coding the video to be released by adopting each alternative coding parameter according to the current network state information and the target coding information;
and the video publishing module is used for determining target coding parameters from the alternative coding parameters according to the publishing time, coding the video to be published by adopting the target coding parameters to obtain a coding file, and uploading the coding file.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a video distribution method as in any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, on which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the method for distributing video according to any embodiment of the present invention is implemented.
The embodiment of the invention provides a video publishing method, a device, computer equipment and a storage medium, which can realize the flexible selection of coding parameters according to the network state and the image attribute information and the coding of videos to be published by adopting the selected target coding parameters, thereby achieving the effect of shortening the video publishing time on the basis of ensuring the picture quality and avoiding the occurrence of long video uploading time, long video uploading time and the like by obtaining the target coding information matched with the image attribute information of the videos to be published in the coding information of each candidate coding parameter, predicting the publishing time of the coding file obtained by coding the videos to be published by adopting each candidate coding parameter according to the current network state information and the target coding information, determining the target coding parameter from the candidate coding parameters according to the publishing time, coding the videos to be published by adopting the target coding parameter to obtain the coding file and uploading the coding file Or a problem that the video generation time is long to extend the video distribution time.
Drawings
Fig. 1 is a flowchart of a video publishing method according to an embodiment of the present invention;
fig. 2 is a flowchart of another video distribution method according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a flow of generating an information table in a video publishing method according to an embodiment of the present invention;
fig. 4 is a flowchart of another video distribution method according to an embodiment of the present invention;
fig. 5 is a flowchart of another video distribution method according to an embodiment of the present invention;
fig. 6 is a block diagram of a video distribution apparatus according to an embodiment of the present invention;
fig. 7 is a block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a flowchart of a video distribution method according to an embodiment of the present invention, which may be executed by a video distribution apparatus, which may be implemented by software and/or hardware and is generally configured in a computer device. As shown in fig. 1, the method includes:
andstep 110, acquiring image attribute information of the video to be released, and determining target coding information from the coding information of each alternative coding parameter according to the image attribute information.
In the embodiment of the present invention, the computer device may be a terminal device having a network module. For example, the computer device may be a terminal device such as a smartphone, a tablet computer, and a notebook computer. The computer equipment is provided with a client, and the functions of video browsing, video preparation and video publishing are realized through the client. The client can acquire the video resource from the server and can also upload the video resource to the server.
It should be noted that the video to be published is a video prepared by the user and to be uploaded to the server. The alternative encoding parameters are several sets of encoding parameters preset in the client. For example, the candidate encoding parameters may be preset parameters (preset parameters) in a set video encoding mode, and may include several sets of parameters with encoding speeds from fast to slow in the following types: "ultrasast", "superfast", "veryfast", "fast", "medium", and "slow", etc. It should be noted that the types of the alternative coding parameters are not limited to the examples listed above, and may also include "slower", "veryslow", and the like, and the embodiments of the present invention are not particularly limited. The set video encoding method may be x264 or x265, and the embodiment of the present invention is not limited in particular.
The coding information is related information obtained by coding the test video by adopting each alternative coding parameter. Specifically, the encoding information may include image attribute information, alternative encoding parameter types, encoding time, video rate, and the like. The image attribute information may be a resolution and/or a picture complexity of the test video. Optionally, the encoding information may include resolution, video name, picture complexity, type of the candidate encoding parameter, encoding time and video rate obtained by encoding the test video by the candidate encoding parameter. Or, the encoding information may include resolution, video name, type of the candidate encoding parameter, encoding time and video rate obtained by encoding the test video by the candidate encoding parameter. It should be noted that the encoded information is not limited to the above-listed items, and may be other information, and the prediction is more accurate as the information dimension is higher. The test video can be built in the client side or issued by the server.
It should be noted that the image attribute information is information related to the picture display quality in the attribute information of the video to be distributed. For example, the image attribute information may include picture complexity and/or resolution, etc.
And when the image attribute information is the resolution, acquiring the resolution from the attribute information of the video to be distributed. Because the user sets the resolution of the video to be published when preparing the video, the resolution can be directly obtained from the attribute information of the video to be published.
And when the image attribute information is the picture complexity, acquiring a set number of video frames in the video to be released, and encoding the video frames by adopting the alternative encoding parameters corresponding to the preset compression rate. Calculating the peak signal-to-noise ratio of each video frame according to the image data before and after the coding of each video frame; determining a reference peak signal-to-noise ratio of a video to be released according to the peak signal-to-noise ratios of a set number of video frames; and adjusting the value range of the reference peak signal-to-noise ratio based on the value range of the picture complexity in the coding information of each candidate coding parameter to obtain the picture complexity of the video to be released.
For example, 10 frames of video frames are randomly selected from a video to be distributed, the selected video frames are encoded by using an x264 encoding method and using an alternative encoding parameter with a compression rate crf equal to 20, and a 10-frame compressed image is obtained. The peak signal-to-noise ratio psnr of each video frame is calculated based on the image before encoding of each video frame and the corresponding compressed image. And calculating the average value of the psnr of each video frame, and taking the average value as the peak signal-to-noise ratio of the video to be released. And mapping the peak signal-to-noise ratio of the video to be released in order to make the picture complexity of the video to be released consistent with the value range of the picture complexity corresponding to each alternative coding parameter. Optionally, the mapping processing method may be to divide the peak signal-to-noise ratio of the video to be distributed by the maximum value of the picture complexity corresponding to each candidate encoding parameter to obtain the peak signal-to-noise ratio after the mapping processing. And taking the peak signal-to-noise ratio after the mapping processing as the picture complexity of the video to be released. Note that a smaller peak signal-to-noise ratio after the mapping process indicates a higher picture complexity.
And storing the resolution, the picture complexity and the alternative coding parameter types of the test videos in an associated manner, and determining the coding time and the video code rate after coding the test videos by adopting the alternative coding parameters. For example, the association relationship among the resolution, the picture complexity, the candidate encoding parameter type, the encoding time and the video rate may be stored in a json file. Or storing the incidence relation among the resolution, the picture complexity, the alternative coding parameter types, the coding time and the video code rate in an information table mode. It should be noted that, in the embodiment of the present invention, a specific storage manner of the association relationship between the resolution, the picture complexity, the type of the candidate coding parameter, the coding time, and the video bitrate is not specifically limited.
Illustratively, the resolution and/or the picture complexity of the video to be distributed are obtained and used as image attribute information of the video to be distributed, and the encoding information of each candidate encoding parameter is inquired according to the image attribute information to obtain target encoding information in the encoding information of each candidate encoding parameter. Specifically, the resolution of the video to be released is obtained, and the coding information of each candidate coding parameter is queried according to the resolution, so that the target coding information of each candidate coding parameter matched with the resolution in the coding information is obtained. It should be noted that the target encoding information includes encoding time and video code rate corresponding to each candidate encoding parameter type, where the encoding time is determined based on encoding a test video having the same resolution (the picture complexity may be the same or different) as the video to be released by using each candidate encoding parameter. The video code rate is determined based on encoding a test video with the same resolution (picture complexity may be the same or different) as the video to be released by using each alternative encoding parameter.
Optionally, the picture complexity of the video to be released may be obtained, and the coding information of each candidate coding parameter is queried according to the picture complexity to obtain the target coding information in the coding information of each candidate coding parameter, which is similar to the process of querying the coding information based on the resolution, and is not described here again.
In order to reduce the data amount of the subsequent distribution time prediction, the encoding information of each candidate encoding parameter can be inquired based on two dimensions of resolution and picture complexity. Specifically, according to the picture complexity and the resolution of the video to be released, the coding information of each alternative coding parameter is inquired, and the target picture complexity and the target resolution, of which the deviations from the picture complexity and the resolution are smaller than a set threshold value, are obtained; and acquiring target coding information corresponding to the target picture complexity and the target resolution in the coding information. Because the coding information contains the incidence relation of resolution, picture complexity, alternative coding parameter types, coding time and video code rate, each alternative coding parameter type, corresponding coding time and video code rate can be accurately positioned based on the target resolution and the target picture complexity.
And step 120, predicting the release time of the coded file obtained by coding the video to be released by adopting each alternative coding parameter according to the current network state information and the target coding information.
It should be noted that the current network state information is information indicating a data transmission state of the network where the client is located. For example, the network status information may be wire speed. Specifically, the network status information may be a data upload speed and/or a data download speed, and the like.
In the embodiment of the present invention, the release time may include video encoding file generation time and encoding file uploading time. The predicting of the release time of the coded file obtained by coding the video to be released by using the alternative coding parameters specifically includes: and predicting the encoding time of the video to be published by using the alternative encoding parameters, and predicting the uploading time of the encoded file obtained by encoding the video to be published by using the alternative encoding parameters. And calculating the release time of the coded file obtained by coding the video to be released by adopting each alternative coding parameter according to the coding time and the uploading time corresponding to each alternative coding parameter.
For example, predicting the encoding time for encoding the video to be distributed with the alternative encoding parameters may include: and taking the coding time included in the target coding information corresponding to each alternative coding parameter as the coding time for coding the video to be released by adopting each alternative coding parameter.
Predicting the uploading time of the encoded file obtained by encoding the video to be published by using the alternative encoding parameters may include: and predicting the uploading time of the coded file obtained by coding the video to be released by adopting each alternative coding parameter according to the current network state information and the video code rate corresponding to each alternative coding parameter. Specifically, the data size of the encoded file (e.g., the file size of the encoded file) obtained by encoding the video to be distributed with each candidate encoding parameter is determined according to the video code rate corresponding to each candidate encoding parameter and the duration of the video to be distributed. And predicting the uploading time of the coded file obtained by coding the video to be published by adopting each alternative coding parameter according to the data volume and the current network state information. Because the video code rate is the number of data bits transmitted per second during video transmission, the multiplication result of the video code rate and the video duration can be calculated, and the multiplication result is taken as the file size, namely the data volume of the encoded file. Because the network state information can be the network speed, namely the data volume which can be transmitted per second, the data volume and the division operation result of the current network speed are calculated, and the division operation result is used as the uploading time of the coding file obtained by coding the video to be released by each alternative coding parameter.
And calculating the time sum of the encoding time and the uploading time corresponding to each alternative encoding parameter, and using the time sum as the distribution time of the encoding file obtained by encoding the video to be distributed by using each alternative encoding parameter.
Step 130, determining target coding parameters from the candidate coding parameters according to the release time, coding the video to be released by using the target coding parameters to obtain a coded file, and uploading the coded file.
It should be noted that the target encoding parameter is an encoding parameter actually used to encode the video to be distributed.
Specifically, the candidate encoding parameters are sorted according to the release time, and the target encoding parameters meeting the preset requirements are selected from the candidate parameters according to the sorting result. The preset requirement can be set according to the actual application scene. For example, the preset requirement may be that the publication time is the shortest. Alternatively, the preset requirement may be a user specification, etc. A plurality of times with the minimum release time can be selected, each time corresponds to one option, the options are displayed on a client interface, a user can select which speed to upload the video, man-machine interaction is enhanced, and interestingness of video release is increased. For example, assuming that there are two publication times, the smallest one corresponds to the fast upload option, and the other corresponds to the normal speed upload option. There may also be three options, for example: the fast uploading option, the normal speed uploading option and the slow uploading option respectively correspond to three times with the minimum release time. The number of options is not particularly limited in the embodiment of the present invention.
Alternatively, in order to reduce the video distribution time as much as possible, the distribution times corresponding to the candidate encoding parameters may be compared, and one candidate encoding parameter with the shortest distribution time may be selected from the candidate encoding parameters as the target encoding parameter based on the comparison result.
And the client uploads the coded file to the server to complete the publishing operation of the video to be published.
In the technical scheme of the embodiment, by acquiring the target coding information matched with the image attribute information of the video to be distributed in the coding information of each candidate coding parameter, predicting the distribution time of the coded file obtained by coding the video to be distributed by adopting each alternative coding parameter according to the current network state information and the target coding information, selecting target coding parameters from the alternative coding parameters according to the release time, coding the video to be released by adopting the target coding parameters to obtain a coding file and uploading the coding file, the method can flexibly select the coding parameters according to the network state and the image attribute information, and codes the video to be published by adopting the selected target coding parameters, thereby shortening the video publishing time on the basis of ensuring the picture quality and avoiding the problem of prolonging the video publishing time due to longer video uploading time or longer video generating time.
Fig. 2 is a flowchart of another video publishing method according to an embodiment of the present invention, and this embodiment further illustrates a step of generating an information table of each candidate encoding parameter before the step of acquiring image attribute information of a video to be published based on the above embodiment. As shown in fig. 2, the method includes:
and step 210, encoding the test video by adopting each alternative encoding parameter.
Specifically, the client includes several sets of preconfigured encoding parameters, for example, the alternative encoding parameters may include the following several types of encoding parameters: "ultrasast", "superfast", "veryfast", "fast", "medium", and "slow", etc.
The test video may be a video file with different resolutions that is issued to the client by the server when the user uses the client for the first time and the use state of the client satisfies the set condition. The setting condition may be that it is detected that the display time of the client top page exceeds a set time length, and no other operation is detected by the client during the time period. Fig. 3 is a schematic diagram of an information table generation flow in a video publishing method according to an embodiment of the present invention. As shown in fig. 3, when the usage status of theclient 310 satisfies the set condition, theserver 320 issues several sets of test videos with different resolutions to theclient 310. Wherein each group of test videos comprises test videos with different resolutions and the same content. The test video is encoded using each candidate parameter to generate an information table 330 containing candidate encoding parameter types, resolution, picture complexity, encoding time, and video bit rate. For example, the resolution of the test video includes 400x720, 540x960, 720x1280 (the resolution is not limited to the above list and can be extended), that is, there is video 1 with resolution of 400x720, 540x960, 720x1280, video 2, … … with resolution of 400x720, 540x960, 720x1280, and video m with resolution of 400x720, 540x960, 720x1280, m being a positive integer.
Optionally, if the server monitors that the use state of the client meets the set condition and the network speed of the current client exceeds the set threshold, several groups of test videos with different resolutions are issued to the client. Optionally, if the server monitors the request information of the client requesting to play the video in the process of issuing the test video, the server records the current issuing progress, suspends issuing the test video, and switches to executing the request information requesting to play the video. Because the client executes the operation of playing the video, the test video which is already transmitted is not encoded temporarily. And when the client detects that the current use state meets the set conditions, encoding the received part of the test video. In addition, when the use state of the client is monitored to meet the set condition again, the test video is continuously issued according to the previously recorded issuing progress. After receiving the rest of the test videos, the client encodes the rest of the test videos by adopting the alternative encoding parameters if the use state of the client still meets the set conditions. Optionally, the already received part of the test video may also be encoded in case the computer device is idle. The idle time of the computer device may be a time period when the user does not use the computer device, or a time period when the screen is turned off to play music and other functions occupying less processing resources are operated.
Optionally, the client receives the test video and does not perform the encoding operation until detecting the delivery completion message sent by the server. And after the test video is distributed, the server sends a distribution completion message to the client. After detecting the message of completing the transmission, the client uses the preset alternative coding parameters to code the test video if the using state of the client meets the set conditions. And if the client is detected to no longer meet the set conditions in the process of encoding the test video, completing the encoding operation of the test video in the current encoding, and recording the encoding progress so as to continue to encode the rest test video according to the encoding progress when the use state of the client next time meets the set conditions.
Step 220, determining the encoding time consumption of each video frame in the encoding process of each test video, and calculating the encoding time of the corresponding test video according to the encoding time consumption.
Specifically, in the process of encoding each test video, the encoding time consumption of each video frame is counted, and the encoding time consumption of all the video frames of the test video is accumulated to obtain the encoding time of the test video.
And step 230, calculating the video code rate corresponding to each test video according to the data volume and the video duration of the coding file corresponding to each test video.
Specifically, the data volume of the coding file obtained by coding each test video by using each alternative coding parameter is obtained, and the ratio of the data volume of the coding file of each test video to the video duration is calculated to obtain the video code rate corresponding to each test video.
And 240, storing the resolution, the picture complexity, the alternative coding parameter types, the coding time and the video code rate of each test video in an associated manner to obtain an information table.
Specifically, the resolution and the picture complexity of each test video are determined according to the attribute information of each test video, and information such as the resolution, the picture complexity, the type of the alternative coding parameters, the coding time, the video code rate and the like is stored in an associated manner, so that an information table containing relevant coding result data of each alternative coding parameter is obtained.
Optionally, the video name may also be stored in association with the information table.
And step 250, acquiring image attribute information of the video to be released, and inquiring the information table according to the image attribute information to obtain target coding information in the coding information of each alternative coding parameter.
Illustratively, for a scenario where a user creates a short video through a client, a video publishing event is triggered when the client detects that an upload button is clicked. And under the condition that the video release event is triggered, the client acquires the image attribute information of the short video corresponding to the video release event. For example, the resolution of the short video is acquired. And randomly selecting a plurality of video frames in the short video, and calculating the picture complexity of the video to be released based on the plurality of video frames. Since the method for calculating the frame complexity of the video to be published has been described in detail in the above embodiments, it is not described herein again.
After the resolution and the picture complexity of the video to be published are obtained, the information table is inquired according to the resolution and the picture complexity respectively, and the target resolution and the target picture complexity, of which the deviations from the resolution and the picture complexity in the information table are smaller than a set threshold value, are obtained. The set threshold may be set manually, and is used to determine a target resolution closest to the resolution of the video to be distributed in the information table, and is also used to determine a target picture complexity closest to the picture complexity of the video to be distributed in the information table. And then, selecting target coding time and target video code rate corresponding to each alternative coding parameter from the information table according to the target resolution and the target picture complexity.
And step 260, predicting the release time of the coded file obtained by coding the video to be released by adopting each alternative coding parameter according to the current network state information and the target coding information.
And 270, determining target coding parameters from the candidate coding parameters according to the release time, coding the video to be released by using the target coding parameters to obtain a coded file, and uploading the coded file.
According to the technical scheme of the embodiment, the test video is encoded in advance through the alternative encoding parameters built in the client, the encoding time and the video code rate of each test video encoded by adopting each alternative encoding parameter are obtained, the resolution, the picture complexity, the alternative encoding parameter type, the encoding time and the video code rate of each test video are stored in an associated mode, and the information table is obtained. Therefore, when the actual video is released, the coding time and the video code rate corresponding to each alternative coding parameter can be matched from the information table according to the image attribute information of the video to be released, then, the uploading time corresponding to each alternative coding parameter is predicted according to the video code rate and the current network state, the releasing time is determined according to the coding time and the uploading time corresponding to each alternative coding parameter, the releasing time of the coding file obtained by coding various alternative coding parameters can be predicted before the video to be released is actually coded, therefore, the target coding parameter with the minimum releasing time can be quickly selected from the alternative coding parameters, the coding file obtained by coding the time to be released by adopting the target coding parameter can be uploaded, the time consumption for releasing the video can be reduced, further, the user experience can be improved, and the enthusiasm of the video of a user can be stimulated, the user viscosity of the client is improved.
Fig. 4 is a flowchart of another video publishing method according to an embodiment of the present invention, where on the basis of the foregoing embodiment, after the step of obtaining an encoded file by encoding the video to be published by using the target encoding parameter, the present embodiment adds a step of updating an information table. As shown in fig. 4, the method includes:
step 401, encoding the test video by using each candidate encoding parameter.
Step 402, determining the coding time consumption of each video frame in the coding process of each test video, and calculating the coding time of the corresponding test video according to the coding time consumption.
And 403, calculating the video code rate corresponding to each test video according to the data volume and the video duration of the coding file corresponding to each test video.
And step 404, storing the resolution, the picture complexity, the alternative coding parameter types, the coding time and the video code rate of each test video in an associated manner to obtain an information table.
Step 405, obtaining image attribute information of the video to be released, and querying the information table according to the image attribute information to obtain target coding information in the coding information of each candidate coding parameter.
And 406, predicting the release time of the coded file obtained by coding the video to be released by adopting each alternative coding parameter according to the current network state information and the target coding information.
Step 407, determining target coding parameters from the candidate coding parameters according to the release time, and coding the video to be released by using the target coding parameters to obtain a coded file.
And step 408, acquiring the actual encoding time for encoding the video to be issued by adopting the target encoding parameter.
Specifically, in the process of encoding the video to be distributed by adopting the target encoding parameters, the encoding time consumption of each video frame is counted, the addition operation result of the encoding time consumption of all the video frames included in the video to be distributed is calculated, and the addition operation result is used as the actual encoding time of the video to be distributed.
Step 409, calculating the actual video code rate corresponding to the video to be published according to the data volume and the video duration of the coding file corresponding to the video to be published.
Specifically, the data volume of a coding file obtained by coding a video to be distributed by adopting a target coding parameter is obtained, the division result of the data volume and the video time length is calculated, and the division result is used as the actual video code rate of the video to be distributed.
And step 410, generating a coding information record according to the actual coding time, the resolution of the video to be published, the picture complexity of the video to be published, the actual video code rate and the target coding parameter type, and adding the coding information record to the information table.
Specifically, a piece of coding information record is generated based on information such as actual coding time, resolution of a video to be published, picture complexity, actual code rate, target coding parameter type and the like, and the coding information record is added to a pre-generated information table so as to increase complexity and accuracy of the information table.
According to the technical scheme of the embodiment, after the video to be distributed is coded by adopting the target coding parameters to obtain the coded file, the actual coding time and the data volume of the coded file are obtained, the actual video code rate is calculated according to the data volume and the video duration, the coded record is generated based on the actual coding time, the resolution of the video to be distributed, the picture complexity, the actual video code rate and the target coding parameter type, and the newly generated coded record is added into the pre-generated information table, so that the complexity and the accuracy of the information table are increased, and more accurate information can be provided for the prediction operation of the next video distribution.
Fig. 5 is a flowchart of another video distribution method according to an embodiment of the present invention, where the embodiment of the present invention is based on the foregoing embodiment, and the video distribution method according to the present invention is described by taking a specific application scenario as an example. As shown in fig. 5, theclient 510 includes the following functional modules: adetection module 511, anencoding module 512, adecision module 513 and anetwork module 514, and theclient 510 is communicatively connected with theserver 520. Wherein,
thedetection module 511 is configured to maintain information such as video resolution, picture complexity, encoding time, and video code rate corresponding to each group of encoding parameters (the information may be more than this, and the higher the dimensionality of the information is, the more accurate the prediction of which encoding parameter is used is). Under the condition that the user uses the client for the first time and the user is idle, the server issues a plurality of groups of test videos with resolution, thedetection module 511 uses an x264 coding mode to code the test videos by adopting various alternative coding parameters, and coding time and video code rate corresponding to the various alternative coding parameters are obtained. The idle time of the user means that the user opens the client but stays in the time period of the client top page without other operations. And based on the resolution, the picture complexity, the alternative coding parameters, the coding time and the video code rate of each test video, preliminarily establishing an information table containing the resolution, the picture complexity, the alternative coding parameters, the coding time and the video code rate of each test video. In addition, after the user releases the video each time, theencoding module 512 sends the resolution, the picture complexity, the actually adopted encoding parameters, the actually adopted encoding time and the actually adopted video bitrate of the video in the video release to the detectingmodule 511. Thedetection module 511 generates the encoded information record of the video release according to the resolution, the picture complexity, the actually adopted encoding parameters, the actually adopted encoding time and the actually adopted video code rate transmitted by theencoding module 512, and adds the encoded information record of the video release to the information table.
Theencoding module 512 is configured to predict the picture complexity of the video to be published, and encode the video to be published by using the target encoding parameter determined by thedecision module 513. When a user releases a video, theencoding module 512 first predicts the picture complexity of the video, and the prediction method of the picture complexity is described in the above embodiments and is not described herein again. Theencoding module 512 sends the resolution and the picture complexity of the video to be distributed to thedetection module 511. Thedetection module 511 queries the information table according to the resolution and the picture complexity, obtains the encoding time and the video code rate corresponding to each candidate encoding parameter that is closest to the detection module, and sends the encoding time and the video code rate corresponding to each candidate encoding parameter to theencoding module 512. Theencoding module 512 receives the encoding time and the video code rate corresponding to each candidate encoding parameter, and calculates the file size corresponding to each candidate encoding parameter according to the video time length and the video code rate of the video to be released. Theencoding module 512 transmits the encoding time and the file size corresponding to each candidate encoding parameter to thedecision module 513. In addition, after the target coding parameter selected by thedecision module 513 is obtained, thecoding module 511 codes the video to be distributed by using the target coding parameter to obtain a coding file, and sends the coding file to thenetwork module 514.
Adecision module 513 is configured to select an appropriate target coding parameter from the candidate coding parameters. When receiving the encoding time and the file size of each candidate encoding parameter sent by theencoding module 511, thedecision module 513 notifies thenetwork module 514 to obtain the current network state information, and receives the network state information sent by thenetwork module 514. Thedecision module 513 estimates a time T for possible uploading of the currently uploaded video according to the network state information1According to the estimated uploading time T1And a coding time T2Counting the total release time T ═ T1+T2. Thedecision module 513 selects the candidate coding parameter corresponding to the minimum release time, which is the target coding parameter. Thedecision module 513 informs theencoding module 512 to use the target encoding parameters for the actual video encoding operation.
And thenetwork module 514 is used for detecting the current network state and uploading the video coding file. Thenetwork module 514 receives the network state detection notification sent by thedecision module 513, and detects the current network state based on the network state detection notification. Thenetwork module 514 also obtains the encoded file sent by theencoding module 512, and uploads the encoded file to theserver 520.
Illustratively, the video distribution method includes the steps of:
and S1, sending the video to be distributed to the coding module.
And S2, the encoding module sends a query message to the detection module to query the encoding time and the video code rate under each group of the alternative encoding parameters.
And S3, the encoding module transmits the predicted encoding time and file size under each group of candidate encoding parameters to the decision module.
And S4, the decision module knows that the network module acquires the current network state.
And S5, the decision module informs the coding module to use the selected coding parameters.
And S6, the coding module transmits the coded file to the network module.
And S7, uploading the code file to the server by the network module.
And S8, sending the information of the encoding time, the corresponding resolution, the picture complexity and the like to the detection module, so that the detection module updates the information into the information table.
Specifically, the client side adopts a mode of combining the set compression rate crf and the maximum code rate, so that the quality of the generated video can be basically ensured not to be obviously changed. The meaning of the combination of the set compression rate crf and the maximum code rate is that the compression rate is set artificially, and the video code rate of the coded file obtained by coding the video to be released by adopting the coding parameters corresponding to the set compression rate cannot exceed the preset maximum code rate. Several groups of encoding parameters are configured in the client in advance as alternative encoding parameters, and are roughly divided into several groups of 'ultra fast', 'super fast', 'veryfast', 'fast', 'medium' and 'slow'. In the embodiment of the present invention, the candidate encoding parameters are not limited to the above groups, and may be expanded. And when the user is idle, the detection module respectively uses the groups of alternative coding parameters to code the test video to obtain the coding time and the video code rate of the test video with each resolution and picture complexity coded by each alternative coding parameter. The resolution of the test video mainly includes 400x720, 540x960, 720x1280, wherein the resolution is not limited to the above-mentioned ones, and the resolution can be extended. The test video can have more than one dimension of resolution, including picture complexity and the like, and the increase of the dimension is beneficial to reducing the selection range of the target coding parameter in the alternative coding parameters, so that the prediction accuracy of the coding parameters is improved. And generating an information table by using the picture complexity of the test video with the corresponding resolution, the coding time, the video code rate and other information corresponding to each alternative coding parameter, and storing the information table in a local file.
When a user releases a video, the coding module can estimate the complexity of the picture of the video to be released, which is released by the user. The coding module obtains the resolution of the video to be released, sends the resolution and the picture complexity to the detection module, and estimates the information such as coding time, video code rate and the like by inquiring an information table of the detection module. For example, the detection module receives the resolution and the picture complexity, queries the information table based on the resolution and the picture complexity, obtains the coding time and the video code rate corresponding to each candidate coding parameter, and sends the coding time and the video code rate corresponding to each candidate coding parameter to the coding module. And the coding module calculates the file size of the coding file of the video to be released based on the video code rate corresponding to each alternative coding parameter and the video duration of the video to be released. And the coding module transmits the coding time and the file size corresponding to each candidate coding parameter to the decision module. And after the decision module receives the coding time and the file size corresponding to each candidate coding parameter, the decision module informs a network module to acquire the current network state information. The network module will detect the current network of the user and send the current network state information to the decision module. And the decision module calculates the uploading time corresponding to each alternative coding parameter according to the file size and the current network state information. And the decision module selects a proper target coding parameter from the alternative coding parameters according to the coding time and the uploading time. And the decision module informs the coding module to code the video to be published by using the selected target coding parameters. And after receiving the notification sent by the decision module, the encoding module encodes the video to be issued by adopting the target encoding parameters indicated in the notification. And after the coding is finished, sending the coding file to the network module. And the network module uploads the encoded file to a server.
The embodiment of the invention can self-adaptively adjust the coding parameters according to the current network state. When the network speed is high, the coding time occupies a large proportion in the whole video release time, and the coding time is saved by using a parameter with low coding complexity; when the network speed is low, the uploading time occupies a large proportion in the whole video publishing time, parameters with high coding complexity are used, the uploading time is saved, the selection of proper coding parameters is realized, and the total time of the video coding time and the uploading time is reduced as much as possible under the condition of keeping the video quality unchanged basically.
Fig. 6 is a block diagram of a video distribution apparatus according to an embodiment of the present invention. The device can be realized by software and/or hardware, can be generally integrated in computer equipment, and can reduce the video distribution time by executing the video distribution method provided by the invention. As shown in fig. 6, the apparatus includes:
theinformation obtaining module 610 is configured to obtain image attribute information of a video to be published, and determine target coding information from coding information of each candidate coding parameter according to the image attribute information;
atime prediction module 620, configured to predict, according to the current network state information and the target coding information, a release time of a coding file obtained by coding the video to be released by using each alternative coding parameter;
thevideo publishing module 630 is configured to determine a target coding parameter from the candidate coding parameters according to the publishing time, code the video to be published by using the target coding parameter to obtain a coded file, and upload the coded file.
The video publishing device provided by the embodiment of the invention obtains the target coding information matched with the image attribute information of the video to be published in the coding information of each alternative coding parameter, predicting the release time of the coded file obtained by coding the video to be released by adopting each alternative coding parameter according to the current network state information and the target coding information, selecting target coding parameters meeting preset requirements from the alternative coding parameters according to the release time, coding the video to be released by adopting the target coding parameters to obtain a coding file and uploading the coding file, the method can flexibly select the coding parameters according to the network state and the image attribute information, and codes the video to be distributed by adopting the selected target coding parameters, thereby shortening the video distribution time on the basis of ensuring the picture quality and avoiding the problem of prolonging the video distribution time due to longer video uploading time or longer video generating time.
It should be noted that, in the embodiment of the video distribution apparatus, the units and modules included in the embodiment are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
The embodiment of the invention provides computer equipment, and the video distribution device provided by the embodiment of the invention can be integrated in the computer equipment. The computer device includes one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the network resource to be recommended provided by the embodiment of the invention. Fig. 7 is a block diagram of a computer device according to an embodiment of the present invention. In fig. 7, a processor is taken as an example, thecomputer device 700 includes aprocessor 710 and amemory 720, theprocessor 710 and thememory 720 are connected by a bus or other means, and fig. 7 is taken as an example of the connection by the bus.
Embodiments of the present invention further provide a computer-readable storage medium, on which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the method for issuing a video according to any embodiment of the present invention is implemented.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (13)

CN202011148247.XA2020-10-232020-10-23Video publishing method and device, computer equipment and storage mediumActiveCN112312135B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011148247.XACN112312135B (en)2020-10-232020-10-23Video publishing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011148247.XACN112312135B (en)2020-10-232020-10-23Video publishing method and device, computer equipment and storage medium

Publications (2)

Publication NumberPublication Date
CN112312135Atrue CN112312135A (en)2021-02-02
CN112312135B CN112312135B (en)2022-07-15

Family

ID=74327499

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011148247.XAActiveCN112312135B (en)2020-10-232020-10-23Video publishing method and device, computer equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN112312135B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113099216A (en)*2021-03-262021-07-09北京百度网讯科技有限公司Coding complexity evaluation method, device, equipment and storage medium
CN113382258A (en)*2021-06-102021-09-10北京百度网讯科技有限公司Video encoding method, apparatus, device, and medium
CN113766230A (en)*2021-11-042021-12-07广州易方信息科技股份有限公司Media file encoding method and device, computer equipment and storage medium
CN114650437A (en)*2022-03-142022-06-21百果园技术(新加坡)有限公司Video publishing method, device, equipment and storage medium
CN114979757A (en)*2022-06-022022-08-30北京字跳网络技术有限公司Video distribution method, device, equipment and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2008053956A (en)*2006-08-232008-03-06Mitsubishi Electric Corp Video distribution apparatus and video distribution system
CN101588476A (en)*2008-05-232009-11-25索尼株式会社Content server, information processing apparatus/method, network device, content distribution method/system
US20130254259A1 (en)*2012-03-202013-09-26Fast Track Technologies LimitedMethod and system for publication and sharing of files via the internet
CN103457910A (en)*2012-05-292013-12-18腾讯科技(深圳)有限公司Method and terminal for uploading files
CN104883288A (en)*2014-02-272015-09-02北京风行在线技术有限公司Method and apparatus for providing information to be released
WO2016082529A1 (en)*2014-11-242016-06-02华为技术有限公司Video coding method and device
WO2017020664A1 (en)*2015-08-032017-02-09腾讯科技(深圳)有限公司Video encoding parameter setting method and apparatus for live video, and video encoding device and storage medium
US20170078671A1 (en)*2015-09-112017-03-16Facebook, Inc.Accelerated uploading of encoded video
CN109714557A (en)*2017-10-252019-05-03中国移动通信集团公司Method for evaluating quality, device, electronic equipment and the storage medium of video calling
CN110536168A (en)*2019-09-112019-12-03北京达佳互联信息技术有限公司Video method for uploading, device, electronic equipment and storage medium
CN110996125A (en)*2019-11-182020-04-10腾讯科技(深圳)有限公司Video stream generation method and device, electronic equipment and storage medium
CN111327896A (en)*2018-12-132020-06-23浙江宇视科技有限公司 Video transmission method, device, electronic device and readable storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2008053956A (en)*2006-08-232008-03-06Mitsubishi Electric Corp Video distribution apparatus and video distribution system
CN101588476A (en)*2008-05-232009-11-25索尼株式会社Content server, information processing apparatus/method, network device, content distribution method/system
US20130254259A1 (en)*2012-03-202013-09-26Fast Track Technologies LimitedMethod and system for publication and sharing of files via the internet
CN103457910A (en)*2012-05-292013-12-18腾讯科技(深圳)有限公司Method and terminal for uploading files
CN104883288A (en)*2014-02-272015-09-02北京风行在线技术有限公司Method and apparatus for providing information to be released
WO2016082529A1 (en)*2014-11-242016-06-02华为技术有限公司Video coding method and device
WO2017020664A1 (en)*2015-08-032017-02-09腾讯科技(深圳)有限公司Video encoding parameter setting method and apparatus for live video, and video encoding device and storage medium
US20170078671A1 (en)*2015-09-112017-03-16Facebook, Inc.Accelerated uploading of encoded video
CN109714557A (en)*2017-10-252019-05-03中国移动通信集团公司Method for evaluating quality, device, electronic equipment and the storage medium of video calling
CN111327896A (en)*2018-12-132020-06-23浙江宇视科技有限公司 Video transmission method, device, electronic device and readable storage medium
CN110536168A (en)*2019-09-112019-12-03北京达佳互联信息技术有限公司Video method for uploading, device, electronic equipment and storage medium
CN110996125A (en)*2019-11-182020-04-10腾讯科技(深圳)有限公司Video stream generation method and device, electronic equipment and storage medium

Cited By (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113099216A (en)*2021-03-262021-07-09北京百度网讯科技有限公司Coding complexity evaluation method, device, equipment and storage medium
CN113099216B (en)*2021-03-262023-03-24北京百度网讯科技有限公司Coding complexity evaluation method, device, equipment and storage medium
CN113382258A (en)*2021-06-102021-09-10北京百度网讯科技有限公司Video encoding method, apparatus, device, and medium
CN113382258B (en)*2021-06-102022-10-21北京百度网讯科技有限公司 Video coding method, apparatus, device and medium
CN113766230A (en)*2021-11-042021-12-07广州易方信息科技股份有限公司Media file encoding method and device, computer equipment and storage medium
CN114650437A (en)*2022-03-142022-06-21百果园技术(新加坡)有限公司Video publishing method, device, equipment and storage medium
WO2023174254A1 (en)*2022-03-142023-09-21百果园技术(新加坡)有限公司Video posting method and apparatus, and device and storage medium
CN114650437B (en)*2022-03-142024-04-16百果园技术(新加坡)有限公司Video publishing method, device, equipment and storage medium
CN114979757A (en)*2022-06-022022-08-30北京字跳网络技术有限公司Video distribution method, device, equipment and storage medium
CN114979757B (en)*2022-06-022024-01-30北京字跳网络技术有限公司 Video publishing method, device, equipment and storage medium

Also Published As

Publication numberPublication date
CN112312135B (en)2022-07-15

Similar Documents

PublicationPublication DateTitle
CN112312135B (en)Video publishing method and device, computer equipment and storage medium
CN109194984B (en)Video frame scheduling method based on edge calculation
CN113068052B (en)Method for determining brushing amount of live broadcast room, live broadcast method and data processing method
CN108965884B (en)Distribution method of transcoding tasks, scheduling device and transcoding device
CN110178377A (en)Initial bit rate selection for video transmission session
CN105163134A (en)Video coding parameter setting method, device and video coding device for live video
CN110446072A (en)Video stream switching method, electronic device and storage medium
CN111447447A (en) Live encoding method, device and electronic device
CN103636229A (en)Distributing audio video content
CN106161485B (en)A kind of resource regulating method of infrastructure service cluster, device and system
CN106817314B (en)Big data acquisition method, device and system
CN111617466B (en) Encoding format determination method, device and implementation method of cloud game
CN105830415A (en) Method for managing media stream, wireless communication device and base station device
JP2008005108A (en) Video quality estimation device, video quality management device, video quality estimation method, video quality management method, and program
US20110202596A1 (en)Cache server control device, content distribution system, method of distributing content, and program
CN110324681B (en)Slicing method, device, storage medium and transmission system of multimedia data
KR101779791B1 (en)Transmitting information based on reading speed
CN106412106B (en)Message sending method and device
CN108235075B (en)Video quality grade matching method, computer readable storage medium and terminal
WO2023174254A1 (en)Video posting method and apparatus, and device and storage medium
CN110784731B (en)Data stream transcoding method, device, equipment and medium
KR20140058091A (en)Apparatus, method and computer readable recording medium for assigning trnscording works
JP6544188B2 (en) Buffer size determination apparatus, system, buffer size determination method, video data reproduction method and program
CN102547266B (en)Video data transmission method and equipment
CN108282669A (en)Information processing equipment and information processing system

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp