CN112954354B - Video transcoding method, device, equipment and medium - Google Patents

Video transcoding method, device, equipment and medium Download PDF

Info

Publication number
CN112954354B
CN112954354B CN202110139424.6A CN202110139424A CN112954354B CN 112954354 B CN112954354 B CN 112954354B CN 202110139424 A CN202110139424 A CN 202110139424A CN 112954354 B CN112954354 B CN 112954354B
Authority
CN
China
Prior art keywords
transcoding
video
threshold
period
transcoded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110139424.6A
Other languages
Chinese (zh)
Other versions
CN112954354A (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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao 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 Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202110139424.6A priority Critical patent/CN112954354B/en
Publication of CN112954354A publication Critical patent/CN112954354A/en
Application granted granted Critical
Publication of CN112954354B publication Critical patent/CN112954354B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode

Abstract

The embodiment of the disclosure discloses a method, a device, equipment and a medium for transcoding videos, wherein the method comprises the steps of transcoding a first video in a transcoding queue in a first coding mode and transcoding a second video outside the transcoding queue in a second coding mode in a current transcoding period; the video heat of the first video is greater than or equal to a heat threshold; under the condition that the same video is transcoded to have the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode; and under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold, reducing the heat threshold as the heat threshold of the next transcoding period. The embodiment of the disclosure transcodes the video in a coding mode with low video code rate to the maximum extent on the premise of fully utilizing computing resources, and improves the watching experience of the transcoded video.

Description

Video transcoding method, device, equipment and medium
Technical Field
The embodiments of the present disclosure relate to video processing technologies, and in particular, to a method, an apparatus, a device, and a medium for transcoding a video.
Background
Video transcoding requires a large amount of computing resources, and the amount of transcoded video must be controlled under resource-limited conditions to ensure the stability of transcoding services and the reasonable allocation of computing resources. For the situation that the same video is transcoded into the same video quality, the video code rates of different encoding modes are different, a user watches the transcoded video obtained by the encoding mode with low video code rate, the watching experience is better, and relatively, the transcoding process of the encoding mode with low video code rate consumes more computing resources compared with the transcoding process of the encoding mode with high video code rate.
In a User-Generated Content (UGC) scene, the video magnitude is large, generally, a video with the video heat greater than the heat threshold is transcoded by a coding mode with low video code rate, and a video with the video heat less than or equal to the heat threshold is transcoded by a coding mode with high video code rate.
Disclosure of Invention
The embodiment of the disclosure provides a transcoding method, a transcoding device, transcoding equipment and a transcoding medium for a video, which transcode the video in an encoding mode with a low video code rate to the maximum extent on the premise of fully utilizing computing resources, and improve the viewing experience of the transcoded video.
In a first aspect, an embodiment of the present disclosure provides a method for transcoding a video, where the method includes:
in the current transcoding period, transcoding a first video in a transcoding queue through a first coding mode, and transcoding a second video outside the transcoding queue through a second coding mode; the video heat of the first video is greater than or equal to a heat threshold; under the condition that the same video is transcoded to have the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode;
and under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold, reducing the heat threshold as the heat threshold of the next transcoding period.
In a second aspect, an embodiment of the present disclosure further provides a video transcoding apparatus, where the apparatus includes:
the first transcoding unit is used for transcoding the first video in the transcoding queue in a first coding mode in the current transcoding period; the video heat of the first video is greater than or equal to a heat threshold;
the second transcoding unit is used for transcoding a second video outside the transcoding queue in a second coding mode; under the condition that the same video is transcoded to have the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode;
and the adjusting unit is used for reducing the heat threshold as the heat threshold of the next transcoding period under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
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 method of transcoding video as described in embodiments of the disclosure.
In a fourth aspect, the disclosed embodiments further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a transcoding method for video according to the disclosed embodiments.
According to the method and the device, the heat threshold value can be adjusted according to the transcoding delay of the transcoding queue and the transcoding quantity in the current transcoding period, the transcoding delay of the transcoding queue is smaller than the delay threshold value, and under the condition that the quantity of the first videos transcoded in the current transcoding period is smaller than the first quantity threshold value, the heat threshold value is reduced, so that more videos can be transcoded as the first videos in a first coding mode, on the premise that computing resources are fully utilized, the videos (the first videos) are transcoded in a coding mode (the first coding mode) with low video code rate to the maximum extent, and the watching experience of the transcoded videos is improved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is a flowchart of a video transcoding method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a video transcoding method according to a second embodiment of the present disclosure;
fig. 3 is a graph illustrating a corresponding relationship between a transcoding period of a video transcoding method and a transcoding amount of a first video in a current transcoding period according to a second embodiment of the present disclosure;
fig. 4 is a structural diagram of a video transcoding device according to a third embodiment of the present disclosure;
fig. 5 is a structural diagram of an electronic device according to a fourth embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein is intended to be open-ended, i.e., "including but not limited to". The term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Example one
Fig. 1 is a flowchart of a video transcoding method provided in an embodiment of the present disclosure, where the method may be executed by a video server, and the video server may be implemented in software and/or hardware. As shown in fig. 1, the method specifically includes the following steps:
s110, transcoding a first video in a transcoding queue in a current transcoding period through a first coding mode, and transcoding a second video outside the transcoding queue through a second coding mode; the video heat of the first video is greater than or equal to a heat threshold; and under the condition that the same video is transcoded to have the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode.
In the transcoding period, the video with the video heat greater than or equal to the heat threshold value is used as a first video and enters a transcoding queue, and the first video in the transcoding queue is transcoded in a first coding mode. And the second video which does not enter the transcoding queue is the video with the video heat smaller than the heat threshold value, and the second video is transcoded in a second coding mode. Wherein, the first coding mode and the second coding mode satisfy the following relation: and under the condition that the same video is transcoded into the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode.
The video popularity is used for representing the popularity of the video, and can be at least one of the following values: the number of plays, the number of praise, the appraisal amount and the forwarding amount, or the number of plays, the number of praise, the weight value of two or more values of the appraisal amount and the forwarding amount, etc.
In one implementation, the transcoding period may be 5 seconds, although the transcoding period may be other durations, such as 8 seconds, 10 seconds, and so on.
In one implementation, the first encoding scheme may be H265, and the second encoding scheme may be H264; of course, the first encoding mode and the second encoding mode may be other encoding modes, as long as the first encoding mode and the second encoding mode satisfy a relationship that the video code rate of the first encoding mode is smaller than the video code rate of the second encoding mode when the same video is transcoded to have the same video quality. For example, for the same video, the video bitrate of H265 is about 75% of the video bitrate of H264 with the same video quality transcoded out.
And S120, reducing the heat threshold as the heat threshold of the next transcoding period under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold.
The user's viewing experience of the video transcoded by the first encoding method is better than that of the video transcoded by the second encoding method, but the first encoding method occupies more computing resources in the transcoding process than the second encoding method, and in one implementation, the first encoding method is H265, and the second encoding method H264 is taken as an example, and under the condition that the preset parameter (preset) of transcoding is set to be very slow (veryslow), the resource consumption of H265 is nearly 4 times that of H264. In order to transcode a video (a first video) in an encoding mode (a first encoding mode) with a low video code rate to the maximum extent on the premise of fully utilizing computing resources and improve the watching experience of the transcoded video, in the embodiment of the disclosure, how to adjust a heat threshold is determined according to the transcoding delay of a transcoding queue and the transcoding quantity in the current transcoding period, so that the computing resources are fully utilized in the next transcoding period, and the first video is transcoded in the first encoding mode to the maximum extent. Specifically, the heat threshold is reduced as the heat threshold of the next transcoding period under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold. The transcoding delay of the transcoding queue reflects the congestion degree of transcoding scheduling, the number of the transcoded first videos in the current transcoding period reflects the congestion degree calculated by transcoding, the transcoding delay of the transcoding queue is smaller than a delay threshold value and then represents that the transcoding scheduling is not congested, the number of the transcoded first videos in the current transcoding period is smaller than a first number threshold value and then represents that the transcoding is not congested, and under the condition that neither dimension is congested in scheduling nor in calculating, the heat threshold value can be reduced, so that more videos can enter the transcoding queue as the first videos in the next transcoding period and are transcoded in a first coding mode.
In one implementation, the transcoding delay of the transcoding queue is an average value of time differences between the time when each first video completing transcoding enters the transcoding queue and the time when transcoding starts within a preset time length. In one implementation, the preset time duration is 5 minutes, there are 3 first videos that have completed transcoding, the time difference between the time entering the transcoding queue and the time of starting transcoding is 50 seconds, 60 seconds, and 70 seconds, respectively, and then the transcoding delay is (50+60+70)/3 — 60 seconds. Of course, instead of taking the average value as the transcoding delay, the transcoding delay may also be determined in various ways, such as taking the maximum value or taking the intermediate value.
In one implementation, decreasing the hot threshold as the hot threshold of the next transcoding period may include: under the condition that the number of the first videos which are transcoded in the current transcoding period is smaller than a second number threshold, reducing the heat threshold by a first proportion to be used as the heat threshold of the next transcoding period; and when the number of the first videos which are transcoded in the current transcoding period is greater than or equal to a second number threshold and is smaller than the first number threshold, the heat threshold is reduced by a second proportion and then is used as the heat threshold of the next transcoding period, and the first proportion is greater than the second proportion.
Under the condition that the number of the first videos transcoded in the current transcoding period is less, namely the number of the first videos transcoded in the current transcoding period is smaller than a second number threshold, the idle degree of the computing resources is larger, so that the heat threshold can be greatly reduced, and more first videos in the next transcoding period are transcoded in a first coding mode; under the condition that the number of the first videos transcoded in the current transcoding period is large, namely the number of the first videos transcoded in the current transcoding period is larger than or equal to a second number threshold and smaller than the first number threshold, the calculation resources are idle, but the idle degree is not as large as that of the former case, so that the heat threshold can be reduced by a small degree, the number of the first videos transcoded in the next transcoding period through the first coding mode is increased, and the increased proportion is not large in the former case. And reducing the heat threshold value in different proportions according to different idle degrees of the computing resources, thereby further ensuring the stability of the computation.
The method and the device can adjust the heat threshold value according to the transcoding delay of the transcoding queue and the transcoding quantity in the current transcoding period, the transcoding delay of the transcoding queue is smaller than the delay threshold value, and the heat threshold value is reduced under the condition that the transcoding quantity of the first video in the current transcoding period is smaller than the first quantity threshold value, so that more videos can be transcoded in a first coding mode as the first video, the videos are transcoded in a coding mode (first coding mode) with low video code rate to the maximum extent on the premise that computing resources are fully utilized, and the watching experience of the transcoded videos is improved.
Example two
Fig. 2 is a flowchart of a video transcoding method provided in the second embodiment of the present disclosure, where the method may be executed by a video server, and the video server may be implemented in software and/or hardware. The present embodiment includes steps S210, S220, and S230, where S210 and S220 correspond to S110 and S120, respectively, in the above-described embodiment. As shown in fig. 2, the method specifically includes the following steps:
s210, in the current transcoding period, transcoding a first video in the transcoding queue through a first coding mode, and transcoding a second video outside the transcoding queue through a second coding mode.
And S220, under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold, reducing the heat threshold to serve as the heat threshold of the next transcoding period.
In one implementation, decreasing the hot threshold as the hot threshold of the next transcoding period may include: under the condition that the number of the first videos which are transcoded in the current transcoding period is smaller than a second number threshold, reducing the heat threshold by a first proportion to be used as the heat threshold of the next transcoding period; and under the condition that the number of the first videos which are transcoded in the current transcoding period is greater than or equal to a second number threshold and is smaller than the first number threshold, reducing the heat threshold by a second proportion to be used as the heat threshold of the next transcoding period, wherein the first proportion is greater than the second proportion.
And S230, under the condition that the transcoding delay of the transcoding queue is greater than or equal to a delay threshold or the number of the first videos transcoded in the current transcoding period is greater than or equal to a first number threshold, taking the highest heat threshold as the heat threshold of the next transcoding period.
The transcoding delay of the transcoding queue reflects the congestion degree of transcoding scheduling, the quantity of the transcoded first videos in the current transcoding period reflects the congestion degree of transcoding calculation, if the transcoding delay of the transcoding queue is larger than or equal to a delay threshold value, congestion on transcoding scheduling is indicated, if the quantity of the transcoded first videos in the current transcoding period is larger than or equal to a first quantity threshold value, congestion on transcoding calculation is indicated, and under the condition that any one of the two dimensions is congested in scheduling and calculation, the highest heat threshold value is used as the heat threshold value of the next transcoding period, so that the least videos in the next transcoding period can be placed in the transcoding queue as the first videos to be transcoded in a first coding mode.
The method and the device can adjust the heat threshold value according to the transcoding delay of the transcoding queue and the transcoding quantity in the current transcoding period, the transcoding delay of the transcoding queue is smaller than the delay threshold value, and the heat threshold value is reduced under the condition that the transcoding quantity of the first video in the current transcoding period is smaller than the first quantity threshold value, so that more videos can be transcoded in a first coding mode as the first video, the videos are transcoded in a coding mode (first coding mode) with low video code rate to the maximum extent on the premise that computing resources are fully utilized, and the watching experience of the transcoded videos is improved. And under the condition that the transcoding delay of the transcoding queue is greater than or equal to a delay threshold or the number of the transcoded first videos in the current transcoding period is greater than or equal to a first number threshold, taking the highest heat threshold as the heat threshold of the next transcoding period, and ensuring the stability of transcoding.
The following provides an implementation mode to exemplarily explain a transcoding method of video in the embodiment of the present disclosure. Fig. 3 is a graph illustrating a correspondence relationship between a transcoding period of a video transcoding method and a transcoding amount of a first video in a current transcoding period according to an embodiment of the present disclosure. Referring to fig. 3, the horizontal axis represents the number of periods, the vertical axis represents the number of corresponding first videos transcoded by the first encoding method, and the numerical values indicated at points T1 and T2 … T26 on the curve represent the number of first videos transcoded by the first encoding method in the corresponding current period when the current period ends. In this implementation, for example, the transcoding period is 5 seconds, the second quantity threshold is 64, the first quantity threshold is 80, the first proportion is 10%, and the second proportion is 5%.
In the 1 st transcoding period to the 5 th transcoding period, the transcoding delay of the transcoding queue is smaller than a delay threshold, and the number of the transcoded first videos in each transcoding period is smaller than a second number threshold 64, so that the heat thresholds of the 2 nd transcoding period to the 6 th transcoding period are increased by 10% relative to the heat threshold of the previous transcoding period, namely the heat threshold of the next transcoding period is 110% of the heat threshold of the previous transcoding period.
When the 6 th transcoding period is finished, the transcoding delay of the transcoding queue is less than the delay threshold, and the number of the first videos transcoded in the 6 th transcoding period corresponding to T6 on the curve in the first encoding mode is 64 and is equal to the second number threshold, so that the 7 th transcoding period is increased by 5% relative to the heat threshold of the 6 th transcoding period, that is, the heat threshold of the 7 th transcoding period is 105% of the heat threshold of the 6 th transcoding period.
In the 7 th to 9 th transcoding periods, the transcoding delay of the transcoding queue is smaller than a delay threshold, and the number of the first videos which are transcoded in each transcoding period is larger than a second number threshold and smaller than a first number threshold, so that the heat thresholds of the 8 th to 10 th transcoding periods are increased by 5% relative to the heat threshold of the previous transcoding period, namely the heat threshold of the next transcoding period is 105% of the heat threshold of the previous transcoding period.
When the 10 th transcoding period is finished, the transcoding delay of the transcoding queue is smaller than a delay threshold, and the number of the first videos which are transcoded in the 10 th transcoding period through the first coding method and correspond to T10 on the curve is 80 and is equal to a first number threshold, so that the heat threshold of the 11 th transcoding period is the highest heat threshold, and correspondingly, when the 11 th transcoding period is finished, the number of the first videos which are transcoded in the 11 th transcoding period through the first coding method and correspond to T11 on the curve is 12 and is the number of the first videos which are transcoded in the current transcoding period through the first coding method and correspond to the highest heat threshold.
The 11 th transcoding period and the 12 th transcoding period are similar to the 1 st transcoding period and the 5 th transcoding period, the transcoding delay of the transcoding queue is smaller than a delay threshold, and the number of the first videos which are transcoded in each transcoding period is smaller than a second number threshold.
The 13 th transcoding period is similar to the 6 th transcoding period, the transcoding delay of the transcoding queue is less than a delay threshold, and the number of first videos transcoded in the transcoding period in the first coding mode is equal to a second number threshold
The 14 th and 15 th transcoding periods are similar to the 7 th to 9 th transcoding periods, the transcoding delay of the transcoding queue is smaller than a delay threshold, and the number of the first videos which are transcoded in each transcoding period is larger than a second number threshold and smaller than a first number threshold.
The 16 th transcoding period is different from the 10 th transcoding period in that the number of the first videos which are transcoded in the period corresponding to the point T16 on the curve is 76, and is greater than the second number threshold and is less than the first number threshold, but the transcoding delay of the transcoding queue is greater than the delay threshold, so that the heat threshold of the 17 th transcoding period is the highest heat threshold, and accordingly, when the 17 th transcoding period is finished, the number of the first videos which are transcoded in the first encoding mode in the 17 th transcoding period corresponding to the point T17 on the curve is 10, and is the number of the first videos which are transcoded in the first encoding mode in the current transcoding period corresponding to the highest heat threshold.
EXAMPLE III
Fig. 4 is a structural diagram of a video transcoding apparatus according to a third embodiment of the present disclosure, which may execute the video transcoding method in the foregoing embodiments and may be configured in a video server, and as shown in fig. 4, the apparatus may include:
a first transcoding module 41, configured to transcode, in the current transcoding period, the first video in the transcoding queue in a first coding mode; wherein the video heat of the first video is greater than or equal to a heat threshold;
a second transcoding module 42, configured to transcode a second video outside the transcoding queue by a second encoding method; under the condition that the same video is transcoded to have the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode;
and an adjusting module 43, configured to decrease the heat threshold as the heat threshold of the next transcoding period when the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold.
The method and the device can adjust the heat threshold value according to the transcoding delay of the transcoding queue and the transcoding quantity in the current transcoding period, the transcoding delay of the transcoding queue is smaller than the delay threshold value, and the heat threshold value is reduced under the condition that the transcoding quantity of the first video in the current transcoding period is smaller than the first quantity threshold value, so that more videos can be transcoded in a first coding mode as the first video, the videos are transcoded in a coding mode (first coding mode) with low video code rate to the maximum extent on the premise that computing resources are fully utilized, and the watching experience of the transcoded videos is improved.
On the basis of the foregoing embodiment, the adjusting module 43 is further configured to:
and under the condition that the transcoding delay of the transcoding queue is greater than or equal to a delay threshold or the number of the first videos transcoded in the current transcoding period is greater than or equal to a first number threshold, taking the highest heat threshold as the heat threshold of the next transcoding period.
On the basis of the foregoing embodiment, the adjusting module 43 is specifically configured to:
under the condition that the number of the first videos which are transcoded in the current transcoding period is smaller than a second number threshold, reducing the heat threshold by a first proportion to be used as the heat threshold of the next transcoding period; and when the number of the first videos which are transcoded in the current transcoding period is greater than or equal to a second number threshold and is smaller than the first number threshold, the heat threshold is reduced by a second proportion and then is used as the heat threshold of the next transcoding period, and the first proportion is greater than the second proportion.
In addition to the above embodiments, the first encoding method is H265, and the second encoding method is H264.
On the basis of the above embodiment, the transcoding delay of the transcoding queue is an average value of time differences between the time when each transcoded first video enters the transcoding queue and the time when transcoding starts within a preset time duration.
On the basis of the above embodiment, the video heat is at least one of the following values: playing times, praise times, comment quantity and forwarding quantity of the video; or the video popularity is a weighted value of two or more numerical values of the playing times, the praise times, the comment quantity and the forwarding quantity of the video.
On the basis of the above embodiment, the transcoding period is 5 seconds.
The video transcoding device provided in the embodiment of the present disclosure and the video transcoding method provided in the foregoing embodiment belong to the same inventive concept, and the technical details that are not described in detail in this embodiment can be referred to in the foregoing embodiment, and this embodiment has the same beneficial effects as the video transcoding method.
Example four
Referring now to FIG. 5, a block diagram of an electronic device 900 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device in the embodiments of the present disclosure is provided with a video transcoding function, and may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle mounted terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, the electronic device 900 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 901 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage means 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the electronic apparatus 900 are also stored. The processing apparatus 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
Generally, the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 907 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 908 including, for example, magnetic tape, hard disk, etc.; and a communication device 909. The communication means 909 may allow the electronic apparatus 900 to communicate with other apparatuses wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 900 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be alternatively implemented or provided.
In particular, the processes described above with reference to the flow diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902. The computer program, when executed by the processing device 901, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
EXAMPLE five
The computer readable medium described above in this disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may be separate and not incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in the current transcoding period, transcoding a first video in a transcoding queue through a first coding mode, and transcoding a second video outside the transcoding queue through a second coding mode; the video heat of the first video is greater than or equal to a heat threshold; under the condition that the same video is transcoded to have the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode; and under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold, reducing the heat threshold as the heat threshold of the next transcoding period.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of the module does not constitute a limitation to the module itself in some cases, for example, the first transcoding module may also be described as a "module that transcodes the first video in the transcoding queue in the current transcoding period by the first encoding mode".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a method of transcoding video, the method including:
in the current transcoding period, transcoding a first video in a transcoding queue through a first coding mode, and transcoding a second video outside the transcoding queue through a second coding mode; the video heat of the first video is greater than or equal to a heat threshold; under the condition that the same video is transcoded to have the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode;
and under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold, reducing the heat threshold as the heat threshold of the next transcoding period.
According to one or more embodiments of the present disclosure, the video transcoding method provided by the present disclosure further includes:
and under the condition that the transcoding delay of the transcoding queue is greater than or equal to a delay threshold or the number of the transcoded first videos in the current transcoding period is greater than or equal to a first number threshold, taking the highest heat threshold as the heat threshold of the next transcoding period.
According to one or more embodiments of the present disclosure, in the video transcoding method provided by the present disclosure, the reducing the heat threshold as a heat threshold of a next transcoding period includes:
under the condition that the number of the first videos which are transcoded in the current transcoding period is smaller than a second number threshold, reducing the heat threshold by a first proportion to be used as the heat threshold of the next transcoding period;
and under the condition that the number of the first videos which are transcoded in the current transcoding period is greater than or equal to a second number threshold and is smaller than the first number threshold, reducing the heat threshold by a second proportion to be used as the heat threshold of the next transcoding period, wherein the first proportion is greater than the second proportion.
According to one or more embodiments of the present disclosure, in the video transcoding method provided by the present disclosure, the first encoding manner is H265, and the second encoding manner is H264.
According to one or more embodiments of the present disclosure, in the video transcoding method provided by the present disclosure, the transcoding delay of the transcoding queue is an average value of time differences between a time when each transcoded first video enters the transcoding queue and a time when transcoding starts within a preset time duration.
According to one or more embodiments of the present disclosure, in a transcoding method of a video provided by the present disclosure, the video heat is at least one of the following values: playing times, praise times, comment quantity and forwarding quantity of the video; or the video popularity is a weighted value of two or more numerical values of the playing times, the praise times, the comment quantity and the forwarding quantity of the video.
According to one or more embodiments of the present disclosure, in a transcoding method of a video provided by the present disclosure, the transcoding period is 5 seconds.
According to one or more embodiments of the present disclosure, there is provided a video transcoding apparatus, the apparatus including:
the first transcoding unit is used for transcoding the first video in the transcoding queue in a first coding mode in the current transcoding period; the video heat of the first video is greater than or equal to a heat threshold;
the second transcoding unit is used for transcoding a second video outside the transcoding queue in a second coding mode; under the condition that the same video is transcoded to have the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode;
and the adjusting unit is used for reducing the heat threshold value as the heat threshold value of the next transcoding period under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold value and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold value.
In accordance with one or more embodiments of the present disclosure, there is provided an electronic device including:
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 method of transcoding video as any one of the video provided by the present disclosure.
According to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of transcoding video as any one of the methods provided by the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other combinations of features described above or equivalents thereof without departing from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A method for transcoding video, the method comprising:
in the current transcoding period, transcoding a first video in a transcoding queue through a first coding mode, and transcoding a second video outside the transcoding queue through a second coding mode; the video heat of the first video is greater than or equal to a heat threshold; under the condition that the same video is transcoded to have the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode;
and under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold, reducing the heat threshold as the heat threshold of the next transcoding period.
2. The method of claim 1, further comprising:
and under the condition that the transcoding delay of the transcoding queue is greater than or equal to a delay threshold or the number of the first videos transcoded in the current transcoding period is greater than or equal to a first number threshold, taking the highest heat threshold as the heat threshold of the next transcoding period.
3. The method of claim 1, wherein the reducing the hot threshold as a hot threshold for a next transcoding period comprises:
when the number of the first videos transcoded in the current transcoding period is smaller than a second number threshold, reducing the heat threshold by a first proportion to be used as the heat threshold of the next transcoding period;
and under the condition that the number of the first videos which are transcoded in the current transcoding period is greater than or equal to a second number threshold and is smaller than the first number threshold, reducing the heat threshold by a second proportion to be used as the heat threshold of the next transcoding period, wherein the first proportion is greater than the second proportion.
4. The method according to any one of claims 1 to 3, wherein the first encoding scheme is H265 and the second encoding scheme is H264.
5. The method of any one of claims 1 to 3, wherein the transcoding delay of the transcoding queue is an average value of a time difference between a time when each transcoded first video enters the transcoding queue and a time when transcoding starts within a preset time duration.
6. A method according to any one of claims 1 to 3, wherein the video heat is at least one of: playing times, praise times, comment quantity and forwarding quantity of the video; or the video popularity is a weighted value of two or more numerical values of the playing times, the praise times, the comment quantity and the forwarding quantity of the video.
7. The method of any of claims 1 to 3, wherein the transcoding period is 5 seconds.
8. An apparatus for transcoding video, the apparatus comprising:
the first transcoding unit is used for transcoding the first video in the transcoding queue in a first coding mode in the current transcoding period; the video heat of the first video is greater than or equal to a heat threshold;
the second transcoding unit is used for transcoding a second video outside the transcoding queue in a second coding mode; under the condition that the same video is transcoded to have the same video quality, the video code rate of the first coding mode is smaller than that of the second coding mode;
and the adjusting unit is used for reducing the heat threshold as the heat threshold of the next transcoding period under the condition that the transcoding delay of the transcoding queue is smaller than a delay threshold and the number of the first videos transcoded in the current transcoding period is smaller than a first number threshold.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of transcoding video of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of transcoding video as claimed in any one of claims 1 to 7.
CN202110139424.6A 2021-02-01 2021-02-01 Video transcoding method, device, equipment and medium Active CN112954354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110139424.6A CN112954354B (en) 2021-02-01 2021-02-01 Video transcoding method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110139424.6A CN112954354B (en) 2021-02-01 2021-02-01 Video transcoding method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN112954354A CN112954354A (en) 2021-06-11
CN112954354B true CN112954354B (en) 2022-07-22

Family

ID=76241195

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110139424.6A Active CN112954354B (en) 2021-02-01 2021-02-01 Video transcoding method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112954354B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113473183B (en) * 2021-06-29 2023-05-05 华夏城视网络电视股份有限公司 Dynamic and static media stream batch processing method applied to fusion media
CN113676754B (en) * 2021-08-18 2023-08-29 上海哔哩哔哩科技有限公司 Live video transcoding method and device
CN114760506B (en) * 2022-04-11 2024-02-09 北京字跳网络技术有限公司 Video transcoding evaluation method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102802089A (en) * 2012-09-13 2012-11-28 浙江大学 Shifting video code rate regulation method based on experience qualitative forecast
CN108337533A (en) * 2017-01-17 2018-07-27 腾讯科技(深圳)有限公司 Video-frequency compression method and device
CN111225209A (en) * 2018-11-23 2020-06-02 北京字节跳动网络技术有限公司 Video data plug flow method, device, terminal and storage medium
CN111629212A (en) * 2020-04-30 2020-09-04 网宿科技股份有限公司 Method and device for transcoding video
CN112153415A (en) * 2020-09-23 2020-12-29 北京字节跳动网络技术有限公司 Video transcoding method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10271053B2 (en) * 2016-01-20 2019-04-23 Arris Enterprises Llc Multistage panic rate control scheme for encoders
US10298969B2 (en) * 2016-11-10 2019-05-21 University Of Louisiana At Lafayette Architecture and method for high performance on demand video transcoding

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102802089A (en) * 2012-09-13 2012-11-28 浙江大学 Shifting video code rate regulation method based on experience qualitative forecast
CN108337533A (en) * 2017-01-17 2018-07-27 腾讯科技(深圳)有限公司 Video-frequency compression method and device
CN111225209A (en) * 2018-11-23 2020-06-02 北京字节跳动网络技术有限公司 Video data plug flow method, device, terminal and storage medium
CN111629212A (en) * 2020-04-30 2020-09-04 网宿科技股份有限公司 Method and device for transcoding video
CN112153415A (en) * 2020-09-23 2020-12-29 北京字节跳动网络技术有限公司 Video transcoding method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112954354A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
CN112954354B (en) Video transcoding method, device, equipment and medium
CN112135169B (en) Media content loading method, device, equipment and medium
CN111147606B (en) Data transmission method, device, terminal and storage medium
CN112272226B (en) Picture loading method and device and readable storage medium
CN110290398B (en) Video issuing method and device, storage medium and electronic equipment
CN112312137A (en) Video transmission method and device, electronic equipment and storage medium
CN112153415B (en) Video transcoding method, device, equipment and storage medium
CN112199174A (en) Message sending control method and device, electronic equipment and computer readable storage medium
CN111225209A (en) Video data plug flow method, device, terminal and storage medium
CN114786055A (en) Preloading method, preloading device, electronic equipment and medium
CN114257815A (en) Video transcoding method, device, server and medium
CN111478916B (en) Data transmission method, device and storage medium based on video stream
CN113542856A (en) Reverse playing method, device, equipment and computer readable medium for online video
CN113364767A (en) Streaming media data display method and device, electronic equipment and storage medium
CN109951737B (en) Video processing method, video processing device, electronic equipment and computer-readable storage medium
CN114979762A (en) Video downloading and transmission method, device, terminal equipment, server and medium
CN112153322A (en) Data distribution method, device, equipment and storage medium
CN112887742B (en) Live stream processing method, device, equipment and storage medium
CN112636971B (en) Service degradation method and device, electronic equipment and storage medium
CN112995780B (en) Network state evaluation method, device, equipment and storage medium
CN115623267A (en) Dynamic picture display method and device, electronic equipment and storage medium
CN115134641B (en) Screen projection method and device and electronic equipment
WO2023226742A1 (en) Video transcoding method and apparatus, and device and storage medium
CN115379243A (en) CDN scheduling method, device, equipment and storage medium
CN116208787A (en) Video downloading control method, device, equipment and storage medium

Legal Events

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