Video transcoding method, device, live broadcast server, terminal device and storage medium

By setting the alignment interval and encoding the target video stream in the live video broadcast, the problem of difficulty in adjusting the user's clarity adaptability is solved, and efficient encoding of live video broadcast is achieved, reducing bandwidth costs and improving user experience.

CN116170609BActive Publication Date: 2024-11-12GUANGZHOU HUYA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310075440.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-01
Publication Date
2024-11-12
Estimated Expiration
2043-02-01

AI Technical Summary

Technical Problem

In the live video scenario, the user's network environment, equipment processing capabilities and personal preferences vary greatly, resulting in difficulty in adjusting the adaptability of video clarity. The existing video transcoding methods have low encoding flexibility, making it impossible to achieve seamless clarity switching, and increase The bandwidth cost of the live broadcast platform.

Method used

By obtaining the source video stream and decoding, the alignment interval is set as the switching point based on the source video stream's GOP, and the decoded video stream is encoded as the target definition level to ensure that the I-frame interval of the target video stream is greater than the GOP of the source video stream. Improve the encoding compression rate, and maintain the PTS correspondence of I frames in the frame structure to achieve seamless clarity switching.

Benefits of technology

It improves the encoding compression rate, reduces the bandwidth cost of the live broadcast platform, improves coding flexibility, ensures user experience, and reduces the operating costs of the live broadcast platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116170609B_ABST
    Figure CN116170609B_ABST
Patent Text Reader

Abstract

The present application discloses a video transcoding method, apparatus, live broadcast server, terminal device and computer-readable storage medium. The video transcoding method comprises: obtaining a source video stream and decoding it; based on the first GOP of the source video stream, setting an alignment interval, the alignment interval representing the interval between every two adjacent I frames that can be used as a switching point, the alignment interval being greater than the first GOP, and the switching point representing the clarity level switching position; based on the alignment interval, encoding the decoded source video stream into a target video stream of a target clarity level; wherein the interval between every two adjacent I frames that can be used as a switching point in the frame structure of the target video stream is the alignment interval, and the PTS of the I frame that can be used as a switching point in the frame structure of the target video stream can correspond to the I frame in the frame structure of the source video stream, so that the encoding scheme of the target video stream is not restricted by the encoding scheme of the source video stream, thereby improving the encoding flexibility, thereby reducing the bandwidth cost of the live broadcast platform while ensuring the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video live broadcasting, and in particular to a video transcoding method, apparatus, live broadcast server, terminal device, and computer-readable storage medium. Background Art

[0002] In a live video broadcast scenario, there are many users watching the live broadcast. The network environment, device processing capabilities and personal preferences of each user vary greatly and change frequently. There are diverse needs for video viewing. To meet the diverse needs of users for video viewing, the live broadcast platform can transcode the video source uploaded by the anchor to output multiple optional video clarity levels, such as original picture, Blu-ray, ultra-clear, smooth and other levels. The higher the video clarity level, the better the user experience, but the user also needs better network conditions and device decoding capabilities. Therefore, it is necessary to adaptively adjust the video clarity level according to the user's own network conditions and changes in device decoding capabilities to ensure sufficient clarity while allowing users to watch the live video more smoothly.

[0003] Video transcoding refers to converting a compressed and encoded video stream (such as the original picture) into another video stream, namely a transcoded video stream (such as ultra-clear), which is a process of decoding first and then encoding. The presentation time stamp (PTS) refers to the timestamp of the rendering of the video frame in the video stream, which increases in the order of rendering. In order to ensure the smoothness of the live video picture while adaptively adjusting the video clarity, it is necessary to achieve seamless switching of clarity when switching the clarity. For this reason, when transcoding the video, each frame in the frame structure of the transcoded video stream (such as Blu-ray, ultra-clear, smooth, etc.) needs to be the same type of frame as the frame corresponding to the PTS in the frame structure of the original picture video stream. Therefore, the encoding scheme of the transcoded video stream is limited by the encoding scheme of the original picture video stream, and the encoding flexibility is low. Summary of the invention

[0004] In view of the above technical problems, the present application provides a video transcoding method, device, live broadcast server, terminal device and computer-readable storage medium. The technical solutions are as follows:

[0005] According to a first aspect of the present application, a video transcoding method is provided, which is applied to a live video broadcasting scenario, and the method comprises:

