A video same-screen transcoding method and device
By debugging the transcoding parameters according to the number of clients and network status in video same-screen transcoding, the problem of low smoothness of video transcoding in the existing technology is solved, and efficient playback and transcoding efficiency are improved.
Patent Information
- Application Number
- CN202410538286.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-04-30
AI Technical Summary
The existing video transcoding methods are not smooth and have low transcoding efficiency. On-site personnel need to slowly debug to find the best resolution, code rate and frame rate.
By obtaining the number and network status of the clients to be debugged, enter the debug mode, adjust the transcoding parameters according to the stuttering state when the client plays the sub-video until the preset conditions are met, and the optimal transcoding parameters are output.
It realizes the acquisition of optimal transcoding parameters based on the on-site network quality and the number of terminals, so that each client can play videos smoothly on the same screen after transcoding on the same screen, improving the transcoding efficiency and the same screen effect.
Smart Images

Figure CN118354133B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video transcoding, and in particular to a method and device for same-screen video transcoding. Background Art
[0002] Video transcoding refers to converting a compressed and encoded video stream into another video stream to adapt to different network bandwidths, different terminal processing capabilities, and different user needs. Transcoding is essentially a process of decoding first and then encoding, so the streams before and after the conversion may or may not follow the same video coding standard.
[0003] The process of video transcoding involves full decoding of the input video stream, video filtering or image processing, and full encoding of the output format. Transcoding technology has two implementation methods: software and hardware. The former usually uses high-speed computers or high-performance DSPs (Digital Signal Processors), while the latter generally uses dedicated ASICs (Application Specific Integrated Circuits) or FPGAs (Field Programmable Gate Arrays). For example, TI's general DSP business development manager believes that in the application of digital video encoding and decoding and transcoding, DSP is always the main platform in real-time processing.
[0004] The existing video same-screen transcoding method uses FFmpeg to transcode the video to the specified resolution, bit rate, and frame rate, and then sends it to the client for same-screen operation. However, due to the differences in on-site client configuration, number of clients, network bandwidth and other environments, the video converted with a fixed resolution, bit rate, and frame rate is prone to freeze when playing or on-screen. On-site personnel can only slowly debug and test the optimal resolution, bit rate, and frame rate, which is inefficient. Summary of the invention
[0005] The present invention provides a method and device for transcoding a video on the same screen, so as to solve the problems of low fluency and low transcoding efficiency of existing video on the same screen transcoding.
[0006] In order to solve the above technical problems, an embodiment of the present invention provides a video same-screen transcoding method, comprising:
[0007] Obtain each client to be debugged, and enter the debugging mode according to a preset debugging condition; the debugging condition includes the number of clients to be debugged;
[0008] Perform video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, and send the transcoded video stream and the corresponding video stream parameters to each client;
[0009] Obtain the same-screen freeze state of the video when the client plays the sub-video, adjust the transcoding parameters according to the freeze state until the preset conditions are met, exit the debugging mode, output the optimal transcoding parameters, and perform same-screen transcoding of the video to be transcoded according to the optimal transcoding parameters.
[0010] The present invention enters a debugging mode according to the on-site network quality and the number of terminals, and debugs the transcoding parameters according to the video same-screen freeze state when the client plays the sub-video, thereby obtaining the optimal transcoding parameters according to the on-site network quality and the number of terminals, so that after same-screen transcoding, each client can play the video on the same screen smoothly, thereby improving the transcoding efficiency and the same-screen effect.
[0011] Further, the obtaining of each client to be debugged and entering the debugging mode according to the preset debugging conditions is specifically as follows:
[0012] Obtain each client to be debugged, and detect the network status of the server and the client to be debugged according to a preset video same-screen requirement condition; the video same-screen requirement condition specifies the network status of the client to be debugged;
[0013] Get the number of clients to be debugged. If the optimal transcoding parameters are matched according to the number of clients to be debugged, if the match is successful, enter the video same-screen transcoding according to the optimal transcoding parameters; if the match fails, enter the debugging mode.
[0014] Furthermore, before performing video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, the method further includes:
[0015] Determine the transcoding parameters according to the number of clients to be debugged and the network status of each client to be debugged;
[0016] The transcoding parameters include the number of threads, bit rate, resolution and frame rate.
[0017] Further, the video to be transcoded is transcoded according to the preset first script and transcoding parameters, specifically:
[0018] Obtaining a video to be transcoded, and cutting the video to be transcoded according to a preset length;
[0019] Performing video transcoding on the intercepted sub-video according to the preset first script and the transcoding parameters;
[0020] The first script is used to adjust the transcoding parameters of this video transcoding.
[0021] Further, the obtaining of the video same-screen freeze state when the client plays the sub-video, and adjusting the transcoding parameters according to the freeze state, is specifically as follows:
[0022] Obtain statistical information when each client plays the sub-video, the statistical information including bandwidth, packet loss rate, and delay;
[0023] Obtain the playback status and buffering status of each client when playing the sub-video and the corresponding timestamp;
[0024] Determine the same-screen freeze state of the video according to the statistical information and the playback state, adjust the transcoding parameters according to the freeze state, and exit the debugging mode until the preset conditions are met.
[0025] In a second aspect, the present invention provides a video same-screen transcoding device, comprising: an information confirmation module, a transcoding module and a debugging module;
[0026] The information confirmation module is used to obtain each client to be debugged and enter the debugging mode according to a preset debugging condition; the debugging condition includes the number of clients to be debugged;
[0027] The transcoding module is used to perform video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, and send the transcoded video stream and the corresponding video stream parameters to each client;
[0028] The debugging module is used to obtain the video on-screen freeze state when the client plays the sub-video, adjust the transcoding parameters according to the freeze state until the preset conditions are met, exit the debugging mode, output the optimal transcoding parameters, and perform video on-screen transcoding on the video to be transcoded according to the optimal transcoding parameters.
[0029] Further, the obtaining of each client to be debugged and entering the debugging mode according to the preset debugging conditions is specifically as follows:
[0030] Obtain each client to be debugged, and detect the network status of the server and the client to be debugged according to a preset video same-screen requirement condition; the video same-screen requirement condition specifies the network status of the client to be debugged;
[0031] Obtain the number of clients to be debugged, and if the optimal transcoding parameters are matched according to the number of clients to be debugged, if the match is successful, enter the video same-screen transcoding according to the optimal transcoding parameters; if the match fails, enter the debugging mode;
[0032] Furthermore, before performing video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, the method further includes:
[0033] Determine the transcoding parameters according to the number of clients to be debugged and the network status of each client to be debugged;
[0034] The transcoding parameters include the number of threads, bit rate, resolution and frame rate.
[0035] Further, the video to be transcoded is transcoded according to the preset first script and transcoding parameters, specifically:
[0036] Obtaining a video to be transcoded, and cutting the video to be transcoded according to a preset length;
[0037] Performing video transcoding on the intercepted sub-video according to the preset first script and the transcoding parameters;
[0038] The first script is used to adjust the transcoding parameters of this video transcoding.
[0039] Further, the obtaining of the video same-screen freeze state when the client plays the sub-video, and adjusting the transcoding parameters according to the freeze state, is specifically as follows:
[0040] Obtain statistical information when each client plays the sub-video, the statistical information including bandwidth, packet loss rate, and delay;
[0041] Obtain the playback status and buffering status of each client when playing the sub-video and the corresponding timestamp;
[0042] Determine the same-screen freeze state of the video according to the statistical information and the playback state, adjust the transcoding parameters according to the freeze state, and exit the debugging mode until the preset conditions are met. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of a flow chart of a video same-screen transcoding method provided by an embodiment of the present invention DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] Embodiment 1
[0046] Please refer to Figure 1 , Figure 1 A schematic flow chart of a video same-screen transcoding method provided by an embodiment of the present invention includes steps 101 to 103, which are specifically as follows:
[0047] Step 101: Obtain each client to be debugged, and enter a debugging mode according to a preset debugging condition; the debugging condition includes the number of clients to be debugged;
[0048] In this embodiment, the acquisition of each client to be debugged and entering the debugging mode according to the preset debugging conditions are specifically as follows:
[0049] Obtain each client to be debugged, and detect the network status of the server and the client to be debugged according to a preset video same-screen requirement condition; the video same-screen requirement condition specifies the network status of the client to be debugged;
[0050] Obtain the number of clients to be debugged, and if the optimal transcoding parameters are matched according to the number of clients to be debugged, if the match is successful, enter the video same-screen transcoding according to the optimal transcoding parameters; if the match fails, enter the debugging mode;
[0051] In this embodiment, before entering the debugging mode, it is necessary to detect whether the network uplink and downlink from the server to the client meets the video same-screen requirement, and if not, a pop-up prompt will be displayed.
[0052] In this embodiment, the client screen operation requires a higher bandwidth to ensure that images and data can be transmitted quickly. Therefore, the video screen requirement conditions include uplink bandwidth and downlink bandwidth. According to the preset bandwidth threshold, it is determined whether the uplink bandwidth and downlink bandwidth of each client meet the bandwidth threshold. If they meet, the debugging mode is entered; if not, it is checked whether the network can be connected, whether the switch meets the bandwidth of 10Mbps and above, and debugging is performed according to the specific network problem until all clients meet the video screen requirement conditions.
[0053] As a specific example of an embodiment of the present invention, if there are 30 clients on the same screen, the minimum network bandwidth requirement must reach 70Mpbs. If it is too low, a prompt will pop up first, indicating that the video does not meet the same screen condition.
[0054] In this embodiment, the final transcoding parameters are matched in the optimal transcoding parameter table in the database according to the number of clients to be debugged. If the match fails, the initial transcoding parameters are set according to the number of clients to be debugged and the network status, and the debugging mode is entered according to the initial transcoding parameters.
[0055] In this embodiment, before performing video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, the method further includes:
[0056] Determine the transcoding parameters according to the number of clients to be debugged and the network status of each client to be debugged;
[0057] The transcoding parameters include the number of threads, bit rate, resolution and frame rate.
[0058] In this embodiment, different video resolutions, frame rates, and bit rates are used to perform transcoding debugging on the video so that the video can be played smoothly on the same screen, and different numbers of threads are set to make the transcoding efficiency more efficient.
[0059] Step 102: performing video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, and sending the transcoded video stream and the corresponding video stream parameters to each client;
[0060] In this embodiment, the video to be transcoded is transcoded according to the preset first script and transcoding parameters, specifically:
[0061] Obtaining a video to be transcoded, and cutting the video to be transcoded according to a preset length;
[0062] Performing video transcoding on the intercepted sub-video according to the preset first script and the transcoding parameters;
[0063] The first script is used to adjust the transcoding parameters of this video transcoding.
[0064] In this embodiment, after entering the debugging mode, the video to be transcoded is intercepted according to a preset ratio or length to obtain a sub-video, and then the intercepted sub-video is transcoded according to the preset first script and initial transcoding parameters.
[0065] In this embodiment, the efficiency of transcoding debugging is improved by intercepting the long video and debugging the sub-video.
[0066] As a specific example of an embodiment of the present invention, after entering the debugging mode, only the first 20 minutes of the video are captured for transcoding.
[0067] In this embodiment, the first script is implemented in PHP language, and video transcoding is implemented by calling FFmpeg through the first script.
[0068] As a specific example of the embodiment of the present invention, the first script is specifically: $command = "ffmpeg-threads{$threads}-i{$ol d_video}-codec:v h264-codec:a aac-b:v 12000k-r 30-ac 2-s 1920x1080-str i ct-2-y{$new_video}2>&1";
[0069] Among them, {$threads} is the number of threads A, which sets the number of threads for parallel processing, for example, 1, which can be automatically set according to the configuration of the server; -b:v 12000k is the bit rate B, which sets the target bit rate of the video to 12000kbps (kilobits per second). This determines the quality and compression of the video. -r 30: Set the frame rate C of the output video to 30 frames per second. This determines the smoothness of video playback. -s 1920x1080: Set the resolution D of the output video to 1920x1080. This will adjust the video to Full HD resolution. {$ol d_video} is the storage path for the video to be transcoded; {$new_video} is the storage path for the transcoded video.
[0070] In this embodiment, before sending the sub-video to each client, a connection between the server and the client needs to be established.
[0071] In this embodiment, a communication connection between the server and the client is established based on the webrtc software.
[0072] In this embodiment, in the client, WebRTC is used to create a video element and a connection object. The connection object is used to establish a connection with the server, and necessary information is exchanged through the signaling server. After the connection is established, the client can receive the media stream from the server. In the client, JavaScript and WebRTC API are used to monitor the media stream sent by the server. The received video stream is bound to the video element to be displayed on the client interface.
[0073] In this embodiment, the video transcoding process is set in the server. By installing nginx as an rtmp streaming media server using WebRTC technology, the video source is used as the media stream of the same screen of the server, thereby establishing a communication connection between the server and the client.
[0074] In this embodiment, the sub-video is transcoded according to the initial transcoding parameters, and after the connection is established, the transcoded sub-video is sent to each client.
[0075] In this embodiment, the media stream of the sub-video is obtained by using the getUserMedia() method through the MediaStream API, and then the media stream is passed to each client for playback. The status and parameter information of the video stream are obtained through the API.
[0076] Step 103: Obtain the video same-screen freeze state when the client plays the sub-video, adjust the transcoding parameters according to the freeze state until the preset conditions are met, exit the debugging mode, output the optimal transcoding parameters, and perform video same-screen transcoding on the video to be transcoded according to the optimal transcoding parameters.
[0077] In this embodiment, the obtaining of the video same-screen freeze state when the client plays the sub-video and adjusting the transcoding parameters according to the freeze state are specifically as follows:
[0078] Obtain statistical information when each client plays the sub-video, the statistical information including bandwidth, packet loss rate, and delay;
[0079] Obtain the playback status and buffering status of each client when playing the sub-video and the corresponding timestamp;
[0080] Determine the same-screen freeze state of the video according to the statistical information and the playback state, adjust the transcoding parameters according to the freeze state, and exit the debugging mode until the preset conditions are met.
[0081] In this embodiment, according to the webrtc related interface, it is obtained whether the sub-video is played on the same screen by each client and whether it is stuck.
[0082] In this embodiment, according to the RTCPeerConnection API: a point-to-point connection is established using the RTCPeerConnection object and video transmission is performed to obtain real-time statistical information of each client, including bandwidth, packet loss rate, delay, etc.
[0083] In this embodiment, it is also necessary to monitor the playback status, buffering status, timestamp, etc. of the video.
[0084] In this embodiment, by using HTML5<v i deo> The API provided by the .avi element or other video player libraries controls the video playback process to monitor the video playback status, buffering status, and timestamp.
[0085] In this embodiment, the performance API is used to monitor the performance indicators of the page, including the performance data of the video playback. The timestamp is obtained through the performance.now() method to calculate the playback frame rate and delay of the video, so as to determine the video on-screen freeze state after transcoding, and the video on-screen freeze state includes the video delay rate, video on-demand on-screen and server performance.
[0086] In this embodiment, transcoding parameters are adjusted according to the same-screen freeze state of the video.
[0087] In this embodiment, the transcoding parameters are adjusted according to the same-screen freeze state of the video, specifically: if the video is delayed, the parameter reduction is determined according to the delay rate, the transcoding parameters are reduced according to the parameter reduction, and the video is transcoded again with the reduced transcoding parameters, and the transcoding debugging process is repeated until the delay rate is lower than the preset delay threshold, the debugging mode is exited, and the optimal transcoding parameters are output.
[0088] In this embodiment, the number of clients to be debugged and the corresponding optimal transcoding parameters are stored in an optimal transcoding parameter table of a database.
[0089] As a specific example of an embodiment of the present invention, the current video to be transcoded is a one-hour 4K original video, and the number of clients to be debugged is 5.
[0090] In this embodiment, after entering debugging, the first 20 minutes of the video to be transcoded are captured for transcoding.
[0091] In this embodiment, initial transcoding parameters are set, and the transcoding parameters include bit rate, resolution, and frame rate, and are optimized in the order of bit rate, resolution, and frame rate.
[0092] In this embodiment, the video bitrate includes: Low Bitrate: usually between 500 kbps and 2 Mbps. Standard Definition (SD): usually between 2 Mbps and 5 Mbps. High Definition (HD): usually between 5 Mbps and 10 Mbps. Full HD: usually between 10 Mbps and 20 Mbps. Ultra HD or 4K: usually between 20 Mbps and 50 Mbps.
[0093] In this embodiment, the value range of the bit rate can be defined between 2Mbs-24Mbps, that is, 2000kbps-24000kbps, [2000, 2500, 3000...24000]. In between, the default initial values of the following parameters are fixed first, and then the values are taken through binary division, and the FFmpeg transcoding command is called to generate a video file with a bit rate of 15000kb, 30 frames, and 2k video, and then the video is operated on the same screen with webrtc.
[0094] In this embodiment, the transcoding command is: "ffmpeg-threads{$threads}-i{$old_video}-codec:v h264-codec:a aac-b:v 12000k-r 30-ac 2-s1920x1080-str i ct-2-y{$new_video}2>&1".
[0095] In this embodiment, a video element and a connection object are created through WebRTC. On the five clients, a same-screen link is established so that each client can get the same-screen resource from the server. The server calls the webrtc interface and the getStats() method to obtain real-time statistical information, including bandwidth, packet loss rate, and delay.
[0096] In this embodiment, the bandwidth threshold is set to a bandwidth of 2 Mbps. If the bandwidth is lower than 2 Mbps, the video quality may be blurred, stuck, or delayed; the packet loss rate threshold is set between 0% and 2%. A higher packet loss rate may cause video stuck, picture freeze, or audio interruption. The delay threshold is set at 100 milliseconds. A higher delay may cause asynchrony between video and audio.
[0097] In this embodiment, if the statistical information of the same-screen playback of the client does not meet the preset conditions, the transcoding parameters are reset according to the binary search method, and the video to be transcoded is further transcoded.
[0098] In this embodiment, if the video delay or packet loss rate is always maintained at a high level, a transcoding parameter with a larger value, a lower delay rate and a lower packet loss rate is adopted.
[0099] As a specific example of an embodiment of the present invention, for example, there are X: (10000kbps bit rate, delay rate 200ms, packet loss rate 2%) and Y: (12000kbps bit rate, delay rate 200ms, packet loss rate 2%), then the bit rate is taken as 12000kbps. If the current value still does not meet the preset conditions, then through the binary search method, for example, the next value is 12500kbps, and the original video is transcoded again according to the bit rate of 12500kbps, and FFmpeg is called for transcoding. If the delay rate and packet loss rate meet the preset conditions, then the debugging is stopped. If the delay rate and packet loss rate cannot meet the preset conditions, then the resolution is optimized according to the optimal bit rate.
[0100] In this embodiment, the resolutions include: 1080p (1920x1080): This is a full HD resolution, commonly seen in television, movies, and video streaming. 720p (1280x720): This is a high definition (HD) resolution, commonly seen in video conferencing, video games, and online streaming. 480p (640x480): This is a standard definition (SD) resolution, commonly seen in older televisions, camcorders, and video games. 360p (640x360): This is a low resolution, commonly seen in mobile devices.
[0101] In this embodiment, debugging and optimization are performed through binary search to obtain the optimal value, so that the delay rate and packet loss rate reach the preset conditions (delay rate is 100ms, packet loss rate is about 2%), and debugging is stopped, otherwise, the frame rate is optimized.
[0102] In this embodiment, the frame rate has a value range of [18 / 19 / 20 / 21...24 / 30... / 60]
[0103] In this embodiment, after obtaining the optimal bit rate, resolution, and frame rate, debugging is stopped and the debugging mode is exited.
[0104] In this embodiment, a debugging cycle can be set, and a debugging mode can be started according to the debugging cycle. At that time, parameters are continuously optimized according to whether there are multiple clients on site.
[0105] In this embodiment, by entering the debugging mode according to the on-site network quality and the number of terminals, and debugging the transcoding parameters according to the video same-screen freeze state when the client plays the sub-video, the optimal transcoding parameters are obtained according to the on-site network quality and the number of terminals, so that each client can smoothly play the video on the same screen after the same-screen transcoding, thereby improving the transcoding efficiency and the same-screen effect. The transcoding parameters can be automatically adjusted according to the increase or decrease in the number of on-site terminals to ensure maximum utilization of resources.
[0106] The embodiment of the present invention also provides a video same-screen transcoding device, including: an information confirmation module, a transcoding module and a debugging module;
[0107] The information confirmation module is used to obtain each client to be debugged and enter the debugging mode according to a preset debugging condition; the debugging condition includes the number of clients to be debugged;
[0108] The transcoding module is used to perform video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, and send the transcoded video stream and the corresponding video stream parameters to each client;
[0109] The debugging module is used to obtain the video on-screen freeze state when the client plays the sub-video, adjust the transcoding parameters according to the freeze state until the preset conditions are met, exit the debugging mode, output the optimal transcoding parameters, and perform video on-screen transcoding on the video to be transcoded according to the optimal transcoding parameters.
[0110] In this embodiment, the acquisition of each client to be debugged and entering the debugging mode according to the preset debugging conditions are specifically as follows:
[0111] Obtain each client to be debugged, and detect the network status of the server and the client to be debugged according to a preset video same-screen requirement condition; the video same-screen requirement condition specifies the network status of the client to be debugged;
[0112] Obtain the number of clients to be debugged, and if the optimal transcoding parameters are matched according to the number of clients to be debugged, if the match is successful, enter the video same-screen transcoding according to the optimal transcoding parameters; if the match fails, enter the debugging mode;
[0113] In this embodiment, before performing video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, the method further includes:
[0114] Determine the transcoding parameters according to the number of clients to be debugged and the network status of each client to be debugged;
[0115] The transcoding parameters include the number of threads, bit rate, resolution and frame rate.
[0116] In this embodiment, the video to be transcoded is transcoded according to the preset first script and transcoding parameters, specifically:
[0117] Obtaining a video to be transcoded, and cutting the video to be transcoded according to a preset length;
[0118] Performing video transcoding on the intercepted sub-video according to the preset first script and the transcoding parameters;
[0119] The first script is used to adjust the transcoding parameters of this video transcoding.
[0120] In this embodiment, the obtaining of the video same-screen freeze state when the client plays the sub-video and adjusting the transcoding parameters according to the freeze state are specifically as follows:
[0121] Obtain statistical information when each client plays the sub-video, the statistical information including bandwidth, packet loss rate, and delay;
[0122] Obtain the playback status and buffering status of each client when playing the sub-video and the corresponding timestamp;
[0123] Determine the same-screen freeze state of the video according to the statistical information and the playback state, adjust the transcoding parameters according to the freeze state, and exit the debugging mode until the preset conditions are met.
[0124] In this embodiment, by entering the debugging mode according to the on-site network quality and the number of terminals, and debugging the transcoding parameters according to the video same-screen freeze state when the client plays the sub-video, the optimal transcoding parameters are obtained according to the on-site network quality and the number of terminals, so that each client can smoothly play the video on the same screen after the same-screen transcoding, thereby improving the transcoding efficiency and the same-screen effect. The transcoding parameters can be automatically adjusted according to the increase or decrease in the number of on-site terminals to ensure maximum utilization of resources.
[0125] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A video same-screen transcoding method, characterized in that: include: Get each client to be debugged and enter the debugging mode according to the preset debugging conditions; The debugging conditions include the number of clients to be debugged; Performing video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, specifically: obtaining the video to be transcoded, and intercepting the video to be transcoded according to a preset length; performing video transcoding on the intercepted sub-video according to the preset first script and the transcoding parameters; The first script is used to adjust the transcoding parameters of this video transcoding; and send the transcoded video stream and the corresponding video stream parameters to each client; Obtain the same-screen freeze state of the video when the client plays the sub-video, and adjust the transcoding parameters according to the freeze state. Specifically: if the video is delayed, determine the parameter reduction according to the delay rate, reduce the transcoding parameters according to the parameter reduction, and perform video transcoding again with the reduced transcoding parameters, repeat the transcoding debugging process until the delay rate is lower than the preset delay threshold, exit the debugging mode, output the optimal transcoding parameters, and perform video same-screen transcoding on the video to be transcoded according to the optimal transcoding parameters; If the statistical information of the same-screen playback of the client does not meet the preset conditions, the transcoding parameters are reset according to the binary search method, and the video to be transcoded is further transcoded.
2. A video same-screen transcoding method as claimed in claim 1, characterized in that: The method of obtaining each client to be debugged and entering the debugging mode according to the preset debugging conditions is as follows: Obtain each client to be debugged, and detect the network status of the server and the client to be debugged according to a preset video same-screen requirement condition; the video same-screen requirement condition specifies the network status of the client to be debugged; Obtain the number of clients to be debugged, and if the optimal transcoding parameters are matched according to the number of clients to be debugged, if the match is successful, enter the video same-screen transcoding according to the optimal transcoding parameters; If the match fails, it enters debug mode.
3. A video same-screen transcoding method as claimed in claim 1, characterized in that: Before performing video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, the method further includes: Determine the transcoding parameters according to the number of clients to be debugged and the network status of each client to be debugged; The transcoding parameters include the number of threads, bit rate, resolution and frame rate.
4. A video same-screen transcoding method as claimed in claim 3, characterized in that: The obtaining of the video same-screen freeze state when the client plays the sub-video, and adjusting the transcoding parameters according to the freeze state are specifically: Obtain statistical information when each client plays the sub-video, the statistical information including bandwidth, packet loss rate, and delay; Obtain the playback status and buffering status of each client when playing the sub-video and the corresponding timestamp; Determine the freeze state of the video on the same screen according to the statistical information and the playback status, adjust the transcoding parameters according to the freeze state, until the preset conditions are met, and exit the debugging mode.
5. A video same-screen transcoding device, characterized in that: include: Information confirmation module, transcoding module and debugging module; The information confirmation module is used to obtain each client to be debugged and enter the debugging mode according to a preset debugging condition; the debugging condition includes the number of clients to be debugged; The transcoding module is used to perform video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, specifically: obtaining the video to be transcoded, and intercepting the video to be transcoded according to a preset length; performing video transcoding on the intercepted sub-video according to the preset first script and the transcoding parameters; The first script is used to adjust the transcoding parameters of this video transcoding; and send the transcoded video stream and the corresponding video stream parameters to each client; The debugging module is used to obtain the video same-screen freeze state when the client plays the sub-video, and adjust the transcoding parameters according to the freeze state. Specifically: if the video is delayed, the parameter reduction is determined according to the delay rate, the transcoding parameters are reduced according to the parameter reduction, and the video is transcoded again with the reduced transcoding parameters, and the transcoding debugging process is repeated until the delay rate is lower than the preset delay threshold, the debugging mode is exited, the optimal transcoding parameters are output, and the video to be transcoded is transcoded on the same screen according to the optimal transcoding parameters; If the statistical information of the same-screen playback of the client does not meet the preset conditions, the transcoding parameters are reset according to the binary search method, and the video to be transcoded is further transcoded.
6. A video same-screen transcoding device as claimed in claim 5, characterized in that: The method of obtaining each client to be debugged and entering the debugging mode according to the preset debugging conditions is as follows: Obtain each client to be debugged, and detect the network status of the server and the client to be debugged according to a preset video same-screen requirement condition; the video same-screen requirement condition specifies the network status of the client to be debugged; Obtain the number of clients to be debugged, and if the optimal transcoding parameters are matched according to the number of clients to be debugged, if the match is successful, enter the video same-screen transcoding according to the optimal transcoding parameters; If the match fails, it enters debug mode.
7. A video same-screen transcoding device as claimed in claim 5, characterized in that: Before performing video transcoding on the video to be transcoded according to the preset first script and transcoding parameters, the method further includes: Determine the transcoding parameters according to the number of clients to be debugged and the network status of each client to be debugged; The transcoding parameters include the number of threads, bit rate, resolution and frame rate.
8. A video same-screen transcoding device as claimed in claim 7, characterized in that: The obtaining of the video same-screen freeze state when the client plays the sub-video, and adjusting the transcoding parameters according to the freeze state are specifically: Obtain statistical information when each client plays the sub-video, the statistical information including bandwidth, packet loss rate, and delay; Obtain the playback status and buffering status of each client when playing the sub-video and the corresponding timestamp; Determine the same-screen freeze state of the video according to the statistical information and the playback state, adjust the transcoding parameters according to the freeze state, and exit the debugging mode until the preset conditions are met.
Citation Information
Patent Citations
Video transcoding method and device, electronic device and storage medium
CN110166797A
Live video processing method, system and device and terminal
CN111601118A