CN106993199A - A kind of method and system of real-time video transcoding - Google Patents
A kind of method and system of real-time video transcoding Download PDFInfo
- Publication number
- CN106993199A CN106993199A CN201710292663.9A CN201710292663A CN106993199A CN 106993199 A CN106993199 A CN 106993199A CN 201710292663 A CN201710292663 A CN 201710292663A CN 106993199 A CN106993199 A CN 106993199A
- Authority
- CN
- China
- Prior art keywords
- video
- code rate
- transcoding
- bandwidth
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 230000005540 biological transmission Effects 0.000 claims abstract description 53
- 239000012634 fragment Substances 0.000 claims description 42
- 230000003044 adaptive effect Effects 0.000 claims description 24
- 238000012544 monitoring process Methods 0.000 claims description 20
- 238000006243 chemical reaction Methods 0.000 abstract 3
- 238000010586 diagram Methods 0.000 description 12
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000004590 computer program Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
- H04N21/2402—Monitoring of the downstream path of the transmission network, e.g. bandwidth available
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2343—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
- H04N21/234336—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by media transcoding, e.g. video is transformed into a slideshow of still pictures or audio is converted into text
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/239—Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
- H04N21/2393—Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
- H04N21/2408—Monitoring of the upstream path of the transmission network, e.g. client requests
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8456—Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/854—Content authoring
- H04N21/8547—Content authoring involving timestamps for synchronizing content
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The method that the present invention discloses real-time video transcoding, including:Video playback request is parsed to obtain the decoder model of client, video code rate is expected, according to the corresponding video of video playback acquisition request;According to bandwidth with it is expected that the ratio of video code rate is worth to the code check lifting multiple of video;Transmission of video amount is worth to according to the ratio of bandwidth and target bit rate, the transcoded format of video is obtained according to transmission of video amount and default transcoded format corresponding relation;The transcoding picture group quantity of video is obtained according to transmission of video amount, decoder model;Cut into slices by a video code conversion of the picture group of transcoding picture group quantity, the picture frame of non-transcoding in video cut into slices to obtain video segment to be transcoded;Video segment is obtained video code conversion burst and sent video code conversion burst to client with target bit rate and transcoded format progress transcoding.The present invention realizes the fine definition real-time video transcoding based on client condition and played.
Description
Technical Field
The invention relates to the technical field of video transcoding, in particular to a method and a system for real-time video transcoding.
Background
Video transcoding is a process of decoding a compressed and encoded video code stream, then re-encoding and compressing the video code stream, and converting the video code stream into another video code stream. The video transcoding can adapt to different user requirements such as different network bandwidths and different terminal processing capacities. With the continuous development of internet and multimedia playing technologies, the amount of video data increases, the requirement of users on the definition of videos increases, video files increase, and particularly with the rise of panoramic videos and virtual reality technologies, the requirements on the video transcoding rate and the definition of videos obtained after transcoding are higher.
In some video playing fields, for example, live sports events, the timeliness of video playing is very important, and the viewing interest of users is greatly reduced by the video of the sports events at the time of the past. The decoding processing capacity and the network bandwidth of different clients are different, which undoubtedly causes great challenge to the transmission of the transcoded high-definition video, so that the video is jammed when the client watches the video, and the user watching experience is not facilitated.
In a traditional video transcoding mode, a video file is transcoded according to a preset transcoding format and code rate and then stored, and the transcoded video file is sent to a user according to a user request. However, the transcoding format and the code rate of the method are fixed, the method cannot meet the video transcoding playing requirements in all user environments, and the transcoded video can be sent to the user only after the video transcoding is processed, so that the video playing delay is caused, and the timeliness requirement of the current video is not facilitated. However, the current real-time video transcoding method transcodes the video according to the definition requested by the user, but the definition of the video finally transcoded cannot completely meet the watching requirement of the user because the video transcoding format, the size of the playing screen of the user and the decoding capability of the user side are different.
Therefore, there is a need in the art to provide a real-time video decoding scheme based on the decoding and playing conditions of the user side.
Disclosure of Invention
In view of this, the present invention provides a method and a system for real-time video transcoding, which solve the technical problem in the prior art that real-time video transcoding for improving the definition of a picture cannot be performed based on the user video decoding and playing conditions.
In order to solve the above technical problem, the present invention provides a method for transcoding a real-time video, including:
receiving a video playing request of a client, analyzing the video playing request to obtain a decoder model and an expected video code rate of the client, and acquiring a corresponding video from a database according to the video playing request;
monitoring the bandwidth of the client, obtaining the code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; increasing the expected video code rate by the code rate increase multiple to obtain a target code rate;
obtaining a video transmission quantity according to the ratio of the bandwidth to the target code rate, and obtaining a transcoding format of the video according to the corresponding relation between the video transmission quantity and a preset transcoding format;
obtaining the transcoding image group quantity of the video according to the corresponding relation between the video transmission quantity, the decoder model and the image group quantity in a preset video transcoding slice;
taking the image groups with the number of the transcoding image groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain a video slice to be transcoded;
transcoding the video slice according to the target code rate and the transcoding format to obtain a video transcoding fragment, and recording a timestamp of the video transcoding fragment; and sending the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
Further, wherein the method comprises: monitoring the bandwidth of the client, obtaining the code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; increasing the expected video code rate by the code rate increase multiple to obtain a target code rate, further comprising:
monitoring the bandwidth of the client, and when the bandwidth is greater than or equal to a bandwidth threshold, increasing the expected video code rate by a fixed increase multiple to obtain a target code rate of the video transcoding;
when the bandwidth is smaller than the bandwidth threshold, obtaining the code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and a preset code rate increasing multiple; and increasing the expected video code rate by the code rate increase multiple to obtain a target code rate.
Further, monitoring the bandwidth of the client, and when the bandwidth is greater than or equal to a bandwidth threshold, increasing the expected video bitrate by a fixed increase multiple to obtain a target bitrate of the video transcoding:
monitoring the bandwidth of the client, acquiring a historical bandwidth record of the client in a set time period, calculating the proportion that the bandwidth is greater than or equal to a bandwidth threshold value in the historical bandwidth record, and increasing the expected video code rate by a fixed increase factor to obtain the target code rate of the video transcoding when the proportion reaches or exceeds the proportion threshold value and the current bandwidth is greater than or equal to the bandwidth threshold value;
and when the proportion reaches or exceeds a proportion threshold value and the current bandwidth is less than the bandwidth threshold value, taking the expected video bitrate as a target bitrate of the video transcoding.
Further, the step of taking the image group with the number of the transcoding image groups as a video transcoding slice, and the step of slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded comprises the following steps:
detecting the number of picture groups to be transcoded of the image frames which are not transcoded in the video, and when the number of the picture groups to be transcoded is larger than or equal to the number of the transcoded picture groups, taking the picture groups of the number of the transcoded picture groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded;
and when the number of the image groups to be transcoded is less than the number of the transcoded image groups, taking the image frames which are not transcoded as the video slices to be transcoded.
Further, wherein the method comprises:
and receiving an adjustment request of the expected video code rate of the client, and taking the adjusted expected video code rate as a target code rate of the video transcoding when the adjusted expected video code rate is smaller than the current expected video code rate.
In another aspect, the present invention further provides a system for transcoding a real-time video, including: the system comprises a video playing request receiving module, a video transcoding target code rate generating module, a video transcoding format obtaining module, a video transcoding image group number obtaining module, a to-be-transcoded video slicing module and a video slicing transcoding module; wherein,
the video playing request receiving module is used for being connected with the video transcoding target code rate generating module, receiving a video playing request of a client, analyzing the video playing request to obtain a decoder model and an expected video code rate of the client, and acquiring a corresponding video from a database according to the video playing request;
the video transcoding target code rate generating module is used for being connected with the video playing request receiving module and the video transcoding format obtaining module, monitoring the bandwidth of the client, obtaining the code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; increasing the expected video code rate by the code rate increase multiple to obtain a target code rate;
the video transcoding format acquisition module is used for being connected with the video transcoding target code rate generation module and the video slice transcoding module, obtaining video transmission quantity according to the ratio of the bandwidth to the target code rate, and obtaining the transcoding format of the video according to the corresponding relation between the video transmission quantity and the preset transcoding format;
the video transcoding image group quantity acquisition module is used for being connected with the video transcoding target code rate generation module and the video slice module to be transcoded and acquiring the transcoding image group quantity of the video according to the corresponding relation between the video transmission quantity, the decoder model and the image group quantity in the preset video transcoding slice;
the video slice module to be transcoded is used for being connected with the video transcoding image group number acquisition module and the video slice transcoding module, taking the image groups of the transcoding image group number as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded;
the video slice transcoding module is used for being connected with the video transcoding format acquisition module and the to-be-transcoded video slice module, transcoding the video slices with the target code rate and the transcoding format to obtain video transcoding fragments, and recording timestamps of the video transcoding fragments; and sending the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
Further, the video transcoding target bitrate generating module is: a fixed multiple target code rate generating unit and an adaptive multiple target code rate generating unit; wherein,
the fixed multiple target code rate generating unit is used for being connected with the video playing request receiving module, the video transcoding format obtaining module and the adaptive multiple target code rate generating unit, monitoring the bandwidth of the client, and when the bandwidth is larger than or equal to a bandwidth threshold value, increasing the expected video code rate by a fixed increase multiple to obtain the target code rate of the video transcoding;
the adaptive multiple target code rate generating unit is used for being connected with the video playing request receiving module, the video transcoding format obtaining module and the fixed multiple target code rate generating unit, when the bandwidth is smaller than the bandwidth threshold, the code rate increasing rate of the video is obtained according to the ratio of the bandwidth to the expected video code rate, and the code rate increasing multiple of the video is obtained according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; and increasing the expected video code rate by the code rate increase multiple to obtain a target code rate.
Further, the video transcoding target bitrate generating module is: a fixed multiple target code rate generating unit, a target code rate adjusting unit and an adaptive multiple target code rate generating unit; wherein,
the fixed multiple target code rate generating unit is used for being connected with the video playing request receiving module, the video transcoding format obtaining module, the adaptive multiple target code rate generating unit and the target code rate adjusting unit, monitoring the bandwidth of the client, obtaining a historical bandwidth record of the client in a set time period, calculating the proportion of the bandwidth in the historical bandwidth record which is larger than or equal to a bandwidth threshold, and increasing the expected video code rate by a fixed multiple to obtain the target code rate of the video transcoding when the proportion reaches or exceeds the proportion threshold and the current bandwidth is larger than or equal to the bandwidth threshold;
the target code rate adjusting unit is used for being connected with the adaptive multiple target code rate generating unit and the fixed multiple target code rate generating unit, and when the proportion reaches or exceeds a proportion threshold value and the current bandwidth is smaller than the bandwidth threshold value, the expected video code rate is used as the target code rate of the video transcoding;
the adaptive multiple target code rate generating unit is used for being connected with the video playing request receiving module, the video transcoding format obtaining module, the fixed multiple target code rate generating unit and the target code rate adjusting unit, when the bandwidth is smaller than the bandwidth threshold, the code rate increasing rate of the video is obtained according to the ratio of the bandwidth to the expected video code rate, and the code rate increasing multiple of the video is obtained according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; and increasing the expected video code rate by the code rate increase multiple to obtain a target code rate.
Further, the to-be-transcoded video slicing module is: a video slice unit and a video slice adjusting unit; wherein,
the video slice unit is used for being connected with the video transcoding image group number acquisition module, the video slice transcoding module and the video slice adjustment unit, detecting the number of image groups to be transcoded of image frames which are not transcoded in the video, and when the number of the image groups to be transcoded is larger than or equal to the number of the transcoding image groups, taking the image groups with the number of the transcoding image groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded;
and the video slice adjusting unit is used for being connected with the video transcoding image group quantity acquiring module, the video slice transcoding module and the video slice unit, and taking the image frames which are not transcoded as the video slices to be transcoded when the quantity of the image groups to be transcoded is less than the quantity of the transcoding image groups.
Further, wherein the system further comprises: and the video code rate adjusting module is used for connecting with the video transcoding target code rate generating module, receiving an adjusting request of the expected video code rate of the client, and taking the adjusted expected video code rate as the target code rate of the video transcoding when the adjusted expected video code rate is smaller than the current expected video code rate.
Compared with the prior art, the method and the system for transcoding the real-time video have the following beneficial effects that:
(1) according to the method and the system for transcoding the real-time video, on the basis that the client requests the transcoding code rate, the transcoding conditions such as the bandwidth and the transcoding processing capacity of the client are analyzed, and the video is subjected to the mode of transmitting after the segmented transcoding with the moderately improved code rate according to the current transcoding condition of the client, so that the transcoded video can be smoothly received and decoded and played at the client, high-definition real-time video transcoding based on the client condition is realized, and the phenomenon of blockage in the real-time transcoding and playing of the video is favorably avoided.
(2) The method and the system for transcoding the real-time video, disclosed by the invention, can monitor the bandwidth information of the client in real time, adaptively adjust the code rate of video transcoding within a certain bandwidth condition, and transcode the video at a proper fixed code rate under a better bandwidth condition, thereby not only improving the playing definition of the video at the client, but also avoiding the phenomenon that the video data obtained by transcoding is too large, and the transcoding, the video transmission and the decoding are inconvenient.
(3) According to the method and the system for real-time video transcoding, the request of the client for reducing the code rate is received, the video transcoding is carried out according to the code rate which the client wants to adjust, when the client encounters unsmooth video playing caused by unstable bandwidth, the playing definition can be reduced in time according to the request of the client, so that the video can be played normally, and the use experience of a user is improved.
Of course, it is not necessary for any product in which the present invention is practiced to achieve all of the above-described technical effects simultaneously.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a schematic flowchart of a method for transcoding a real-time video according to embodiment 1 of the present invention;
fig. 2 is a schematic flowchart of a method for transcoding a real-time video according to embodiment 2 of the present invention;
fig. 3 is a schematic flowchart of a method for transcoding a real-time video according to embodiment 3 of the present invention;
fig. 4 is a flowchart illustrating a method for transcoding a real-time video according to embodiment 4 of the present invention;
fig. 5 is a flowchart illustrating a method for transcoding a real-time video according to embodiment 5 of the present invention;
fig. 6 is a schematic structural diagram of a system for transcoding real-time video according to embodiment 6 of the present invention;
fig. 7 is a schematic structural diagram of a system for real-time video transcoding according to embodiment 7 of the present invention;
fig. 8 is a schematic structural diagram of a system for transcoding real-time video according to embodiment 8 of the present invention;
fig. 9 is a schematic structural diagram of a system for real-time video transcoding according to embodiment 9 of the present invention;
fig. 10 is a schematic structural diagram of a system for transcoding real-time video according to embodiment 10 of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Example 1
As shown in fig. 1, which is a schematic flow chart of a method for transcoding a real-time video according to this embodiment, the present embodiment provides a method for decoding a real-time video based on a user-side decoding playing condition, where the method includes the following steps:
step 101, receiving a video playing request of a client, analyzing the video playing request to obtain a decoder model and an expected video code rate of the client, and obtaining a corresponding video from a database according to the video playing request.
It is now common for users to watch videos through clients, especially watch real-time videos such as sports events videos through networks on mobile terminals, but the users are limited by mobile network bandwidth, and when watching videos through clients, the requirements of users on high definition cannot be met, but the bandwidth conditions and transcoding and decoding conditions are different for each user. The method comprises the steps of receiving a video playing request sent by a client, obtaining a video requested to be played and the decoding capacity of a user terminal from a database, determining the decoding capacity of the user terminal according to the model of a hardware decoder or a software decoder of the terminal, obtaining a corresponding expected transcoding code rate according to the requirement of the user on definition in the video playing request, and carrying out early-stage preparation work for subsequent transcoding for improving the video playing definition.
Step 102, monitoring the bandwidth of a client, obtaining the code rate increasing rate of a video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; and increasing the expected video code rate by a code rate increasing multiple to obtain the target code rate.
The current bandwidths of different clients are different, if the same video transcoding playing mode is used for transcoding playing, a user with better bandwidth cannot obtain video playing with higher definition, and a user with not good bandwidth can obtain video transcoding playing with high definition, which causes the problem of playing blockage, and is not beneficial to the watching experience of the user. The ratio of the current bandwidth to the expected video code rate of the user represents the higher definition transcoding degree which can be borne by the current bandwidth of the user to a certain extent, and the higher definition transcoding allowed by the current bandwidth is obtained through the corresponding relation between the code rate increasing rate obtained by actual video watching and the preset code rate increasing multiple, so that the method is favorable for customizing a proper video transcoding playing mode for each user side. Wherein, the code rate improvement multiple can be 1 to 1.5 times of the expected video code rate. If the code rate is increased by too much, the transcoding pressure of the server is caused, and the transcoding cost is high.
And 103, obtaining a video transmission quantity according to the ratio of the bandwidth to the target code rate, and obtaining a transcoding format of the video according to the corresponding relation between the video transmission quantity and a preset transcoding format.
The video transmission capacity can reflect the transmission capacity of the transcoded video obtained after transcoding under the current bandwidth, and the size and the definition of the transcoded video obtained by transcoding through different transcoding formats are different. According to the practical situation, each video transmission quantity corresponds to the most appropriate transcoding format, and the corresponding transcoding format can be automatically obtained by determining the current video transmission quantity of a certain client, so that the labor consumption in the video transcoding process is reduced, and the video transcoding cost is reduced.
And step 104, obtaining the transcoding image group quantity of the video according to the corresponding relation between the video transmission quantity, the decoder model and the image group quantity in the preset video transcoding slice.
If decode the broadcast at the client after transcoding video wholly, just need transmit whole video transcoding to the client after, carry out whole decoding again, at this in-process, the user need wait for whole decoding behind the video transmission, can increase the broadcast pressure of decoding at the client undoubtedly, increases user's latency simultaneously, still can lead to the video card problem of pause to appear.
And 105, taking the image groups with the number of the transcoding image groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded.
The frame group is a basic unit for video playing, and the problem that video frames are lost after video slices are combined into a whole video cannot occur by taking the frame group as a unit in the process of carrying out slice transcoding on the video. For some videos, especially live videos, the video files are generally acquired while the videos are transcoded and played, the acquired non-transcoded videos are subjected to transcoding playing after being sliced, the definition of video playing can be improved, and meanwhile the video decoding and playing efficiency of a client side is improved.
Step 106, transcoding the video slices with a target code rate and a transcoding format to obtain video transcoding fragments, and recording timestamps of the video transcoding fragments; and transmitting the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
When the video transcoding fragments obtained after the video slice transcoding are transmitted to the client, the video transcoding fragments are not necessarily arranged according to the playing sequence, and only when the video fragments are transmitted according to the time stamp sequence of video playing, the video decoding playing sequence at the client is ensured, so that the video can be normally played with high definition.
Example 2
As shown in fig. 2, a schematic flow chart of a method for transcoding a real-time video in this embodiment is shown, and this embodiment is a preferred embodiment provided on the basis of embodiment 1 above, and the method includes the following steps:
step 201, receiving a video playing request of a client, analyzing the video playing request to obtain a decoder model and an expected video code rate of the client, and obtaining a corresponding video from a database according to the video playing request.
Step 202, monitoring the bandwidth of the client, and when the bandwidth is greater than or equal to a bandwidth threshold, increasing the expected video code rate by a fixed increase multiple to obtain a target code rate of video transcoding.
The code rate of video transcoding is improved, the transcoding pressure of a transcoding server is increased, and the video file obtained through transcoding is increased correspondingly. Therefore, an upper limit of the bitrate increase factor needs to be set to ensure that the transcoding cost on the server is not too high. Alternatively, the fixed boost factor may be in the range of 1.5 to 2 times the desired code rate.
Step 203, obtaining the code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; and increasing the expected video code rate by a code rate increasing multiple to obtain the target code rate.
For the client side beyond the fixed lifting multiple, the adaptive code rate lifting multiple is obtained according to the actual transcoding condition of the client side, the requirement of improving the video playing definition of the client side can be met, and the problem of video playing pause caused by overlarge transcoded video files is avoided. The adaptive code rate improvement multiple can be in the range of 1 to 1.5 times.
And 204, obtaining the video transmission quantity according to the ratio of the bandwidth to the target code rate, and obtaining the transcoding format of the video according to the corresponding relation between the video transmission quantity and the preset transcoding format.
And step 205, obtaining the transcoding image group quantity of the video according to the corresponding relation between the video transmission quantity, the decoder model and the image group quantity in the preset video transcoding slice.
And step 206, taking the image groups with the number of the transcoding image groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded.
Step 207, transcoding the video slices with a target code rate and a transcoding format to obtain video transcoding fragments, and recording timestamps of the video transcoding fragments; and transmitting the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
Example 3
As shown in fig. 3, a schematic flow chart of a method for transcoding a real-time video in this embodiment is shown, and this embodiment is a preferred embodiment provided on the basis of the foregoing embodiment 2, and the method includes the following steps:
step 301, receiving a video playing request of a client, analyzing the video playing request to obtain a decoder model and an expected video code rate of the client, and obtaining a corresponding video from a database according to the video playing request.
Step 302, monitoring the bandwidth of the client, obtaining a historical bandwidth record of the client in a set time period, calculating the proportion that the bandwidth is greater than or equal to a bandwidth threshold in the historical bandwidth record, and when the proportion reaches or exceeds the proportion threshold and the current bandwidth is greater than or equal to the bandwidth threshold, increasing the expected video code rate by a fixed increase multiple to obtain the target code rate of video transcoding.
And 303, when the proportion reaches or exceeds a proportion threshold value and the current bandwidth is less than a bandwidth threshold value, taking the expected video code rate as a target code rate of video transcoding.
According to the proportion that the bandwidth in the historical bandwidth record of the client is greater than or equal to the bandwidth threshold, the general condition of the bandwidth of the client is reflected, and the problem that video playing is blocked because the video exceeding the decoding adaptive capacity of the client is sent to the client due to the accidental factor of the bandwidth is avoided.
Step 304, obtaining a code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining a code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and a preset code rate increasing multiple; and increasing the expected video code rate by a code rate increasing multiple to obtain the target code rate.
And 305, obtaining a video transmission amount according to the ratio of the bandwidth to the target code rate, and obtaining a transcoding format of the video according to the corresponding relation between the video transmission amount and the preset transcoding format.
And step 306, obtaining the transcoding image group quantity of the video according to the corresponding relation between the video transmission quantity, the decoder model and the image group quantity in the preset video transcoding slice.
And 307, taking the image groups with the number of the transcoding image groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded.
Step 308, transcoding the video slices with a target code rate and a transcoding format to obtain video transcoding fragments, and recording timestamps of the video transcoding fragments; and transmitting the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
Example 4
As shown in fig. 4, a schematic flow chart of a method for transcoding a real-time video in this embodiment is shown, and this embodiment is a preferred embodiment provided on the basis of embodiment 1 above, and the method includes the following steps:
step 401, receiving a video playing request of a client, analyzing the video playing request to obtain a decoder model and an expected video code rate of the client, and obtaining a corresponding video from a database according to the video playing request.
Step 402, monitoring the bandwidth of the client, obtaining the code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; and increasing the expected video code rate by a code rate increasing multiple to obtain the target code rate.
And 403, obtaining a video transmission amount according to the ratio of the bandwidth to the target code rate, and obtaining a transcoding format of the video according to the corresponding relation between the video transmission amount and the preset transcoding format.
And step 404, obtaining the transcoding image group number of the video according to the corresponding relation between the video transmission amount, the decoder model and the image group number in the preset video transcoding slice.
And 405, detecting the number of to-be-transcoded image groups of the image frames which are not transcoded in the video, and when the number of the to-be-transcoded image groups is greater than or equal to the number of the transcoded image groups, taking the image groups with the number of the transcoded image groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slice to be transcoded.
When a video is sliced, especially when some live video slices are sliced, the number of a part of picture groups is not enough for one video transcoding slice, and if the rest of the picture groups are not processed, the problem that the transcoded picture groups are lost can occur. Therefore, in the embodiment, the remaining picture groups of less than one video transcoding slice are combined into one video transcoding slice for transcoding, which is beneficial to ensuring the continuity of video playing pictures.
And step 406, when the number of the groups of pictures to be transcoded is less than the number of the groups of pictures to be transcoded, taking the image frames which are not transcoded as the video slices to be transcoded.
Step 407, transcoding the video slices with a target code rate and a transcoding format to obtain video transcoding fragments, and recording timestamps of the video transcoding fragments; and transmitting the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
Example 5
As shown in fig. 5, a schematic flow diagram of a method for transcoding a real-time video in this embodiment is shown, where this embodiment is a preferred embodiment provided on the basis of embodiment 1 above, and the method includes the following steps:
step 501, receiving a video playing request of a client, analyzing the video playing request to obtain a decoder model and an expected video code rate of the client, and obtaining a corresponding video from a database according to the video playing request.
Step 502, monitoring the bandwidth of a client, obtaining the code rate increasing rate of a video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; and increasing the expected video code rate by a code rate increasing multiple to obtain the target code rate.
Step 503, obtaining a video transmission amount according to the ratio of the bandwidth to the target code rate, and obtaining a transcoding format of the video according to the corresponding relationship between the video transmission amount and the preset transcoding format.
And step 504, obtaining the transcoding image group quantity of the video according to the corresponding relation between the video transmission quantity, the decoder model and the image group quantity in the preset video transcoding slice.
And 505, taking the image groups with the number of the transcoding image groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded.
Step 506, transcoding the video slices with a target code rate and a transcoding format to obtain video transcoding fragments, and recording timestamps of the video transcoding fragments; and transmitting the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
And 507, receiving an adjustment request of the expected video code rate of the client, and when the adjusted expected video code rate is smaller than the current expected video code rate, taking the adjusted expected video code rate as a target code rate of video transcoding.
The client side can also encounter various uncertain factors in the process of playing the transcoded video, so that the problem of video playing jam or unsmooth is caused. At this time, the user can request to reduce the definition of video playing through the client, and the transcoding server end can realize normal playing of the video at the client by adjusting the corresponding transcoding code rate after receiving the request for reducing the definition of video playing of the client.
Example 6
As shown in fig. 6, the schematic structural diagram of the system for transcoding a real-time video according to this embodiment is a schematic structural diagram, where the system according to this embodiment is used to implement the method for transcoding a real-time video according to the foregoing embodiment, and the system includes: the video transcoding system comprises a video playing request receiving module 601, a video transcoding target code rate generating module 602, a video transcoding format obtaining module 603, a video transcoding group number obtaining module 604, a to-be-transcoded video slicing module 605 and a video slicing transcoding module 606.
The video playing request receiving module 601 is connected to the video transcoding target code rate generating module 602, and is configured to receive a video playing request from a client, analyze the video playing request to obtain a decoder model and an expected video code rate of the client, and obtain a corresponding video from a database according to the video playing request.
The video transcoding target code rate generating module 602 is connected to the video playing request receiving module 601 and the video transcoding format obtaining module 603, and is configured to monitor a bandwidth of the client, obtain a code rate increase rate of the video according to a ratio of the bandwidth to an expected video code rate, and obtain a code rate increase multiple of the video according to a corresponding relationship between the code rate increase rate and a preset code rate increase multiple; and increasing the expected video code rate by a code rate increasing multiple to obtain the target code rate.
The video transcoding format obtaining module 603 is connected to the video transcoding target code rate generating module 602 and the video slice transcoding module 606, and is configured to obtain a video transmission amount according to a ratio of the bandwidth to the target code rate, and obtain a transcoding format of the video according to a corresponding relationship between the video transmission amount and a preset transcoding format.
The video transcoding group number obtaining module 604 is connected to the video transcoding target code rate generating module 603 and the to-be-transcoded video slicing module 605, and is configured to obtain the transcoding group number of the video according to a corresponding relationship between the video transmission amount, the decoder model, and the group number in the preset video transcoding slice.
The to-be-transcoded video slice module 605 is connected to the video transcoding group number obtaining module 604 and the video slice transcoding module 606, and is configured to use a group of frames with the number of transcoding groups as a video transcoding slice, and slice an image frame that is not transcoded in the video to obtain a to-be-transcoded video slice.
The video slice transcoding module 606 is connected to the video transcoding format obtaining module 603 and the to-be-transcoded video slice module 605, and is configured to transcode the video slices with the target code rate and the transcoding format to obtain video transcoding fragments, and record timestamps of the video transcoding fragments; and transmitting the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
Example 7
As shown in fig. 7, which is a schematic structural diagram of a system for real-time video transcoding according to this embodiment, this embodiment is a preferred embodiment provided on the basis of the foregoing embodiment 6, and the system includes: the video transcoding system comprises a video playing request receiving module 701, a video transcoding target code rate generating module 702, a video transcoding format obtaining module 703, a video transcoding image group number obtaining module 704, a to-be-transcoded video slicing module 705 and a video slicing transcoding module 706.
The video playing request receiving module 701 is connected to the video transcoding target code rate generating module 702, and is configured to receive a video playing request from a client, analyze the video playing request to obtain a decoder model and an expected video code rate of the client, and obtain a corresponding video from a database according to the video playing request.
The video transcoding target bitrate generating module 702 is further: fixed multiple target code rate generating section 721 and adaptive multiple target code rate generating section 722.
The fixed multiple target code rate generating unit 721 is connected to the video playing request receiving module 701, the video transcoding format obtaining module 703 and the adaptive multiple target code rate generating unit 722, and is configured to monitor the bandwidth of the client, and when the bandwidth is greater than or equal to the bandwidth threshold, increase the expected video code rate by the fixed increase multiple to obtain the target code rate of video transcoding.
The adaptive multiple target code rate generating unit 722 is connected to the video playing request receiving module 701, the video transcoding format obtaining module 703 and the fixed multiple target code rate generating unit 721, and is configured to obtain a code rate increasing rate of the video according to a ratio of the bandwidth to the expected video code rate when the bandwidth is smaller than the bandwidth threshold, and obtain a code rate increasing multiple of the video according to a corresponding relationship between the code rate increasing rate and a preset code rate increasing multiple; and increasing the expected video code rate by a code rate increasing multiple to obtain the target code rate.
The video transcoding format obtaining module 703 is connected to the video transcoding target code rate generating module 702 and the video slice transcoding module 706, and is configured to obtain a video transmission amount according to a ratio of the bandwidth to the target code rate, and obtain a transcoding format of the video according to a corresponding relationship between the video transmission amount and a preset transcoding format.
The video transcoding group number obtaining module 704 is connected to the video transcoding target code rate generating module 703 and the to-be-transcoded video slicing module 705, and is configured to obtain the transcoding group number of the video according to a corresponding relationship between the video transmission amount, the decoder model, and the group number in the preset video transcoding slice.
The to-be-transcoded video slice module 705 is connected to the video transcoding group number obtaining module 704 and the video slice transcoding module 706, and is configured to use a group of frames with the number of transcoding groups as a video transcoding slice, and slice an image frame that is not transcoded in the video to obtain a to-be-transcoded video slice.
The video slice transcoding module 706 is connected to the video transcoding format obtaining module 703 and the to-be-transcoded video slice module 705, and is configured to transcode the video slices with the target code rate and the transcoding format to obtain video transcoding fragments, and record timestamps of the video transcoding fragments; and transmitting the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
Example 8
As shown in fig. 8, which is a schematic structural diagram of a system for real-time video transcoding according to this embodiment, this embodiment is a preferred embodiment provided on the basis of the foregoing embodiment 7, and the system includes: a video playing request receiving module 801, a video transcoding target code rate generating module 802, a video transcoding format obtaining module 803, a video transcoding group number obtaining module 804, a to-be-transcoded video slicing module 805, and a video slicing transcoding module 806.
The video playing request receiving module 801 is connected to the video transcoding target bitrate generating module 802, and is configured to receive a video playing request from a client, analyze the video playing request to obtain a decoder model and an expected video bitrate of the client, and obtain a corresponding video from a database according to the video playing request.
The video transcoding target bitrate generating module 802 further comprises: fixed multiple target code rate generating section 821, target code rate adjusting section 822, and adaptive multiple target code rate generating section 823.
The fixed multiple target code rate generating unit 821 is connected to the video playing request receiving module 801, the video transcoding format obtaining module 803, the adaptive multiple target code rate generating unit 823 and the target code rate adjusting unit 822, and is configured to monitor a bandwidth of the client, obtain a historical bandwidth record of the client in a set time period, calculate a ratio of the bandwidth in the historical bandwidth record being greater than or equal to a bandwidth threshold, and increase the expected video code rate by a fixed multiple of increase to obtain a target code rate of video transcoding when the ratio reaches or exceeds the ratio threshold and the current bandwidth is greater than or equal to the bandwidth threshold.
The target bitrate adjusting unit 822 is connected to the adaptive multiple target bitrate generating unit 823 and the fixed multiple target bitrate generating unit 821, and takes the expected video bitrate as a target bitrate of video transcoding when the ratio reaches or exceeds the ratio threshold and the current bandwidth is less than the bandwidth threshold.
The adaptive multiple target code rate generating unit 823 is connected to the video playing request receiving module 801, the video transcoding format obtaining module 803, the fixed multiple target code rate generating unit 821 and the target code rate adjusting unit 822, and is configured to obtain a code rate increase rate of the video according to a ratio of the bandwidth to the expected video code rate when the bandwidth is smaller than the bandwidth threshold, and obtain a code rate increase multiple of the video according to a corresponding relationship between the code rate increase rate and a preset code rate increase multiple; and increasing the expected video code rate by a code rate increasing multiple to obtain the target code rate.
The video transcoding format obtaining module 803 is connected to the video transcoding target code rate generating module 802 and the video slice transcoding module 806, and is configured to obtain a video transmission amount according to a ratio of the bandwidth to the target code rate, and obtain a transcoding format of the video according to a corresponding relationship between the video transmission amount and a preset transcoding format.
The video transcoding group number obtaining module 804 is connected to the video transcoding target code rate generating module 803 and the to-be-transcoded video slicing module 805, and is configured to obtain the transcoding group number of the video according to a corresponding relationship between the video transmission amount, the decoder model, and the group number in the preset video transcoding slice.
The to-be-transcoded video slice module 805 is connected to the video transcoding group number obtaining module 804 and the video slice transcoding module 806, and is configured to use a group of frames in the transcoding group number as a video transcoding slice, and slice an image frame that is not transcoded in the video to obtain a to-be-transcoded video slice.
The video slice transcoding module 806 is connected to the video transcoding format obtaining module 803 and the to-be-transcoded video slice module 805, and configured to transcode the video slices with the target code rate and the transcoding format to obtain video transcoding fragments, and record timestamps of the video transcoding fragments; and transmitting the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
Example 9
As shown in fig. 9, which is a schematic structural diagram of a system for real-time video transcoding according to this embodiment, this embodiment is a preferred embodiment provided on the basis of the foregoing embodiment 6, and the system includes: the video transcoding system comprises a video playing request receiving module 901, a video transcoding target code rate generating module 902, a video transcoding format obtaining module 903, a video transcoding group number obtaining module 904, a to-be-transcoded video slicing module 905 and a video slicing transcoding module 906.
The video playing request receiving module 901 is connected to the video transcoding target code rate generating module 902, and is configured to receive a video playing request from a client, analyze the video playing request to obtain a decoder model and an expected video code rate of the client, and obtain a corresponding video from a database according to the video playing request.
The video transcoding target code rate generating module 902 is connected with the video playing request receiving module 901 and the video transcoding format obtaining module 903, and is configured to monitor a bandwidth of the client, obtain a code rate increase rate of the video according to a ratio of the bandwidth to an expected video code rate, and obtain a code rate increase multiple of the video according to a corresponding relationship between the code rate increase rate and a preset code rate increase multiple; and increasing the expected video code rate by a code rate increasing multiple to obtain the target code rate.
The video transcoding format obtaining module 903 is connected to the video transcoding target code rate generating module 902 and the video slice transcoding module 906, and is configured to obtain a video transmission amount according to a ratio of the bandwidth to the target code rate, and obtain a transcoding format of the video according to a corresponding relationship between the video transmission amount and a preset transcoding format.
The video transcoding group number obtaining module 904 is connected to the video transcoding target code rate generating module 903 and the to-be-transcoded video slicing module 905, and is configured to obtain the transcoding group number of the video according to a corresponding relationship between the video transmission amount, the decoder model, and the group number in the preset video transcoding slice.
The to-be-transcoded video slicing module 905 further includes: a video slice unit 951 and a video slice adjustment unit 952.
The video slicing unit 951 is connected to the video transcoding group number acquisition module 904, the video slice transcoding module 906 and the video slice adjustment unit 952, and is configured to detect the number of groups of images to be transcoded of an image frame that is not transcoded in a video, and when the number of groups of images to be transcoded is greater than or equal to the number of transcoding groups of images, slice the image frame that is not transcoded in the video into a video transcoding slice, so as to obtain a video slice to be transcoded.
The video slice adjusting unit 952 is connected to the video transcoding group number obtaining module 904, the video slice transcoding module 906, and the video slicing unit 951, and takes an image frame that is not transcoded as a video slice to be transcoded when the number of groups of pictures to be transcoded is less than the number of groups of pictures to be transcoded.
Example 10
As shown in fig. 10, which is a schematic structural diagram of a system for real-time video transcoding according to this embodiment, this embodiment is a preferred embodiment provided on the basis of the foregoing embodiment 6, and the system includes: the video transcoding system comprises a video playing request receiving module 1001, a video transcoding target code rate generating module 1002, a video transcoding format obtaining module 1003, a video transcoding picture group number obtaining module 1004, a to-be-transcoded video slicing module 1005, a video slicing transcoding module 1006 and a video code rate adjusting module 1007.
The video playing request receiving module 1001 is connected to the video transcoding target bitrate generating module 1002, and is configured to receive a video playing request from a client, analyze the video playing request to obtain a decoder model and an expected video bitrate of the client, and obtain a corresponding video from a database according to the video playing request.
The video transcoding target code rate generating module 1002 is connected to the video playing request receiving module 1001, the video transcoding format obtaining module 1003 and the video code rate adjusting module 1007, and is configured to monitor a bandwidth of the client, obtain a code rate increase rate of the video according to a ratio of the bandwidth to an expected video code rate, and obtain a code rate increase multiple of the video according to a corresponding relationship between the code rate increase rate and a preset code rate increase multiple; and increasing the expected video code rate by a code rate increasing multiple to obtain the target code rate.
The video transcoding format obtaining module 1003 is connected to the video transcoding target code rate generating module 1002 and the video slice transcoding module 1006, and is configured to obtain a video transmission amount according to a ratio of the bandwidth to the target code rate, and obtain a transcoding format of the video according to a corresponding relationship between the video transmission amount and a preset transcoding format.
The video transcoding group number obtaining module 1004 is connected to the video transcoding target code rate generating module 1003 and the to-be-transcoded video slicing module 1005, and is configured to obtain the transcoding group number of the video according to a corresponding relationship between the video transmission amount, the decoder model, and the group number in the preset video transcoding slice.
The to-be-transcoded video slice module 1005 is connected to the video transcoding group number obtaining module 1004 and the video slice transcoding module 1006, and is configured to use a group of frames of the transcoding group number as a video transcoding slice, and slice an image frame that is not transcoded in the video to obtain a to-be-transcoded video slice.
The video slice transcoding module 1006 is connected to the video transcoding format obtaining module 1003 and the to-be-transcoded video slice module 1005, and is configured to transcode the video slices with the target code rate and the transcoding format to obtain video transcoding fragments, and record timestamps of the video transcoding fragments; and transmitting the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
The video bitrate adjusting module 1007 is connected to the video transcoding target bitrate generating module 1002, and is configured to receive an adjustment request of an expected video bitrate of a client, and when the adjusted expected video bitrate is smaller than a current expected video bitrate, use the adjusted expected video bitrate as a target bitrate of video transcoding.
According to the embodiment, the method and the system for transcoding the real-time video have the following beneficial effects that:
(1) according to the method and the system for transcoding the real-time video, on the basis that the client requests the transcoding code rate, the transcoding conditions such as the bandwidth and the transcoding processing capacity of the client are analyzed, and the video is subjected to the mode of transmitting after the segmented transcoding with the moderately improved code rate according to the current transcoding condition of the client, so that the transcoded video can be smoothly received and decoded and played at the client, high-definition real-time video transcoding based on the client condition is realized, and the phenomenon of blockage in the real-time transcoding and playing of the video is favorably avoided.
(2) The method and the system for transcoding the real-time video, disclosed by the invention, can monitor the bandwidth information of the client in real time, adaptively adjust the code rate of video transcoding within a certain bandwidth condition, and transcode the video at a proper fixed code rate under a better bandwidth condition, thereby not only improving the playing definition of the video at the client, but also avoiding the phenomenon that the video data obtained by transcoding is too large, and the transcoding, the video transmission and the decoding are inconvenient.
(3) According to the method and the system for real-time video transcoding, the request of the client for reducing the code rate is received, the video transcoding is carried out according to the code rate which the client wants to adjust, when the client encounters unsmooth video playing caused by unstable bandwidth, the playing definition can be reduced in time according to the request of the client, so that the video can be played normally, and the use experience of a user is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Although some specific embodiments of the present invention have been described in detail by way of examples, it should be understood by those skilled in the art that the above examples are for illustrative purposes only and are not intended to limit the scope of the present invention. It will be appreciated by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.
Claims (10)
1. A method of real-time video transcoding, comprising:
receiving a video playing request of a client, analyzing the video playing request to obtain a decoder model and an expected video code rate of the client, and acquiring a corresponding video from a database according to the video playing request;
monitoring the bandwidth of the client, obtaining the code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; increasing the expected video code rate by the code rate increase multiple to obtain a target code rate;
obtaining a video transmission quantity according to the ratio of the bandwidth to the target code rate, and obtaining a transcoding format of the video according to the corresponding relation between the video transmission quantity and a preset transcoding format;
obtaining the transcoding image group quantity of the video according to the corresponding relation between the video transmission quantity, the decoder model and the image group quantity in a preset video transcoding slice;
taking the image groups with the number of the transcoding image groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain a video slice to be transcoded;
transcoding the video slice according to the target code rate and the transcoding format to obtain a video transcoding fragment, and recording a timestamp of the video transcoding fragment; and sending the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
2. The method for transcoding real-time video according to claim 1, comprising: monitoring the bandwidth of the client, obtaining the code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; increasing the expected video code rate by the code rate increase multiple to obtain a target code rate, further comprising:
monitoring the bandwidth of the client, and when the bandwidth is greater than or equal to a bandwidth threshold, increasing the expected video code rate by a fixed increase multiple to obtain a target code rate of the video transcoding;
when the bandwidth is smaller than the bandwidth threshold, obtaining the code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and a preset code rate increasing multiple; and increasing the expected video code rate by the code rate increase multiple to obtain a target code rate.
3. The method of real-time video transcoding of claim 2, wherein a bandwidth of the client is monitored, and when the bandwidth is greater than or equal to a bandwidth threshold, the desired video bitrate is increased by a fixed increase factor to obtain a target bitrate of the video transcoding, and further comprising:
monitoring the bandwidth of the client, acquiring a historical bandwidth record of the client in a set time period, calculating the proportion that the bandwidth is greater than or equal to a bandwidth threshold value in the historical bandwidth record, and increasing the expected video code rate by a fixed increase factor to obtain the target code rate of the video transcoding when the proportion reaches or exceeds the proportion threshold value and the current bandwidth is greater than or equal to the bandwidth threshold value;
and when the proportion reaches or exceeds a proportion threshold value and the current bandwidth is less than the bandwidth threshold value, taking the expected video bitrate as a target bitrate of the video transcoding.
4. The method of real-time video transcoding of claim 1, wherein the group of pictures with the number of the group of transcoded pictures is a video transcoding slice, and the image frames that are not transcoded in the video are sliced to obtain the video slice to be transcoded, further comprising:
detecting the number of picture groups to be transcoded of the image frames which are not transcoded in the video, and when the number of the picture groups to be transcoded is larger than or equal to the number of the transcoded picture groups, taking the picture groups of the number of the transcoded picture groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded;
and when the number of the image groups to be transcoded is less than the number of the transcoded image groups, taking the image frames which are not transcoded as the video slices to be transcoded.
5. The method for real-time video transcoding of claim 1, further comprising:
and receiving an adjustment request of the expected video code rate of the client, and taking the adjusted expected video code rate as a target code rate of the video transcoding when the adjusted expected video code rate is smaller than the current expected video code rate.
6. A system for real-time video transcoding, comprising: the system comprises a video playing request receiving module, a video transcoding target code rate generating module, a video transcoding format obtaining module, a video transcoding image group number obtaining module, a to-be-transcoded video slicing module and a video slicing transcoding module; wherein,
the video playing request receiving module is used for being connected with the video transcoding target code rate generating module, receiving a video playing request of a client, analyzing the video playing request to obtain a decoder model and an expected video code rate of the client, and acquiring a corresponding video from a database according to the video playing request;
the video transcoding target code rate generating module is used for being connected with the video playing request receiving module and the video transcoding format obtaining module, monitoring the bandwidth of the client, obtaining the code rate increasing rate of the video according to the ratio of the bandwidth to the expected video code rate, and obtaining the code rate increasing multiple of the video according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; increasing the expected video code rate by the code rate increase multiple to obtain a target code rate;
the video transcoding format acquisition module is used for being connected with the video transcoding target code rate generation module and the video slice transcoding module, obtaining video transmission quantity according to the ratio of the bandwidth to the target code rate, and obtaining the transcoding format of the video according to the corresponding relation between the video transmission quantity and the preset transcoding format;
the video transcoding image group quantity acquisition module is used for being connected with the video transcoding target code rate generation module and the video slice module to be transcoded and acquiring the transcoding image group quantity of the video according to the corresponding relation between the video transmission quantity, the decoder model and the image group quantity in the preset video transcoding slice;
the video slice module to be transcoded is used for being connected with the video transcoding image group number acquisition module and the video slice transcoding module, taking the image groups of the transcoding image group number as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded;
the video slice transcoding module is used for being connected with the video transcoding format acquisition module and the to-be-transcoded video slice module, transcoding the video slices with the target code rate and the transcoding format to obtain video transcoding fragments, and recording timestamps of the video transcoding fragments; and sending the video transcoding fragments to the client according to the sequence of the timestamps from front to back.
7. The system for real-time video transcoding of claim 6, wherein the video transcoding target bitrate generation module is further configured to: a fixed multiple target code rate generating unit and an adaptive multiple target code rate generating unit; wherein,
the fixed multiple target code rate generating unit is used for being connected with the video playing request receiving module, the video transcoding format obtaining module and the adaptive multiple target code rate generating unit, monitoring the bandwidth of the client, and when the bandwidth is larger than or equal to a bandwidth threshold value, increasing the expected video code rate by a fixed increase multiple to obtain the target code rate of the video transcoding;
the adaptive multiple target code rate generating unit is used for being connected with the video playing request receiving module, the video transcoding format obtaining module and the fixed multiple target code rate generating unit, when the bandwidth is smaller than the bandwidth threshold, the code rate increasing rate of the video is obtained according to the ratio of the bandwidth to the expected video code rate, and the code rate increasing multiple of the video is obtained according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; and increasing the expected video code rate by the code rate increase multiple to obtain a target code rate.
8. The system for real-time video transcoding of claim 7, wherein the video transcoding target bitrate generation module is further configured to: a fixed multiple target code rate generating unit, a target code rate adjusting unit and an adaptive multiple target code rate generating unit; wherein,
the fixed multiple target code rate generating unit is used for being connected with the video playing request receiving module, the video transcoding format obtaining module, the adaptive multiple target code rate generating unit and the target code rate adjusting unit, monitoring the bandwidth of the client, obtaining a historical bandwidth record of the client in a set time period, calculating the proportion of the bandwidth in the historical bandwidth record which is larger than or equal to a bandwidth threshold, and increasing the expected video code rate by a fixed multiple to obtain the target code rate of the video transcoding when the proportion reaches or exceeds the proportion threshold and the current bandwidth is larger than or equal to the bandwidth threshold;
the target code rate adjusting unit is used for being connected with the adaptive multiple target code rate generating unit and the fixed multiple target code rate generating unit, and when the proportion reaches or exceeds a proportion threshold value and the current bandwidth is smaller than the bandwidth threshold value, the expected video code rate is used as the target code rate of the video transcoding;
the adaptive multiple target code rate generating unit is used for being connected with the video playing request receiving module, the video transcoding format obtaining module, the fixed multiple target code rate generating unit and the target code rate adjusting unit, when the bandwidth is smaller than the bandwidth threshold, the code rate increasing rate of the video is obtained according to the ratio of the bandwidth to the expected video code rate, and the code rate increasing multiple of the video is obtained according to the corresponding relation between the code rate increasing rate and the preset code rate increasing multiple; and increasing the expected video code rate by the code rate increase multiple to obtain a target code rate.
9. The system for real-time video transcoding of claim 6, wherein the video slice to be transcoded module is further configured to: a video slice unit and a video slice adjusting unit; wherein,
the video slice unit is used for being connected with the video transcoding image group number acquisition module, the video slice transcoding module and the video slice adjustment unit, detecting the number of image groups to be transcoded of image frames which are not transcoded in the video, and when the number of the image groups to be transcoded is larger than or equal to the number of the transcoding image groups, taking the image groups with the number of the transcoding image groups as a video transcoding slice, and slicing the image frames which are not transcoded in the video to obtain the video slices to be transcoded;
and the video slice adjusting unit is used for being connected with the video transcoding image group quantity acquiring module, the video slice transcoding module and the video slice unit, and taking the image frames which are not transcoded as the video slices to be transcoded when the quantity of the image groups to be transcoded is less than the quantity of the transcoding image groups.
10. The system for real-time video transcoding of claim 6, further comprising: and the video code rate adjusting module is used for connecting with the video transcoding target code rate generating module, receiving an adjusting request of the expected video code rate of the client, and taking the adjusted expected video code rate as the target code rate of the video transcoding when the adjusted expected video code rate is smaller than the current expected video code rate.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710292663.9A CN106993199A (en) | 2017-04-28 | 2017-04-28 | A kind of method and system of real-time video transcoding |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710292663.9A CN106993199A (en) | 2017-04-28 | 2017-04-28 | A kind of method and system of real-time video transcoding |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN106993199A true CN106993199A (en) | 2017-07-28 |
Family
ID=59417114
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710292663.9A Pending CN106993199A (en) | 2017-04-28 | 2017-04-28 | A kind of method and system of real-time video transcoding |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106993199A (en) |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109753207A (en) * | 2017-11-02 | 2019-05-14 | 腾讯科技(深圳)有限公司 | A kind of information processing method and its device, storage medium |
| CN109769125A (en) * | 2018-12-06 | 2019-05-17 | 北京东方广视科技股份有限公司 | Dynamic adjusting method, media server and the transcoding server of streaming media bit rate |
| CN109788316A (en) * | 2019-02-27 | 2019-05-21 | 腾讯科技(深圳)有限公司 | Code rate control, video transcoding method and device, computer equipment and storage medium |
| CN110418197A (en) * | 2018-05-11 | 2019-11-05 | 腾讯科技(深圳)有限公司 | A kind of video transcoding method, device and computer readable storage medium |
| CN112584156A (en) * | 2020-11-18 | 2021-03-30 | 卓旺(安徽)航空科技产业股份有限公司 | Transcoding 4K video algorithm based on 2K video data deep learning |
| CN114286194A (en) * | 2021-12-08 | 2022-04-05 | 北京金山云网络技术有限公司 | Instant messaging video processing method and device, electronic equipment and storage medium |
| CN115314723A (en) * | 2022-06-17 | 2022-11-08 | 百果园技术(新加坡)有限公司 | Initial gear video stream transmission method, device, equipment and storage medium |
| WO2024082770A1 (en) * | 2022-10-19 | 2024-04-25 | 抖音视界有限公司 | Video transcoding method and apparatus, and device, storage medium and video on-demand system |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101778104A (en) * | 2009-12-29 | 2010-07-14 | 常州中流电子科技有限公司 | System and method for playing stream media by using self-adaption bandwidth |
| CN101945278A (en) * | 2010-09-15 | 2011-01-12 | 中国科学院深圳先进技术研究院 | Video self-adaptive transcoding method and system |
| CN103167318A (en) * | 2011-12-13 | 2013-06-19 | 中国电信股份有限公司 | Streaming media processing method, device, server and system |
| CN103561279A (en) * | 2013-10-10 | 2014-02-05 | 中兴通讯股份有限公司 | Method and system for playing multi-media file and cloud transcoding service device |
| CN104202660A (en) * | 2014-09-15 | 2014-12-10 | 乐视网信息技术(北京)股份有限公司 | Video dividing and transcoding method and device |
| US20160316235A1 (en) * | 2014-03-31 | 2016-10-27 | Arris Enterprises Llc | Adaptive streaming transcoder synchronization |
| CN106254867A (en) * | 2016-08-08 | 2016-12-21 | 暴风集团股份有限公司 | Based on picture group, video file is carried out the method and system of transcoding |
-
2017
- 2017-04-28 CN CN201710292663.9A patent/CN106993199A/en active Pending
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101778104A (en) * | 2009-12-29 | 2010-07-14 | 常州中流电子科技有限公司 | System and method for playing stream media by using self-adaption bandwidth |
| CN101945278A (en) * | 2010-09-15 | 2011-01-12 | 中国科学院深圳先进技术研究院 | Video self-adaptive transcoding method and system |
| CN103167318A (en) * | 2011-12-13 | 2013-06-19 | 中国电信股份有限公司 | Streaming media processing method, device, server and system |
| CN103561279A (en) * | 2013-10-10 | 2014-02-05 | 中兴通讯股份有限公司 | Method and system for playing multi-media file and cloud transcoding service device |
| US20160316235A1 (en) * | 2014-03-31 | 2016-10-27 | Arris Enterprises Llc | Adaptive streaming transcoder synchronization |
| CN104202660A (en) * | 2014-09-15 | 2014-12-10 | 乐视网信息技术(北京)股份有限公司 | Video dividing and transcoding method and device |
| CN106254867A (en) * | 2016-08-08 | 2016-12-21 | 暴风集团股份有限公司 | Based on picture group, video file is carried out the method and system of transcoding |
Cited By (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109753207A (en) * | 2017-11-02 | 2019-05-14 | 腾讯科技(深圳)有限公司 | A kind of information processing method and its device, storage medium |
| CN109753207B (en) * | 2017-11-02 | 2021-12-10 | 腾讯科技(深圳)有限公司 | Information processing method and device and storage medium |
| CN110418197A (en) * | 2018-05-11 | 2019-11-05 | 腾讯科技(深圳)有限公司 | A kind of video transcoding method, device and computer readable storage medium |
| CN110418197B (en) * | 2018-05-11 | 2022-03-08 | 腾讯科技(深圳)有限公司 | Video transcoding method and device and computer readable storage medium |
| CN109769125A (en) * | 2018-12-06 | 2019-05-17 | 北京东方广视科技股份有限公司 | Dynamic adjusting method, media server and the transcoding server of streaming media bit rate |
| CN109788316A (en) * | 2019-02-27 | 2019-05-21 | 腾讯科技(深圳)有限公司 | Code rate control, video transcoding method and device, computer equipment and storage medium |
| CN109788316B (en) * | 2019-02-27 | 2020-08-14 | 腾讯科技(深圳)有限公司 | Code rate control method and device, video transcoding method and device, computer equipment and storage medium |
| CN112584156A (en) * | 2020-11-18 | 2021-03-30 | 卓旺(安徽)航空科技产业股份有限公司 | Transcoding 4K video algorithm based on 2K video data deep learning |
| CN114286194A (en) * | 2021-12-08 | 2022-04-05 | 北京金山云网络技术有限公司 | Instant messaging video processing method and device, electronic equipment and storage medium |
| CN114286194B (en) * | 2021-12-08 | 2024-05-03 | 北京金山云网络技术有限公司 | Instant messaging video processing method and device, electronic equipment and storage medium |
| CN115314723A (en) * | 2022-06-17 | 2022-11-08 | 百果园技术(新加坡)有限公司 | Initial gear video stream transmission method, device, equipment and storage medium |
| CN115314723B (en) * | 2022-06-17 | 2023-12-12 | 百果园技术(新加坡)有限公司 | Method, device, equipment and storage medium for transmitting initial gear video stream |
| WO2024082770A1 (en) * | 2022-10-19 | 2024-04-25 | 抖音视界有限公司 | Video transcoding method and apparatus, and device, storage medium and video on-demand system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106993199A (en) | A kind of method and system of real-time video transcoding | |
| US11700419B2 (en) | Re-encoding predicted picture frames in live video stream applications | |
| KR101614632B1 (en) | Signaling characteristics of segments for network streaming of media data | |
| US10771823B1 (en) | Presentation of composite streams to users | |
| US20250201251A1 (en) | Intelligent data delivery | |
| CA2583028C (en) | A video compression system | |
| US8654849B2 (en) | Integrated transcoding | |
| US20170347159A1 (en) | Qoe analysis-based video frame management method and apparatus | |
| EP2710808B1 (en) | Distributing audio video content | |
| US20160037176A1 (en) | Automatic and adaptive selection of profiles for adaptive bit rate streaming | |
| CN202799004U (en) | Video playback terminal and video playback system | |
| US20180077385A1 (en) | Data, multimedia & video transmission updating system | |
| US20210352347A1 (en) | Adaptive video streaming systems and methods | |
| KR101978922B1 (en) | FoV on the background frame streaming method of high quality 360 degree video data by separately transmitting the region of interest and the background frame | |
| US10609383B2 (en) | Video compression using down-sampling patterns in two phases | |
| US20060294128A1 (en) | Enhanced methods for media processing and distribution | |
| EP3264709B1 (en) | A method for computing, at a client for receiving multimedia content from a server using adaptive streaming, the perceived quality of a complete media session, and client | |
| US10893309B2 (en) | Method and apparatus for automatic HLS bitrate adaptation | |
| WO2021181681A1 (en) | Mathematical model derivation device, mathematical model derivation method, and program | |
| US10681105B2 (en) | Decision engine for dynamically selecting media streams | |
| CN117676266A (en) | Video stream processing method and device, storage medium, electronic equipment | |
| Li et al. | A determining method of frame rate and resolution to boost the video live qoe | |
| Kwon et al. | A novel video quality impairment monitoring scheme over an ipty service with packet loss | |
| CN120034662A (en) | Video data processing 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 | ||
| TA01 | Transfer of patent application right | ||
| TA01 | Transfer of patent application right |
Effective date of registration: 20170912 Address after: 100041, room 2, building 3, building 30, Xing Xing street, Shijingshan District, Beijing, Applicant after: Storm sports (Beijing) Co., Ltd. Address before: 100083 Beijing, Xueyuan Road No. 51, the first to enjoy the science and technology building, floor 6, Applicant before: Storm group Limited by Share Ltd |
|
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170728 |