[0006] Get the source video stream and decode it;

[0007] Based on the first GOP of the source video stream, an alignment interval is set, wherein the alignment interval represents an interval between every two adjacent I frames that can be used as a switching point, the alignment interval is greater than the first GOP, and the switching point represents a definition gear switching position;

[0008] Based on the alignment interval, the decoded source video stream is encoded into a target video stream of a target clarity level; wherein the interval between every two adjacent I frames in the frame structure of the target video stream that can serve as the switching point is the alignment interval, and the PTS of the I frame in the frame structure of the target video stream that can serve as the switching point can correspond to the I frame in the frame structure of the source video stream.

[0009] According to a second aspect of the present application, a video transcoding device is provided, the device comprising:

[0010] A decoding unit, used for acquiring and decoding a source video stream;

[0011] A setting unit, configured to set an alignment interval based on a first GOP of the source video stream, wherein the alignment interval represents an interval between every two adjacent I frames that can be used as a switching point, the alignment interval is greater than the first GOP, and the switching point represents a definition gear switching position;

[0012] An encoding unit is used to encode the decoded source video stream into a target video stream of a target definition level based on the alignment interval; wherein the interval between every two adjacent I frames in the frame structure of the target video stream that can serve as the switching point is the alignment interval, and the PTS of the I frame in the frame structure of the target video stream that can serve as the switching point can correspond to the I frame in the frame structure of the source video stream.

[0013] According to a third aspect of the present application, a live broadcast server is provided, the live broadcast server comprising:

[0014] processor;

[0015] a memory for storing processor-executable instructions;

[0016] The processor is configured to implement the method as described in the first aspect.

[0017] According to a fourth aspect of the present application, a terminal device is provided, which is equipped with a live broadcast client for executing the method according to the first aspect, and the terminal device includes:

[0018] processor;

[0019] a memory for storing processor-executable instructions;

[0020] The processor is configured to implement the method as described in the first aspect.

[0021] According to a fifth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the method described in the first aspect are implemented.

[0022] The technical solution provided by the present application is that the compression rate of the coded frames of type I frame in the frame structure of the video stream is relatively low. After video transcoding, in the frame structure of the target video stream at the target clarity level, the interval between every two adjacent I frames that can be used as switching points is made greater than the GOP of the source video stream, so that the number of I frames of the target video stream is reduced relative to the number of I frames of the source video stream, thereby improving the coding compression rate and reducing the bandwidth cost of the live broadcast platform. At the same time, the PTS of the I frame that can be used as a switching point in the frame structure of the target video stream can correspond to the I frame in the frame structure of the source video stream, and seamless switching of clarity can be achieved when switching clarity levels, thereby ensuring user experience. The coding scheme of the target video stream is not limited by the coding scheme of the source video stream, thereby improving coding flexibility, thereby reducing the bandwidth cost of the live broadcast platform while ensuring user experience.

[0023] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0025] Figure 1 is a schematic diagram of a video coding structure of a related technology;

[0026] Figure 2 It is a schematic diagram of the transcoding gear frame structure of the related technology;

[0027] Figure 3 It is a flowchart of a video transcoding method according to an embodiment of the present application;

[0028] Figure 4 is a flowchart of a video transcoding method according to another embodiment of the present application;

[0029] Figure 5 This is a schematic diagram of a transcoding gear frame structure of an embodiment of the present application;

[0030] Figure 6 is a schematic diagram of a transcoding gear frame structure of another embodiment of the present application;

[0031] Figure 7 is a structural schematic diagram of a video transcoding device according to an embodiment of the present application;

[0032] Figure 8 This is a structural diagram of a live broadcast service end according to an embodiment of the present application;

[0033] Fig. 9 It is a structural diagram of a live broadcast client according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field should fall within the scope of protection of this application.

[0035] First, the video live broadcast scenario is introduced. In the video live broadcast scenario, there are many users watching the live broadcast. The network environment, device processing capabilities and personal preferences of each user are quite different and change frequently. There are diverse needs for video viewing. To meet the diverse needs of users for video viewing, the live broadcast platform can transcode the video source uploaded by the anchor to output multiple optional video clarity levels, such as original picture, Blu-ray, ultra-clear, smooth and other levels. The higher the video clarity level, the better the user experience, but the user also needs better network conditions and device decoding capabilities. Therefore, it is necessary to adaptively adjust the video clarity level according to the user's own network conditions and changes in device decoding capabilities to ensure sufficient clarity while allowing users to watch the live video more smoothly.

