Streaming transcoding method and apparatus
Through streaming slicing and parallel transcoding technology, video slicing is uploaded and processed in real time, which solves the problem of slow video upload and transcoding speed, and improves the overall processing efficiency and user experience.
Patent Information
- Application Number
- PCT/CN2024/113716
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-26
- Filing Date
- 2024-08-21
- Publication Date
- 2025-07-03
AI Technical Summary
In the prior art, video upload and transcoding processing speeds are slow, resulting in a decline in user experience.
Through streaming slicing technology, video slices are uploaded and transcoded in real time, slices are processed in parallel using preset transcoding format, and slices are merged after all slices are transcoding successfully to generate target transcoding video.
The overlapping concurrent execution of video upload and transcoding calculation is realized, which significantly reduces the total time-consuming and improves the overall efficiency and user experience.
Smart Images

Figure CN2024113716_03072025_PF_FP_ABST
Abstract
Description
Streaming transcoding method and device
[0001] This application claims priority to Chinese patent application number 202311816234.9, filed on December 26, 2023, and entitled “Streaming Transcoding Method and Device.” The entire content of the Chinese patent application is incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of data processing technology, and in particular to a streaming transcoding method, apparatus, computer equipment, and computer-readable storage medium. Background Art
[0003] With the development of Internet technology, users can now share content online. For example, a user can upload a video they want to share to a server. Other users can then request the video from the server through their devices, download it, and watch it. To adapt to the decoding capabilities and network environments of different viewing devices, the server can transcode the uploaded video into various formats.
[0004] However, the inventors have realized that, due to the influence of video uploading, transcoding calculation and other links, the video transcoding processing speed is slow and time-consuming, resulting in a decline in user experience.
[0005] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a streaming transcoding method, apparatus, computer device, and computer-readable storage medium to solve or alleviate one or more of the technical problems raised above.
[0008] One aspect of an embodiment of the present application provides a streaming transcoding method, applied to a server, the method comprising:
[0009] Obtaining slices of a target video provided by a target client through streaming, wherein the target client is configured to: in a process of slicing the target video, upload each slice generated to a server in real time;
[0010] Each time a slice is obtained, the obtained slice is transcoded according to the preset transcoding format;
[0011] When the target video slices are successfully transcoded, the transcoded slices are merged to obtain the target transcoded video.
[0012] Optionally, merging the transcoded multiple slices to obtain a target transcoded video includes:
[0013] Obtaining a playlist provided by the target client, where the playlist is used to indicate multiple slices of the target video and a sequential relationship between the multiple slices, and the playlist is updated in real time according to a slicing operation of the target client;
[0014] According to the playlist, multiple transcoded slices are merged to obtain the target transcoded video in the preset transcoding format.
[0015] Optionally, the preset transcoding format includes one or more transcoding formats; and transcoding the acquired slice according to the preset transcoding format includes:
[0016] In a case where the preset transcoding format includes multiple transcoding formats, determining a transcoding priority corresponding to each transcoding format according to a preset rule;
[0017] Determine the transcoding order according to the transcoding priorities corresponding to the multiple transcoding formats;
[0018] The obtained slices are transcoded into corresponding multiple transcoding formats according to the transcoding order to obtain slices in multiple transcoding formats.
[0019] Another aspect of the embodiments of the present application further provides a streaming transcoding method, applied to a client, the method comprising:
[0020] In response to a processing request for a target video, performing slicing processing on the target video;
[0021] Each time a slice is generated, the generated slice is uploaded to the server in real time, so that each time the server obtains a slice, it transcodes the obtained slice according to the preset transcoding format, and when multiple slices of the target video are successfully transcoded, the transcoded multiple slices are merged to generate the target transcoded video.
[0022] Optionally, the slices are exported in real time through a preset editing tool, wherein the real-time exporting includes exporting the generated slices in real time each time a slice is generated.
[0023] Optionally, the description information of the slice is recorded in a playlist; and the streaming transcoding method further includes:
[0024] Each time a slice is generated, the playlist is updated in real time to add description information of the generated slice; and
[0025] Upload the updated playlist to the server so that the server performs a slice merge operation based on the updated playlist;
[0026] The description information of the slice is used to describe the corresponding slice and indicate the order of the corresponding slice in multiple slices.
[0027] Optionally, the streaming transcoding further includes:
[0028] Adjust the target slicing algorithm according to preset rules;
[0029] The target video is sliced according to the target slicing algorithm.
[0030] Optionally, the slicing the target video according to the target slicing algorithm includes:
[0031] Dividing the target video into multiple video segments according to the video content of the target video;
[0032] The plurality of video segments are sliced in parallel.
[0033] Optionally, the streaming transcoding further includes:
[0034] Determine the concurrency, which indicates the maximum number of slices that can be uploaded at the same time;
[0035] When the concurrency is met, the slices are sent to the server.
[0036] Another aspect of an embodiment of the present application provides a streaming transcoding device, applied to a server, the device comprising:
[0037] an acquisition module, configured to acquire slices of a target video provided by a target client via streaming, wherein the target client is configured to: in a process of slicing the target video, upload each slice generated to a server in real time;
[0038] A transcoding module is used to transcode each slice obtained according to a preset transcoding format;
[0039] The merging module is used to merge the transcoded slices to obtain the target transcoded video when the transcoding of the multiple slices of the target video is successful.
[0040] Another aspect of an embodiment of the present application provides a streaming transcoding device, applied to a client, the device comprising:
[0041] a slicing module, configured to perform slicing processing on a target video in response to a processing request for the target video;
[0042] The uploading module is used to upload the generated slice to the server in real time each time a slice is generated, so that each time the server obtains a slice, it transcodes the obtained slice according to the preset transcoding format, and when multiple slices of the target video are successfully transcoded, the multiple transcoded slices are merged to generate the target transcoded video.
[0043] Another aspect of an embodiment of the present application provides a computer device, including:
[0044] at least one processor; and
[0045] a memory communicatively coupled to the at least one processor;
[0046] Wherein: the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.
[0047] Another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the following steps are implemented:
[0048] Obtaining slices of a target video provided by a target client through streaming, wherein the target client is configured to: in a process of slicing the target video, upload each slice generated to a server in real time;
[0049] Each time a slice is obtained, the obtained slice is transcoded according to the preset transcoding format;
[0050] When the target video slices are successfully transcoded, the transcoded slices are merged to obtain the target transcoded video.
[0051] The above technical solution adopted in the embodiments of the present application may have the following advantages:
[0052] The target client slices the target video and uploads the generated slices to the server via streaming. That is, each time the target client generates a slice, it uploads the generated slice to the server in real time. Correspondingly, each time the server receives a slice, it directly triggers transcoding for the slice. After all slices of the target video are uploaded and transcoded, the multiple transcoded slices are merged to obtain the target transcoded video. It can be seen that the embodiment of the present application can realize streaming transcoding through slice processing and streaming, so that video uploading and transcoding calculation can be overlapped and executed concurrently, effectively reducing the total time consumption, thereby improving overall efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings illustrate exemplary embodiments and constitute a part of the specification. Together with the description of the specification, they serve to explain exemplary implementation of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals designate similar, but not necessarily identical, elements.
[0054] FIG1 schematically shows an operating environment diagram of a streaming transcoding method according to a first embodiment of the present application;
[0055] FIG2 schematically shows a flow chart of a streaming transcoding method according to the first embodiment of the present application;
[0056] FIG3 schematically shows a newly added flow chart of the streaming transcoding method according to the first embodiment of the present application;
[0057] FIG4 schematically shows the sub-steps of step S204 in FIG2 ;
[0058] FIG5 schematically shows a flow chart of a streaming transcoding method according to the second embodiment of the present application;
[0059] FIG6 schematically shows a flow chart of a streaming transcoding method according to the second embodiment of the present application;
[0060] FIG7 is a diagram illustrating an application example of a streaming transcoding method according to an embodiment of the present application;
[0061] FIG8 is a diagram illustrating an application example of a streaming transcoding method according to an embodiment of the present application;
[0062] FIG9 is a diagram illustrating an application example of a streaming transcoding method according to an embodiment of the present application;
[0063] FIG10 schematically shows a block diagram of a streaming transcoding device according to Embodiment 3 of the present application;
[0064] FIG11 schematically shows a block diagram of a streaming transcoding device according to the third embodiment of the present application; and
[0065] FIG12 schematically shows a hardware architecture diagram of a computer device according to the third embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of this application more clear, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0067] It should be noted that the descriptions of "first", "second", etc. in the embodiments of the present application are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0068] In the description of this application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed. They are only used to facilitate the description of this application and to distinguish each step. Therefore, they cannot be understood as limitations on this application.
[0069] First, an explanation of the terms involved in this application is provided:
[0070] Contributions: User-generated or reproduced audio and / or video files that can be distributed by uploading them to the Platform for viewing by the audience.
[0071] Transcoding: Converting files or media content from one format to another to adapt to different systems, devices, or needs. For example, video transcoding takes a source video file as input and generates output files with different resolutions, frame rates, or bit rates, depending on the needs.
[0072] Transcoding: Converting data files or media content from one format to another to accommodate different systems, devices, or needs. In video transcoding, the source video file is used as input, and output files with varying resolutions, frame rates, or bit rates can be generated to meet different needs.
[0073] HTTP Live Streaming (HLS) is a streaming media transmission protocol that divides the entire streaming content into small media file segments and transmits these media file segments in real time over the Internet using the HTTP protocol.
[0074] DASH (Dynamic Adaptive Streaming over HTTP) is a streaming protocol that breaks streaming content into smaller file segments with varying resolutions, bit rates, or other quality parameters. This allows for greater adaptability and supports a wider range of encoding formats.
[0075] Streaming: The transmission of data in a continuous stream over a network or other communication medium.
[0076] Secondly, to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, the following describes the relevant technologies:
[0077] With the development of Internet technology, a large number of users upload manuscripts (such as videos) to servers on specific websites or applications every day, so that the video content can be shared with other users through the server. In order to better adapt to the decoding compatibility and network bandwidth of different viewing devices (for example, high-speed networks can support higher-definition content, while low-quality networks prioritize smoothness), the server can transcode the videos uploaded by users to output audio and video files with different bit rates, such as high bit rate, medium bit rate, and low bit rate. Each bit rate may correspond to different resolutions, frame rates, bit rates, etc.
[0078] However, the applicant has learned that due to factors such as video uploading, transcoding calculation, and network conditions, the transcoding speed of the manuscript is slow and time-consuming, resulting in a decline in user experience.
[0079] To this end, the embodiment of the present application provides a technical solution for streaming transcoding. In this technical solution: (1) Streaming slicing is first performed on the user side, and the original manuscript is sliced into the form of playlists and slices (including but not limited to HLS or DASH). The playlists and slices can be generated in sequence for streaming, and each slice can be uploaded immediately after it is generated, and transcoding can be performed immediately after each slice is uploaded, so that uploading and transcoding can be overlapped and performed concurrently, greatly reducing time consumption; (2) In the case where the user side does not support streaming slicing, the server can also perform streaming slicing, so that the system can be forward compatible; (3) The process of exporting and uploading videos using editing tools (editing software) on the user side is optimized to directly exporting playlists and slices through the editing tools, so as to achieve exporting, uploading, and transcoding at the same time, further reducing the total time consumption and improving the manuscript transcoding speed and overall efficiency. See below for details.
[0080] Finally, for ease of understanding, an exemplary operating environment is provided below.
[0081] As shown in FIG1 , the operating environment diagram includes: a server 2 , target clients ( 4A, 4B, ..., 4M), and viewer terminals ( 6A, 6B, ..., 6N).
[0082] Server 2 can provide slice processing services, transcoding services, content distribution services, etc. It can be a single server, a server cluster or a cloud computing service center.
[0083] The target clients (4A, 4B, ..., 4M) can be configured to upload manuscripts to server 2. The manuscripts can be user-generated video and / or audio content, or reposted video and / or audio files from other sources. The target clients can also be configured to slice the manuscripts and upload the generated slices to server 2. The target clients can be electronic devices such as smartphones and tablets. Alternatively, the target clients can be virtual computing instances within service platform 2.
[0084] The viewer terminals (6A, 6B, ..., 6N) can be configured to obtain the audio and video files uploaded by the target client by requesting the server 2. The viewer terminals (6A, 6B, ..., 6N) can be any type of computing device, such as a smartphone, tablet device, laptop computer, smart TV, in-vehicle terminal, etc. The viewer terminals (6A, 6B, ..., 6N) can have a built-in browser or specialized program to receive the audio and video files through the browser or specialized program and output the content to the user. The content can include video, audio, text data, and / or the like.
[0085] The target clients (4A, 4B, ..., 4M), the viewer terminals (6A, 6B, ..., 6N), and the server 2 may be connected via a network. The network may include various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, and / or proxy devices. The network may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, and / or the like. The network may include wireless links, such as cellular links, satellite links, Wi-Fi links, and / or the like.
[0086] The technical solutions of the present application are described below through a number of embodiments. It should be noted that these embodiments can be implemented in a variety of different forms and should not be construed as being limited to the embodiments described herein.
[0087] Example 1
[0088] FIG2 schematically shows a flow chart of a streaming transcoding method according to the first embodiment of the present application.
[0089] As shown in FIG2 , the streaming transcoding method may be applied in a server 2 and may include steps S200 to S204 , wherein:
[0090] Step S200: Obtain slices of a target video provided by a target client via streaming, wherein the target client is configured to upload each slice generated during the slicing process of the target video to a server in real time.
[0091] Step S202: Every time a slice is obtained, the obtained slice is transcoded according to a preset transcoding format.
[0092] Step S204: When the transcoding of the multiple slices of the target video is successful, the multiple transcoded slices are merged to obtain the target transcoded video.
[0093] The streaming transcoding method provided in this embodiment is that the target client slices the target video and uploads the generated slices to the server by streaming. That is, each time the target client generates a slice, it uploads the generated slice to the server in real time. Correspondingly, each time the server receives a slice, it directly triggers the transcoding of the slice. After all slices of the target video are uploaded and transcoded, the multiple transcoded slices are merged to obtain the target transcoded video. It can be seen that the embodiment of the present application can realize streaming transcoding through slice processing and streaming transmission, so that video upload and transcoding calculation can be overlapped and executed concurrently, effectively reducing the total time consumption, thereby improving overall efficiency.
[0094] The following describes in detail each step in steps S200 to S204 and other optional steps in conjunction with FIG. 2 .
[0095] Step S200: Obtain slices of a target video provided by a target client via streaming, wherein the target client is configured to upload each slice generated during the slicing process of the target video to a server in real time.
[0096] The target video can be a video stored locally on the target client, or it can be a video currently being recorded by the target client and available for live streaming. The target client can transfer the video to the server all at once, and the server will perform a one-time transcoding after the video upload is complete. Since upload and transcoding are performed sequentially, the total processing time is the sum of the upload and transcoding times, which can result in a long total processing time. This can further increase the overall processing time, especially for long target videos. Therefore, to reduce processing time and improve overall efficiency, the server can also directly obtain slices of the target video provided by the target client via streaming. Specifically, the target client slices the target video using a preset slicing algorithm (such as uniform slicing or non-uniform slicing), and uploads each generated slice to the server in real time. Slicing by the target client reduces server resource usage and speeds up server transcoding. Furthermore, having the target client upload slices in real-time streaming can reduce server latency, allowing transcoding to occur immediately after retrieval, without having to wait for all slices to be uploaded.
[0097] In this embodiment, the server directly obtains slices of the target video provided by the target client through streaming, and can subsequently transcode the slices in parallel without waiting for the entire video to be uploaded before performing a one-time transcoding. This can reduce the server's waiting time and computing resource usage, thereby effectively speeding up the server's transcoding speed.
[0098] It should be noted that the server can also obtain slices of audio files, large data sets, etc. provided by the target client through streaming, and perform corresponding processing such as transcoding on the slices, thereby effectively improving the overall processing efficiency in different application scenarios.
[0099] Step S202: Every time a slice is obtained, the obtained slice is transcoded according to a preset transcoding format.
[0100] Each time the server receives a streaming slice, it means that the slice has been successfully uploaded, and the server can directly trigger the transcoding operation for the slice. In actual applications, in order to minimize the server's waiting time, the restrictions on the order of slice transcoding processing can be further reduced. For example, if the previous slice (the slice uploaded earlier) has not been uploaded, if the server receives the subsequent slice (the slice uploaded later) first, it can still start the transcoding operation for the slice immediately. This flexible transcoding processing method allows the server to perform transcoding immediately when it receives the slice, without waiting for the previous slice to be fully uploaded, effectively reducing the waiting time for the overall video transcoding and optimizing the overall processing efficiency.
[0101] The server can transcode the acquired slices according to a preset transcoding format. The preset transcoding format can be determined according to actual needs. For example, the server can determine the preset transcoding format based on a variety of factors such as the decoding capability of the viewer terminal, network conditions, user preferences, video characteristics, and content requirements. For example, to adapt to viewing terminals in low-speed network environments, the server can select a transcoding format that can reduce the slice resolution, bit rate, or frame rate. The server can transcode the slice into a slice of a single transcoding format that meets specific needs, or it can transcode the same slice into multiple slices of different transcoding formats at one time to meet the needs of different platforms or different viewer terminals.
[0102] When the preset transcoding format includes multiple transcoding formats, multiple transcoding solutions can be developed to further improve transcoding efficiency, such as multi-threaded parallel processing, preset transcoding templates, distributed transcoding, etc. An exemplary solution is provided below.
[0103] In an optional embodiment, as shown in FIG3 , the streaming transcoding method may further include:
[0104] Step S300: When the preset transcoding format includes multiple transcoding formats, a transcoding priority corresponding to each transcoding format is determined according to a preset rule.
[0105] Step S302: Determine a transcoding order according to the transcoding priorities corresponding to the plurality of transcoding formats.
[0106] Step S304 , transcoding the obtained slices into corresponding multiple transcoding formats according to the transcoding sequence to obtain slices in multiple transcoding formats.
[0107] For multiple transcoding formats, a corresponding transcoding priority can be assigned to each transcoding format based on the request frequency and required computing resources of each transcoding format, combined with the server network environment, available resources, and the performance of the viewer's terminal. After determining the transcoding priority, the transcoding order of the multiple transcoding formats can be specified. The obtained slices can be subjected to multi-format transcoding operations based on this transcoding order to obtain slices of multiple transcoding formats. In actual applications, the server can also dynamically adjust the transcoding priority corresponding to the transcoding format and the overall transcoding order based on real-time network conditions or user requests, so as to meet user needs and optimize transcoding efficiency to the greatest extent.
[0108] In this embodiment, corresponding transcoding priorities are dynamically assigned to multiple transcoding formats to determine an optimal slice transcoding order under multiple transcoding formats, which can further improve transcoding efficiency.
[0109] Step S204: When the transcoding of the multiple slices of the target video is successful, the multiple transcoded slices are merged to obtain the target transcoded video.
[0110] When all slices of the target video have been uploaded and the transcoding operation of each slice has been completed, the server can trigger a slice merging operation to merge the transcoded multiple slices into the target transcoded video. This process involves merging each slice in a certain order to ensure that the generated target transcoded video is complete and can be played normally. The target transcoded video can be stored in the server and transmitted to the viewer terminal via the network when the viewer terminal needs to watch it. In some embodiments, when the number of slices obtained by the server reaches a certain number and the transcoding has been completed, the server can merge these slices and provide them to the viewer terminal in real time to optimize the video playback effect.
[0111] The order between slices can be determined in various ways, such as timestamps, logical relationships of video content, key frames, etc. An exemplary solution is provided below.
[0112] In an optional embodiment, as shown in FIG4 , step S204 may include:
[0113] Step S400: Obtain a playlist provided by the target client. The playlist is used to indicate multiple slices of the target video and the order relationship between the multiple slices. The playlist is updated in real time according to the slicing operation of the target client.
[0114] Step S402: Merge the transcoded multiple slices according to the playlist to obtain a target transcoded video in the preset transcoding format.
[0115] In order to ensure the accuracy of slice merging, the server can obtain the playlist provided by the target client. The target client can use HLS or DASH to slice the target video, divide the target video into multiple small slices, and generate a playlist for recording the slices. It can be seen that the playlist can include description information of multiple slices, such as: the order relationship between slices, the address of the slice, the start time, the end time, the encoding format, etc. By parsing the playlist, the server can know which slices the target video includes and the arrangement order of multiple slices, so that it can accurately merge the transcoded multiple slices according to the playlist, so that the merged target transcoded video is complete and can be played normally. The playlist can be generated after the entire target video slicing is completed, or it can be updated in real time according to the slicing operation of the target client, so that the server can continuously obtain information about the latest slices of the target video.
[0116] In this embodiment, obtaining a playlist and merging the transcoded slices according to the playlist can ensure the accuracy of the slice merging operation and further reduce processing time.
[0117] Example 2
[0118] FIG5 schematically shows a flow chart of a streaming transcoding method according to the second embodiment of the present application.
[0119] As shown in FIG5 , the streaming transcoding method may be applied in a target client (such as 4A) and may include steps S500 to S502 , wherein:
[0120] Step S500: In response to a processing request for a target video, slice the target video.
[0121] In step S502, each time a slice is generated, the generated slice is uploaded to the server in real time, so that the server performs slice transcoding and slice merging operations. Each time a slice is obtained, the obtained slice is transcoded according to a preset transcoding format. If multiple slices of the target video are successfully transcoded, the transcoded slices are merged to generate the target transcoded video.
[0122] The streaming transcoding method provided in this embodiment is that the target client slices the target video and uploads the generated slices to the server by streaming. That is, each time the target client generates a slice, it uploads the generated slice to the server in real time, so that the server can directly trigger the transcoding of each slice it receives. After all slices of the target video are uploaded and transcoded, the multiple transcoded slices are merged to obtain the target transcoded video. It can be seen that the embodiment of the present application can realize streaming transcoding through slice processing and streaming transmission, so that video upload and transcoding calculation can be overlapped and executed concurrently, effectively reducing the total time consumption, thereby improving overall efficiency.
[0123] The target client can slice the target video in a variety of ways. Several exemplary embodiments are provided below.
[0124] In an optional embodiment, the slices are exported in real time through a preset editing tool, wherein the real-time exporting includes exporting the generated slices in real time each time a slice is generated.
[0125] In order to further optimize the overall processing efficiency, the target client can use the editing tool (editing software) to export and upload videos, which is optimized to directly export slices and playlists through the editing tool. Every time the editing tool exports a slice, the exported slice is uploaded to the server in real time, thereby achieving exporting, uploading and transcoding at the same time, further reducing the total time consumption and improving the manuscript transcoding speed and overall efficiency.
[0126] In this embodiment, slices are directly exported through the editing tool and uploaded in real time, without exporting the entire video from the editing tool, which optimizes the processing process and achieves the effect of further speeding up.
[0127] In an optional embodiment, the description information of the slices may be recorded in a playlist. The streaming transcoding method may further include: updating the playlist in real time each time a slice is generated to add the description information of the generated slice; and uploading the updated playlist to a server so that the server performs a slice merging operation based on the updated playlist; wherein the description information of the slice is used to describe the corresponding slice and indicate the order of the corresponding slice among multiple slices.
[0128] Exemplarily, the target client can use HLS or DASH to slice the target video, divide the target video into multiple small slices, and generate a playlist. The playlist can be used to record the description information of the slice, such as: the address of the slice, the start time, the end time, the encoding format, the order of the slice in multiple slices, etc. The playlist can be generated after the slicing of the entire target video is completed, or it can be updated in real time according to the slicing operation of the target client. For example, each time a slice is generated, the description information of the generated slice is added to the playlist to update the playlist in real time. The updated playlist is uploaded to the server through streaming, so that the server can continuously obtain the information of the latest slice of the target video and perform slice merging operations according to the updated playlist.
[0129] In this embodiment, the accuracy of the server slice merging can be improved by having the target client update and upload the updated playlist in real time.
[0130] In an optional embodiment, as shown in FIG6 , the streaming transcoding method may further include:
[0131] Step S600: Adjust the target slicing algorithm according to preset rules.
[0132] Step S602: Slice the target video according to the target slicing algorithm.
[0133] Target slicing algorithms can include those based on video content characteristics, time period, or bitrate. Slicing algorithms based on video content characteristics can implement uneven slicing based on content features such as video scenes, shot cuts, and keyframes to ensure the integrity of each slice. Slicing algorithms based on time period can implement isochronous uniform slicing or customized non-uniform time slicing. The target client can adjust the target slicing algorithm used in slicing processing in real time based on the network environment, computing power, server load, or viewer demand to meet the needs of different application scenarios.
[0134] In this embodiment, the stability and smoothness of slice production and transmission can be guaranteed by dynamically adjusting the target slice algorithm used in the slice processing in real time.
[0135] An exemplary scheme is provided below.
[0136] In an optional embodiment, step S602 may include: dividing the target video into multiple video segments according to the video content of the target video; and slicing the multiple video segments in parallel.
[0137] For example, machine learning or computer vision techniques can be applied to analyze the target video content to identify change points such as scene transitions, shot cuts, specific actions, or keyframes, marking these locations suitable for video segmentation. Using these predefined markers, the target video is segmented into multiple segments. These segments can then be sliced and processed in parallel using multiple threads, improving the efficiency and speed of slicing while ensuring the quality and integrity of the segments and accelerating overall processing efficiency.
[0138] In an optional embodiment, the streaming transcoding method may further include: determining a concurrency, where the concurrency is used to indicate a maximum number of slices uploaded at the same time; and sending the slices to the server when the concurrency is met.
[0139] In practical applications, an appropriate concurrency can be set based on the target client's performance, network bandwidth, and server load to determine the maximum number of slices that can be uploaded simultaneously. This can reduce system lag or network congestion caused by excessive slice uploads. While meeting concurrency limits, the target client can upload slices to the server individually or in batches. It should be noted that concurrency can be dynamically adjusted based on actual conditions to optimize upload efficiency and ensure system stability. This allows for flexible response to playback issues caused by network changes or server load.
[0140] In this embodiment, the uploading of slices is managed and controlled in an appropriate manner according to the preset concurrency, and the slices can be efficiently sent to the server when the system load and network conditions permit.
[0141] In order to make this application easier to understand, an exemplary application is provided below in conjunction with Figures 7-9.
[0142] S11: When a user submits a manuscript (via the target client), they can directly upload the entire manuscript (such as the target video). After the upload is complete, the server begins processing. Alternatively, the user (target client) can generate segments and a playlist and upload the segments concurrently. The playlist can conform to the HLS or DASH standards or be customized. The playlist can be used to describe key information such as the target video's segments and the order of the segments.
[0143] S12, the server (manuscript processing side, providing manuscript processing services) can directly trigger the transcoding of each slice every time it receives a slice that has been uploaded.
[0144] S13: Slice upload does not require a certain order. If the server receives the next slice first, that is, if the previous slice is not uploaded, the transcoding of this slice can still be triggered.
[0145] Among them, the concurrency of slice upload can be set to alleviate system lag or network congestion caused by uploading too many slices at the same time.
[0146] S14: After all the slices are uploaded and transcoded, the server triggers a slice merging operation to generate the final output (target transcoded video).
[0147] S15: When users submit their work using editing software (editing tools), exporting from the editing software is very slow. Therefore, it is possible to export slices directly from the editing software, with each slice uploaded in real time. Reusing the process from S12 to S14 can further speed things up.
[0148] In this exemplary application: (1) Streaming slicing is first performed on the user side, and the original manuscript is sliced into playlists and slices (including but not limited to HLS or DASH). The playlists and slices can be generated in sequence for streaming, and each slice can be uploaded immediately after it is generated, and transcoding can be performed immediately after each slice is uploaded, so that uploading and transcoding can be overlapped and performed concurrently, greatly reducing time consumption; (2) In the case where the user side does not support streaming slicing, the server can also perform streaming slicing, so that the system can be forward compatible; (3) The process of exporting and uploading videos using editing tools (editing software) on the user side is optimized to directly exporting playlists and slices through the editing tools, so that exporting, uploading, and transcoding can be achieved at the same time, further reducing the total time consumption and improving the manuscript transcoding speed and overall efficiency.
[0149] Example 3
[0150] FIG10 schematically shows a block diagram of a streaming transcoding device according to the second embodiment of the present application. The device is applied to a server and can be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer-readable instruction segments that can perform specific functions. The following description will specifically introduce the functions of each program module in this embodiment. As shown in FIG10 , the device 1000 may include: an acquisition module 1100, a transcoding module 1200, and a merging module 1300, wherein:
[0151] An acquisition module 1100 is configured to acquire slices of a target video provided by a target client via streaming, wherein the target client is configured to upload each slice generated during slicing of the target video to a server in real time;
[0152] The transcoding module 1200 is configured to transcode each acquired slice according to a preset transcoding format;
[0153] The merging module 1300 is configured to merge the transcoded slices to obtain a target transcoded video when the transcoding of the multiple slices of the target video is successful.
[0154] As an optional embodiment, the merging module 1300 is further configured to:
[0155] Obtaining a playlist provided by the target client, where the playlist is used to indicate multiple slices of the target video and a sequential relationship between the multiple slices, and the playlist is updated in real time according to a slicing operation of the target client;
[0156] According to the playlist, multiple transcoded slices are merged to obtain the target transcoded video in the preset transcoding format.
[0157] As an optional embodiment, the preset transcoding format includes one or more transcoding formats; and the transcoding module is further configured to:
[0158] In a case where the preset transcoding format includes multiple transcoding formats, determining a transcoding priority corresponding to each transcoding format according to a preset rule;
[0159] Determine the transcoding order according to the transcoding priorities corresponding to the multiple transcoding formats;
[0160] The obtained slices are transcoded into corresponding multiple transcoding formats according to the transcoding order to obtain slices in multiple transcoding formats.
[0161] Example 4
[0162] Figure 11 schematically shows a block diagram of a streaming transcoding device according to the second embodiment of the present application. The device is applied to the client and can be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer-readable instruction segments that can perform specific functions. The following description will specifically introduce the functions of each program module in this embodiment. As shown in Figure 11, the device 2000 may include: a slicing module 2100, an upload module 2200, wherein:
[0163] The slicing module 2100 is configured to perform slicing processing on the target video in response to a processing request for the target video;
[0164] The upload module 2200 is used to upload the generated slice to the server in real time each time a slice is generated, so that each time the server obtains a slice, it transcodes the obtained slice according to the preset transcoding format, and when multiple slices of the target video are successfully transcoded, the transcoded multiple slices are merged to generate the target transcoded video.
[0165] As an optional embodiment, the slices are exported in real time through a preset editing tool, wherein the real-time exporting includes exporting the generated slices in real time each time a slice is generated.
[0166] As an optional embodiment, the description information of the slice is recorded in the playlist; the apparatus 2000 is further configured to:
[0167] Each time a slice is generated, the playlist is updated in real time to add description information of the generated slice; and
[0168] Upload the updated playlist to the server so that the server performs a slice merge operation based on the updated playlist;
[0169] The description information of the slice is used to describe the corresponding slice and indicate the order of the corresponding slice in multiple slices.
[0170] As an optional embodiment, the apparatus 2000 is further configured to:
[0171] Adjust the target slicing algorithm according to preset rules;
[0172] The target video is sliced according to the target slicing algorithm.
[0173] As an optional embodiment, the apparatus 2000 is further configured to:
[0174] Dividing the target video into multiple video segments according to the video content of the target video;
[0175] The plurality of video segments are sliced in parallel.
[0176] As an optional embodiment, the apparatus 2000 is further configured to:
[0177] Determine the concurrency, which indicates the maximum number of slices that can be uploaded at the same time;
[0178] When the concurrency is met, the slices are sent to the server.
[0179] Example 5
[0180] FIG12 schematically shows a hardware architecture diagram of a computer device 10000 suitable for implementing a streaming transcoding method according to the third embodiment of the present application. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle-mounted terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. As shown in FIG12 , the computer device 10000 may include but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other via a system bus. Among them:
[0181] The memory 10010 includes at least one type of computer-readable storage medium, including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, etc. In some embodiments, the memory 10010 may be an internal storage module of the computer device 10000, such as a hard disk or memory of the computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk equipped on the computer device 10000, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Of course, the memory 10010 may also include both the internal storage module of the computer device 10000 and its external storage device. In this embodiment, the memory 10010 is generally used to store an operating system and various application software installed on the computer device 10000, such as program code of a streaming transcoding method, etc. In addition, the memory 10010 can also be used to temporarily store various data that has been output or is to be output.
[0182] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to execute program code stored in the memory 10010 or process data.
[0183] The network interface 10030 may include a wireless network interface or a wired network interface. The network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal via a network, and to establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile Communications (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth, or Wi-Fi.
[0184] It should be noted that FIG. 12 only shows a computer device having components 10010 - 10030 , but it should be understood that it is not required to implement all of the shown components, and more or fewer components may be implemented instead.
[0185] In this embodiment, the streaming transcoding method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.
[0186] Example 6
[0187] The present application also provides a computer-readable storage medium having computer-readable instructions stored thereon. When the computer-readable instructions are executed by a processor, the following steps of the streaming transcoding method in the embodiment are implemented:
[0188] Obtaining slices of a target video provided by a target client through streaming, wherein the target client is configured to: in a process of slicing the target video, upload each slice generated to a server in real time;
[0189] Each time a slice is obtained, the obtained slice is transcoded according to the preset transcoding format;
[0190] When the target video slices are successfully transcoded, the transcoded slices are merged to obtain the target transcoded video.
[0191] In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped with the computer device, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc. Of course, the computer-readable storage medium may also include both an internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the streaming transcoding method in the embodiment. In addition, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are about to be output.
[0192] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by general-purpose computer devices. They can be concentrated on a single computer device or distributed on a network composed of multiple computer devices. Alternatively, they can be implemented by program codes executable by computer devices, so that they can be stored in a storage device and executed by the computer device, and in some cases, the steps shown or described can be performed in a different order from that shown here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software. It should be noted that the above are only preferred embodiments of the present application and do not limit the scope of patent protection of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are similarly included in the scope of patent protection of the present application.
Claims
1. A streaming transcoding method, applied to a server, the method comprising: Obtaining slices of a target video provided by a target client through streaming transmission, wherein the target client is configured to: during the slicing process of the target video, every time a slice is generated, the generated slice is uploaded to the server in real time; Every time a slice is obtained, transcoding the obtained slice according to a preset transcoding format; In the case where multiple slices of the target video are successfully transcoded, merging the multiple transcoded slices to obtain a target transcoded video.
2. The method according to claim 1, wherein The merging the multiple transcoded slices to obtain a target transcoded video includes: Obtaining a playlist provided by the target client, the playlist being used to indicate multiple slices of the target video and the order relationship between the multiple slices, and the playlist being updated in real time according to the slicing operation of the target client; According to the playlist, merging the multiple transcoded slices to obtain a target transcoded video in the preset transcoding format.
3. The method according to claim 1, wherein The preset transcoding format includes one or more transcoding formats; the transcoding the obtained slice according to the preset transcoding format includes: In the case where the preset transcoding format includes multiple transcoding formats, determining the transcoding priority corresponding to each transcoding format according to a preset rule; Determining a transcoding order according to the transcoding priorities corresponding to the multiple transcoding formats; Transcoding the obtained slice according to the transcoding order for the corresponding multiple transcoding formats to obtain slices in multiple transcoding formats.
4. A streaming transcoding method, wherein, Applied to a client, the method comprising: In response to a processing request for a target video, performing slicing processing on the target video; Every time a slice is generated, uploading the generated slice to the server in real time, so that every time the server obtains a slice, transcoding the obtained slice according to a preset transcoding format, and in the case where multiple slices of the target video are successfully transcoded, merging the multiple transcoded slices to generate a target transcoded video.
5. The method according to claim 4, wherein, The slices are exported in real time through a preset editing tool, wherein the real-time export includes exporting the generated slice in real time every time a slice is generated.
6. The method according to claim 4, wherein The description information of the slices is recorded in the playlist; The method further comprises: Every time a slice is generated, updating the playlist in real time to newly record the description information of the generated slice; and Uploading the updated playlist to the server so that the server performs a slice merging operation based on the updated playlist; Wherein the description information of the slice is used to describe the corresponding slice and indicate the order of the corresponding slice among the multiple slices.
7. The method according to claim 4, wherein, Further comprising: Adjusting a target slicing algorithm according to a preset rule; Performing slicing processing on the target video according to the target slicing algorithm.
8. The method according to claim 7, wherein, The performing slicing processing on the target video according to the target slicing algorithm includes: Dividing the target video into multiple video segments according to the video content of the target video; Performing parallel slicing on the multiple video segments.
9. The method according to any one of claims 4 to 8, wherein, Further comprising: Determining a concurrency degree, the concurrency degree being used to indicate the maximum number of slices uploaded at the same time; Sending slices to the server when the concurrency degree is satisfied.
10. A streaming transcoding device, applied to a server, the device comprising: An acquisition module, configured to acquire slices of a target video provided by a target client through streaming transmission, wherein the target client is configured to: during the slicing process of the target video, upload the generated slice to the server in real time every time a slice is generated; A transcoding module, configured to transcode the acquired slice according to a preset transcoding format every time a slice is acquired; A merging module, configured to merge the transcoded slices when multiple slices of the target video are successfully transcoded, so as to obtain a target transcoded video.
11. A streaming transcoding device, applied to a client, the device comprising: A slicing module, configured to perform slicing processing on the target video in response to a processing request for the target video; An uploading module, configured to upload the generated slice to the server in real time every time a slice is generated, so that the server transcodes the acquired slice according to a preset transcoding format every time a slice is acquired, and merges the transcoded slices when multiple slices of the target video are successfully transcoded, so as to generate a target transcoded video.
12. A computer device, comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein: The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the method according to any one of claims 1 to 9.
13. A computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are executed by a processor, the following steps are implemented: Obtain slices of a target video provided by a target client through streaming, where The target client is configured to: during the slicing process of the target video, upload the generated slice to the server in real time every time a slice is generated; Every time a slice is acquired, transcode the acquired slice according to a preset transcoding format; When multiple slices of the target video are successfully transcoded, merge the transcoded slices to obtain a target transcoded video.
14. The computer-readable storage medium according to claim 13, wherein, When the computer instructions are executed by a processor, the following steps are implemented: Acquire a playlist provided by the target client, where the playlist is used to indicate multiple slices of the target video and the order relationship between the multiple slices, and the playlist is updated in real time according to the slicing operation of the target client; According to the playlist, merge the transcoded slices to obtain a target transcoded video in the preset transcoding format.
15. The computer-readable storage medium according to claim 13, wherein, The preset transcoding format includes one or more transcoding formats; when the computer instructions are executed by a processor, the following steps are implemented: When the preset transcoding format includes multiple transcoding formats, determine the transcoding priority corresponding to each transcoding format according to a preset rule; Determine the transcoding order according to the transcoding priorities corresponding to the multiple transcoding formats; Transcode the acquired slice according to the corresponding multiple transcoding formats according to the transcoding order to obtain slices in multiple transcoding formats.
16. The computer-readable storage medium according to claim 13, wherein, When the computer instructions are executed by a processor, the following steps are implemented: In response to a processing request for a target video, slice the target video; For each generated slice, upload the generated slice to the server in real time, so that for each slice obtained by the server, transcoding is performed on the obtained slice according to a preset transcoding format, and when multiple slices of the target video are successfully transcoded, merge the multiple transcoded slices to generate a target transcoded video.
17. The computer-readable storage medium according to claim 13, wherein, The slices are exported in real time through a preset editing tool, where the real-time export includes exporting the generated slice in real time for each generated slice.
18. The computer-readable storage medium according to claim 13, wherein, The description information of the slices is recorded in the playlist; when the computer instructions are executed by a processor, the following steps are implemented: For each generated slice, update the playlist in real time to newly record the description information of the generated slice; and Upload the updated playlist to the server so that the server performs a slice merging operation based on the updated playlist; wherein the description information of the slices is used to describe the corresponding slices and indicate the order of the corresponding slices among the multiple slices.
19. The computer-readable storage medium according to claim 13, wherein, When the computer instructions are executed by a processor, the following steps are implemented: Adjust the target slicing algorithm according to a preset rule; Slice the target video according to the target slicing algorithm.
20. The computer-readable storage medium according to claim 19, wherein, When the computer instructions are executed by a processor, the following steps are implemented: Divide the target video into multiple video segments according to the video content of the target video; Slice the multiple video segments in parallel.
Citation Information
Patent Citations
Video publishing method and device and computer readable storage medium
CN110267118A
Video live broadcast stream transcoding method, device and system and readable storage medium
CN115379251A
Live broadcast playback video generation method and device, live broadcast platform, computer equipment and storage medium
CN117278769A
Streaming transcoding method and device
CN117793362A
Transcoding Method and System, and Distributed File Apparatus
US20150244757A1