[0036] See also Figure 1 , the video coding structure of the related technology is exemplified below. In the related technology, when encoding a video stream, the video encoder can encode it into three different types of frames: intra-coded picture (I frame), predictive-coded picture (P frame), and bidirectionally predicted picture (B frame). Among them, the I frame adopts the intra-frame prediction technology and does not rely on the independent decoding of the previous and next frames. The P frame can refer to the previous frame for unidirectional prediction, and the B frame can refer to the previous and next frames for bidirectional prediction. The I frame can be used as the position for switching the clarity gear. The interval between an I frame and the next I frame can be called an I frame interval, that is, a group of picture (GOP). Among the three frame types, the compression rate of the I frame is lower. If the I frame interval, that is, the GOP, is small, the number of I frames will be large and the encoding compression rate will be small.

[0037] See also Figure 2, the following is an exemplary description of the transcoding gear frame structure of the related technology. Video transcoding refers to converting a compressed and encoded video stream (such as the original picture) into another video stream, namely a transcoding gear video stream (such as ultra-clear), which is a process of decoding first and then encoding. The presentation timestamp (PTS) refers to the timestamp of the video frame rendering in the video stream, which increases in the order of rendering. In order to ensure the smoothness of live video images while adaptively adjusting the video clarity, it is necessary to achieve seamless clarity switching when switching clarity. For this reason, during video transcoding, each frame in the frame structure of the transcoded video stream (such as Blu-ray, ultra-clear, smooth, etc.) needs to be the same type of frame as the frame corresponding to the PTS in the frame structure of the original video stream, that is, each I frame of the original video stream must be aligned with the I frame in the transcoded video stream. If the I frame interval of the original video stream, i.e., GOP, is small, such as 0.5s, then the I frame interval in the transcoded video stream must also be 0.5s, and GOP=0.5S itself is an unreasonable setting, which greatly reduces the encoding compression rate. Therefore, the encoding scheme of the transcoded video stream is limited by the encoding scheme of the original video stream, and the encoding flexibility is low.

[0038] It should be noted that, in the above-mentioned live video broadcast scenario, the introduction of the video encoding structure and the transcoding gear frame structure of the related technology is only an exemplary description. In actual applications, in addition to the above-mentioned structure, the embodiments of the present application can also be applied to other structures, and there is no specific limitation on this.

[0039] In view of the above problems, an embodiment of the present application provides a video transcoding method that can be used in video live broadcasting scenarios to improve encoding flexibility, thereby reducing the bandwidth cost of the live broadcasting platform while ensuring user experience. Figure 3 As shown, the method comprises the following steps:

[0040] S301, obtaining and decoding a source video stream;

[0041] As an example, the source video stream may be a video stream obtained by encoding a video stream at an original frame rate and then transmitting the video stream.

[0042] S302, based on the first GOP of the source video stream, setting an alignment interval, the alignment interval represents the interval between every two adjacent I frames that can be used as a switching point, the alignment interval is greater than the first GOP, and the switching point represents a definition gear switching position;

[0043] As an example, before decoding the source video stream, the alignment interval can be set based on the first GOP of the source video stream so that the alignment interval is larger than the first GOP. The alignment interval can also be set after decoding the source video stream. There is no specific limitation on the node for setting the alignment interval.

[0044] S303. Based on the alignment interval, encode the decoded source video stream into a target video stream of a target definition level; wherein the interval between every two adjacent I frames in the frame structure of the target video stream that can serve as the switching point is the alignment interval, and the PTS of the I frame in the frame structure of the target video stream that can serve as the switching point can correspond to the I frame in the frame structure of the source video stream.

[0045] As an example, the value of the alignment interval is less than or equal to the buffer size of the playback end, thereby ensuring the continuity of the playback screen and preventing screen interruption. It is worth noting that the above alignment interval value is only an exemplary description, and other values ​​of the alignment interval are not excluded in practical applications. For example, the alignment interval value is greater than the buffer size of the playback end, and there is no specific limitation on this.

[0046] As an example, the alignment interval is set before encoding. In one encoding process, encoding can be performed according to the preset alignment interval. In the next encoding, encoding can be performed according to the previously preset alignment interval, or the alignment interval can be reset and encoded according to the new alignment interval.

[0047] As an example, the target video stream of the target definition level may be a video stream of a blue-ray level, an ultra-high definition level, or a smooth level. There is no specific limitation on the definition level of the target video stream.

[0048] For example, the PTS of the I frame that can serve as the switching point in the frame structure of the target video stream can correspond to the I frame in the frame structure of the source video stream. For example, if the PTS of the I frame at a switching point in the target video stream is 6, then in the transcoded source video stream, the frame with a PTS of 6 is also an I frame.

[0049] The technical solution provided by the embodiment of the present application is that the compression rate of the coded frames of type I frame in the frame structure of the video stream is relatively low. After video transcoding, in the frame structure of the target video stream at the target clarity level, the interval between every two adjacent I frames that can be used as switching points is made greater than the GOP of the source video stream, so that the number of I frames of the target video stream is reduced relative to the number of I frames of the source video stream, thereby improving the coding compression rate and reducing the bandwidth cost of the live broadcast platform. At the same time, the PTS of the I frame that can be used as a switching point in the frame structure of the target video stream can correspond to the I frame in the frame structure of the source video stream, and can achieve seamless switching of clarity when switching clarity levels, thereby ensuring user experience. The coding scheme of the target video stream is not limited by the coding scheme of the source video stream, thereby improving coding flexibility, thereby reducing the bandwidth cost of the live broadcast platform while ensuring user experience.

[0050] See also Figure 4In order to make the target video stream with the target definition level play with better picture quality and more continuous images, and to identify the I frame as a switching point without relying solely on the frame type, the present application provides another embodiment of a video transcoding method, which determines certain encoded image frames as non-switching point I frames during the encoding process, and marks the I frames as switching points while increasing the alignment interval of the I frames as switching points. Figure 4 As shown, the method comprises the following steps:

[0051] S401, obtaining and decoding a source video stream;

[0052] As an example, the source video stream may be an original-frame video stream.

[0053] S402, based on the first GOP of the source video stream, setting an alignment interval, the alignment interval represents the interval between every two adjacent I frames that can be used as a switching point, the alignment interval is greater than the first GOP, and the switching point represents a definition gear switching position;

[0054] As an example, before decoding the source video stream, the alignment interval can be set based on the first GOP of the source video stream so that the alignment interval is larger than the first GOP. The alignment interval can also be set after decoding the source video stream. There is no specific limitation on the node for setting the alignment interval.

[0055] S403. Based on the alignment interval, encode the decoded source video stream into a target video stream of a target definition level; wherein the interval between every two adjacent I frames in the frame structure of the target video stream that can serve as the switching point is the alignment interval, and the PTS of the I frame in the frame structure of the target video stream that can serve as the switching point can correspond to the I frame in the frame structure of the source video stream.

[0056] As an example, the value of the alignment interval is less than or equal to the buffer size of the playback end, thereby ensuring the continuity of the playback screen and preventing screen interruption. It is worth noting that the above alignment interval value is only an exemplary description, and other values ​​of the alignment interval are not excluded in practical applications. For example, the alignment interval value is greater than the buffer size of the playback end, and there is no specific limitation on this.

[0057] As an example, the alignment interval is set before encoding. In one encoding process, encoding can be performed according to the preset alignment interval. In the next encoding, encoding can be performed according to the previously preset alignment interval, or the alignment interval can be reset and encoded according to the new alignment interval.

[0058] As an example, the target video stream of the target definition level may be a video stream of a blue-ray level, an ultra-high definition level, or a smooth level. There is no specific limitation on the definition level of the target video stream.

[0059] For example, the PTS of the I frame that can serve as the switching point in the frame structure of the target video stream can correspond to the I frame in the frame structure of the source video stream. For example, if the PTS of the I frame at a switching point in the target video stream is 6, then in the transcoded source video stream, the frame with a PTS of 6 is also an I frame.

[0060] S404: If it is detected during the encoding process that the picture difference between the currently encoded image frame and the previous image frame is greater than or equal to a threshold, the currently encoded image frame is determined as an I frame as a non-switching point.

[0061] As an example, if the difference between the current encoded image frame and the previous image frame is greater than or equal to a threshold, it can be understood that the pictures corresponding to the previous and next frames are quite different. In actual scenes, this can be manifested as: when live broadcasting through a camera, the live camera suddenly jumps from one picture to another; when live broadcasting a game, it suddenly switches from one perspective to another, or from one game to another; resulting in a large difference between the previous and next frames. It is worth noting that the above introduction to the scene of the difference between the previous and next frames is only an exemplary description. In actual applications, other scenes of the difference between the previous and next frames are not excluded, and there is no specific limitation on this.

[0062] As an example, the internal mechanism of the encoder may set a cost algorithm to determine the currently encoded image frame as an I frame that is not a switching point when the cost is acceptable.

[0063] As an example, determining the currently encoded image frame as an I frame as a non-switching point may be a random non-periodic behavior.

[0064] As an example, determining the currently encoded image frame as an I frame as a non-switching point may be to re-determine the currently encoded image frame as an I frame as a non-switching point when the currently encoded image frame is previously determined as a P frame or a B frame.

[0065] It is worth noting that the above method of determining the currently encoded image frame as an I frame as a non-switching point is only an exemplary description. In practical applications, other methods of determining an I frame as a non-switching point are not excluded and are not specifically limited to this.

[0066] As an example, the interval between the first I frame and the second I frame in the target video stream can be set as the second GOP, the first I frame is a non-switching point, the second I frame is a switching point, the second I frame is the previous I frame of the first I frame, and the first GOP is not equal to the second GOP. It is worth noting that the above second GOP size determination method is only an exemplary description, and other methods for determining the second GOP size are not excluded in actual applications, and are not specifically limited to this.

[0067] As an example, the I frame of the non-switching point can be determined based on the scene cut detection algorithm. It is worth noting that the above method of determining the I frame of the non-switching point is only an exemplary description. In practical applications, other methods of determining the I frame of the non-switching point are not excluded and are not specifically limited to this.

[0068] S405: During the encoding process, a switching point flag is set for the I frame that can serve as the switching point, so as to indicate the switching point when switching the definition level.

[0069] It should be noted that if seamless switching of clarity is to be achieved, the video images before and after the switch need to be continuous without jumps, and if the switching point p of clarity level A is currently being played, a switching point q equal to the PTS of the switching point p needs to be found in the target clarity level B. Therefore, a switching point flag needs to be set for the I frame that can be used as a switching point to indicate the switching point when switching the clarity level.

[0070] As an example, the switching point flag is carried in the supplemental enhancement information (SEI) field of the frame structure.

[0071] As an example, the SEI payload format may be designed to include: a prefix, a frame type, a data length, and data. The SEI payload format may also be designed in other forms, which are not specifically limited.

[0072] It can be understood that the video transcoding method described in any of the above embodiments can be executed by the server or the client. In actual applications, it can also be executed by other execution entities, which is not limited to this.

[0073] See also Figure 5 as well as Figure 6 , a specific application scenario of the transcoding gear frame structure mentioned in the embodiment of the present application is introduced below:

[0074] First, the original video stream is obtained and decoded; based on the GOP of the original video stream, the alignment interval t is set. The alignment interval t represents the interval between every two adjacent I frames that can be used as a switching point. The alignment interval t is greater than the GOP of the original video stream. The switching point represents the definition level switching position; based on the alignment interval t, the decoded source video stream is encoded into a target video stream of the target definition level. The frame structure of the target video stream is as follows: Figure 6As shown in the video stream of the B gear (transcoding gear) in the target video stream, wherein the A gear is used as a comparison with the B gear, and the A gear is a demonstration of the strict alignment of the frame structure with the original video stream in the related art; wherein the interval between every two adjacent I frames in the frame structure of the target video stream that can be used as the switching point is the alignment interval t, and the PTS of the I frame in the frame structure of the target video stream that can be used as the switching point can correspond to the I frame in the frame structure of the original video stream; the target video stream of the target definition gear can be a video stream of the gear such as the blue-ray gear, the ultra-clear gear or the smooth gear; as Figure 5 As shown, if it is detected during the encoding process that the picture difference between the current encoded image frame and the previous image frame is greater than or equal to the threshold, the current encoded image frame is determined as an I frame as a non-switching point; Figure 6 As shown in the B gear, the interval between the first I frame and the second I frame in the target video stream can be set to the second GOP, the size of the second GOP is n, the first I frame is a non-switching point, the second I frame is a switching point, the second I frame is the previous I frame of the first I frame, and the GOP of the original video stream is not equal to the second GOP; during the encoding process, a switching point flag is set for the I frame that can be used as a switching point to indicate the switching point when switching the clarity gear.

[0075] Corresponding to the above method embodiment, the present application also provides a video transcoding device, which can be applied to video live broadcasting scenarios, see Figure 7 As shown, the device may include:

[0076] A decoding unit 701, used to obtain and decode a source video stream;

[0077] A setting unit 702 is used to set an alignment interval based on a first GOP of the source video stream, wherein the alignment interval represents an interval between every two adjacent I frames that can be used as a switching point, the alignment interval is greater than the first GOP, and the switching point represents a definition gear switching position;

[0078] The encoding unit 703 is used to encode the decoded source video stream into a target video stream of a target clarity level based on the alignment interval; wherein the interval between every two adjacent I frames in the frame structure of the target video stream that can serve as the switching point is the alignment interval, and the PTS of the I frame in the frame structure of the target video stream that can serve as the switching point can correspond to the I frame in the frame structure of the source video stream.

[0079] This application also provides a live broadcast server, such as Figure 8 As shown, the live broadcast server includes:

[0080] Processor 801;

[0081] Memory 802 for storing processor executable instructions;

[0082] The processor 801 is configured to implement the video transcoding method described in any one of the above embodiments.

[0083] The present application also provides a terminal device, which is equipped with a live broadcast client that executes the video transcoding method described in any of the above embodiments, such as Fig. 9 As shown, the terminal device includes:

[0084] Processor 901;

[0085] Memory 902 for storing processor executable instructions;

[0086] The processor 901 is configured to implement the video transcoding method described in any one of the above embodiments.

[0087] The present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the video transcoding method described in any one of the above embodiments is implemented.

[0088] The above is only a specific implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A video transcoding method, applied to a live video broadcasting scenario, characterized in that: include: Get the source video stream and decode it; Based on the first GOP of the source video stream, an alignment interval is set, wherein the alignment interval represents an interval between every two adjacent I frames that can be used as a switching point, the alignment interval is greater than the first GOP, and the switching point represents a definition gear switching position; Based on the alignment interval, the decoded source video stream is encoded into a target video stream of a target clarity level; wherein the interval between every two adjacent I frames in the frame structure of the target video stream that can serve as the switching point is the alignment interval, and the PTS of the I frame in the frame structure of the target video stream that can serve as the switching point can correspond to the I frame in the frame structure of the source video stream.

2. The method according to claim 1, characterized in that The method further comprises: If it is detected during the encoding process that the picture difference between the currently encoded image frame and the previous image frame is greater than or equal to a threshold, the currently encoded image frame is determined as an I frame as a non-switching point.

3. The method according to claim 2, characterized in that The first GOP is not equal to the second GOP, and the second GOP is the interval between the first I frame and the second I frame in the target video stream, wherein the first I frame is a non-switching point, the second I frame is a switching point, and the second I frame is the previous I frame of the first I frame.

4. The method according to claim 2, characterized in that: The I-frames at the non-switching points are determined based on a scenecut algorithm.

5. The method according to claim 2, characterized in that: The method further comprises: In the encoding process, a switching point flag is set for the I frame that can serve as the switching point to indicate the switching point when the definition level is switched.

6. The method according to claim 5, characterized in that The switching point flag is carried in the SEI field of the frame structure.

7. The method according to claim 1, characterized in that The value of the alignment interval is less than or equal to the buffer size of the playback end.

8. A video transcoding device, applied to a video live broadcasting scenario, characterized in that: include: A decoding unit, used for acquiring and decoding a source video stream; A setting unit, configured to set an alignment interval based on a first GOP of the source video stream, wherein the alignment interval represents an interval between every two adjacent I frames that can be used as a switching point, the alignment interval is greater than the first GOP, and the switching point represents a definition gear switching position; An encoding unit is used to encode the decoded source video stream into a target video stream of a target definition level based on the alignment interval; wherein the interval between every two adjacent I frames in the frame structure of the target video stream that can serve as the switching point is the alignment interval, and the PTS of the I frame in the frame structure of the target video stream that can serve as the switching point can correspond to the I frame in the frame structure of the source video stream.

9. A live broadcast server, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method according to any one of claims 1 to 7.

10. A terminal device having a live broadcast client installed thereon for executing the method according to any one of claims 1 to 7, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method according to any one of claims 1 to 7.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.