Video transcoding processing method and device
By caching video files in the cache server and providing them to the computing platform, the problem of low video file reading efficiency in the existing technology is solved, efficient video transcoding is achieved, meeting large-scale transcoding requirements and reducing computing costs.
Patent Information
- Application Number
- CN202411658757.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, video files are stored in object storage, and the method of directly reading video files from object storage is inefficient, it is difficult to meet the needs of large-scale transcoding, and it affects the time and calculation cost of computing resources.
The cache server actively caches the target video file and provides it to the computing platform. The computing platform generates an intermediate product based on the target video file. The cache server responds to the read request of the computing platform and provides the intermediate product for subsequent tasks.
It accelerates the speed of the computing platform to read video files and intermediate products, improves the video transcoding speed, meets large-scale transcoding requirements, reduces the idle time of computing resources, shortens the processing cycle, and reduces computing costs.
Smart Images

Figure CN119364138A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and in particular, to a video transcoding processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the rapid growth of video content and the popularity of high-resolution videos, the size of video files has increased significantly. In the video production process, the speed of reading video files affects the transcoding efficiency and the time occupied by computing resources.
[0003] In the prior art, video files are usually stored in object storage. The method of directly reading video files from object storage is limited by the communication efficiency of object storage and is difficult to meet the needs of large-scale transcoding. At the same time, the speed of reading video files in the video production process affects the computing resource occupancy time, which indirectly increases the computing cost.
[0004] 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. Summary of the invention
[0005] The embodiments of the present application provide a video transcoding processing method, apparatus, computer device, computer-readable storage medium, and computer program product to solve or alleviate one or more of the technical problems raised above.
[0006] One aspect of an embodiment of the present application provides a video transcoding processing method for a cache server, the method comprising: Reading a target video file from a storage server to cache the target video file; Providing the target video file to the computing platform so that the computing platform generates a first intermediate product according to the target video file; During the video transcoding process, storing a plurality of intermediate products generated by the computing platform, the plurality of intermediate products including the first intermediate product; In response to a read request from the computing platform, one or more of the plurality of intermediate products are provided for use in subsequent tasks of the computing platform.
[0007] Optionally, providing the target video file to the computing platform includes: If the target video file has been stored, providing the target video file to the computing platform; or In the absence of the target video file, the target video file is loaded from the storage server and then provided to the computing platform.
[0008] Optionally, the first intermediate product is a product generated in response to a slicing task, and the first intermediate product includes a plurality of target video slices; The plurality of intermediate products further includes a second intermediate product; The second intermediate product is a product generated in response to the transcoding task, and the second intermediate product includes: the computing platform reads the first intermediate product from the cache server and generates multiple transcoded video slices based on the first intermediate product.
[0009] Optionally, providing one or more of the plurality of intermediate products in response to the read request of the computing platform comprises: In response to a request from the computing platform, providing the plurality of transcoded video slices to the computing platform; The computing platform is used to merge the multiple transcoded video slices into a target video product, and store the target video product in a storage server.
[0010] Optionally, the method further includes: responding to a deletion request from the computing platform, deleting the target video file and the plurality of intermediate products.
[0011] Optionally, for a computing platform, the method comprises: In response to the slicing task, a target video file is obtained from a cache server, and the target video file is sliced into a plurality of target video slices and stored in the cache server; the target video file is pre-read from a storage server and stored in the cache server; In response to the multiple transcoding tasks, the multiple target video slices are read from the cache server and the read multiple target video slices are transcoded to obtain multiple transcoded video slices and stored in the cache server; In response to the slice merging task, the multiple transcoded video slices are read from the cache server and the read multiple transcoded video slices are merged to obtain a target video product and store it in a storage server.
[0012] Optionally, the method further comprises: receiving a notification from the storage server that the target video product is stored; According to the notification, a deletion request is sent to the cache server, so that the cache server deletes the target video file, the multiple target video slices, and the multiple transcoded video slices based on the deletion request.
[0013] Optionally, dividing the target video file into a plurality of target video slices and storing them in a cache server includes: Determining the slice positions of the target video file according to the key frames of the target video file; Slicing the target video file according to the slicing positions to obtain the multiple target video slices; Wherein, the multiple target video slices all start with a key frame.
[0014] Optionally, merging the read multiple transcoded video slices includes: Based on the plurality of shard positions, determining a corresponding plurality of merge points; The key frames of the multiple transcoded video slices are respectively aligned with corresponding merging points to merge and obtain the target video product.
[0015] Another aspect of an embodiment of the present application provides a video transcoding processing device for a cache server, the device comprising: A reading module, used for reading a target video file from a storage server to cache the target video file; A generating module, configured to provide the target video file to a computing platform, so that the computing platform generates a first intermediate product according to the target video file; A storage module, used for storing a plurality of intermediate products generated by the computing platform during the video transcoding process, wherein the plurality of intermediate products include the first intermediate product; A providing module is used to provide one or more of the plurality of intermediate products in response to a read request of the computing platform for use in subsequent tasks of the computing platform.
[0016] Another aspect of an embodiment of the present application provides a video transcoding processing device for a computing platform, the device comprising: A slicing module, for obtaining a target video file from a cache server in response to a slicing task, and slicing the target video file into a plurality of target video slices and storing them in the cache server; the target video file is pre-read from a storage server and stored in the cache server; a transcoding module, configured to, in response to a plurality of transcoding tasks, read the plurality of target video slices from the cache server and transcode the plurality of target video slices read to obtain a plurality of transcoded video slices and store them in the cache server; The merging module is used to respond to the slice merging task, read the multiple transcoded video slices from the cache server and merge the read multiple transcoded video slices to obtain the target video product and store it in the storage server.
[0017] Another aspect of an embodiment of the present application provides a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; 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 so that the at least one processor can execute the method as described above.
[0018] 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 method described above is implemented.
[0019] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which implements the method described above when executed by a processor.
[0020] The embodiment of the present application adopts the above technical solution and may include the following advantages: the target video file is actively cached by the cache server and provided to the computing platform. The computing platform generates a first intermediate product based on the target video file. At the same time, the cache server responds to the reading request of the computing platform and provides one or more of the multiple intermediate products for subsequent tasks. This method speeds up the speed at which the computing platform reads the target video file and the intermediate product, thereby increasing the speed of video transcoding to meet the needs of large-scale transcoding. In addition, the reading time of the target video file and the intermediate product is reduced, which can reduce the idle time of computing resources, shorten the processing cycle, and reduce computing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0022] Figure 1 The following schematically shows an operating environment diagram of the video transcoding processing method according to the first embodiment of the present application; Figure 2 The flowchart of the video transcoding processing method according to the first embodiment of the present application is schematically shown; Figure 3 Schematically shows Figure 2 Flow chart of sub-steps of step S202; Figure 4 The flowchart of the video transcoding processing method according to the second embodiment of the present application is schematically shown; Figure 5 Schematically shows Figure 4 Flow chart of sub-steps of step S400; Figure 6 Schematically shows Figure 4Flow chart of sub-steps of step S404; Figure 7 The following schematically shows a newly added flow chart of the video transcoding processing method according to the second embodiment of the present application; Figure 8 The following schematically shows an application example diagram according to the second embodiment of the present application; Fig. 9 A block diagram of a video transcoding processing device according to Embodiment 3 of the present application is schematically shown; Fig.10 A block diagram of a video transcoding processing device according to a fourth embodiment of the present application is schematically shown; Fig.11 The hardware architecture diagram of the computer device according to the fifth embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0024] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0025] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.
[0026] First, the following terms are explained: Video transcoding: Convert video formats and compress them into different bit rates through encoding, decoding, compression and other technologies to adapt to different network bandwidths and terminal processing capabilities.
[0027] IO: input / output, the communication between the information processing system and the outside world.
[0028] Video production: includes a series of steps from video submission to video processing and then to video presentation. Video processing includes video transcoding, video enhancement, video frame capture, video reasoning, OCR (optical character recognition) and other tasks that require a lot of computing resources and execution time.
[0029] Secondly, in order to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, the relevant technologies are described below: With the rapid growth of video content and the popularity of high-resolution videos, the size of video files has increased significantly. In the video production process, the speed of reading video files affects the transcoding efficiency and the time occupied by computing resources.
[0030] However, in the prior art, video files are usually stored in object storage. The method of directly reading video files from object storage is limited by the communication efficiency of object storage and is difficult to meet the needs of large-scale transcoding. At the same time, the speed of reading video files in the video production process affects the computing resource occupancy time, which indirectly increases the computing cost.
[0031] To this end, the embodiment of the present application provides a video transcoding processing technical solution. In this technical solution, the video file is sliced and processed, and then merged after parallel transcoding to improve the transcoding efficiency; a cache server and preheating function are added to accelerate the speed of reading video segments. See below for details.
[0032] Finally, for ease of understanding, an exemplary operating environment is provided below.
[0033] like Figure 1 As shown, the operating environment diagram includes: Computing platform (with scheduling service), cache server (cache service), storage server (object storage service), client, etc.
[0034] The various types of servers described above may be located in a data center such as a single location, or distributed in different geographical locations (e.g., in multiple locations). These servers may provide services via a network. The network includes various network devices such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network may include physical links such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, and the like, or wireless links such as cellular links, satellite links, Wi-Fi links, and the like.
[0035] The computing platform can have scheduling services and computing tasks. The scheduling service is used to issue related tasks, and the computing tasks are used to execute related tasks. The scheduling service can schedule tasks through DAG (directed acyclic graph), which is a structure used to describe task dependencies. The computing platform can be a collection of infrastructure and software environments provided for the development and operation of various applications, supporting the abstraction and efficient management of computing resources (such as central processing units, graphics processing units, storage space, etc.). It can allocate resources on demand and provide a tool chain for development, testing, and deployment to simplify the usage process. Common types of computing platforms include cloud computing, high-performance computing, edge computing, and big data computing. These platforms are widely used in artificial intelligence development, real-time analysis, and large-scale data processing, helping users focus on core business without worrying about the operation and maintenance of the underlying infrastructure. The client may be configured to upload / access the above-mentioned server to obtain content and services. The client may include a mobile device, a tablet device, a laptop computer, a workstation, a virtual reality device, a gaming device, a digital streaming device, a vehicle terminal, a smart TV, a set-top box, etc., and may also include a virtualized computing instance. The virtualized computing instance may include a virtual machine, such as a simulation of a computer system, an operating system, a server, etc. The computing device may load a virtual machine based on a virtual image and / or other data defining specific software (e.g., an operating system, a dedicated application, a server) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on one or more computing devices.
[0036] Embodiment 1 This method embodiment can be executed in a cache server. Below, the cache server is used as the execution subject of this process.
[0037] Figure 2 The flowchart of the video transcoding processing method according to the first embodiment of the present application is schematically shown.
[0038] like Figure 2 As shown, the video transcoding processing method may include steps S200 to S206, wherein: Step S200: reading a target video file from a storage server to cache the target video file.
[0039] Step S202: providing the target video file to a computing platform so that the computing platform generates a first intermediate product according to the target video file.
[0040] Step S204: During the video transcoding process, multiple intermediate products generated by the computing platform are stored, wherein the multiple intermediate products include the first intermediate product.
[0041] Step S206 , in response to the read request of the computing platform, providing one or more of the plurality of intermediate products for use in subsequent tasks of the computing platform.
[0042] The video transcoding processing method provided in this embodiment actively caches the target video file through the cache server and provides it to the computing platform. The computing platform generates a first intermediate product based on the target video file. At the same time, the cache server responds to the reading request of the computing platform and provides one or more of the multiple intermediate products for subsequent tasks. This method speeds up the speed at which the computing platform reads the target video file and the intermediate product, thereby improving the speed of video transcoding to meet the needs of large-scale transcoding. In addition, the reading time of the target video file and the intermediate product is reduced, which can reduce the idle time of computing resources, shorten the processing cycle, and reduce computing costs.
[0043] The following combination Figure 2 , each step in steps S200~S206 and other optional steps are described in detail.
[0044] Step S200 , read the target video file from the storage server to cache the target video file.
[0045] The storage server may be an S3 object storage, which is a computer data storage architecture that manages data as objects. Each object generally includes the data itself, a varying amount of metadata, and a globally unique identifier. The target video file may be a video manuscript uploaded by a user. After the target video file is uploaded to the storage server, the cache server actively reads the target video file from the storage server and loads it into the memory cache of the cache server.
[0046] Step S202 , providing the target video file to a computing platform so that the computing platform generates a first intermediate product based on the target video file.
[0047] The computing platform is used to execute computing tasks. The computing platform can be configured with a scheduling service, which can issue related tasks and represent the dependencies between tasks through a DAG (directed acyclic graph), so that the execution order of tasks is logical.
[0048] In an optional embodiment, step S202 may further include: Step S300: if the target video file has been stored, provide the target video file to the computing platform.
[0049] Step S302: if the target video file does not exist, the target video file is loaded from the storage server and then provided to the computing platform.
[0050] Limited by the IO performance of the storage server, it is difficult for the computing platform to directly obtain the target video file from the storage server to meet the demand. Therefore, the target video file is provided to the computing platform through the cache server to accelerate the reading of the target video file. The computing platform first searches whether there is a target video file in the cache server. If the cache server has the target video file, the cache server responds to the reading request of the computing platform and provides the target video file to the computing platform. If the cache server does not have the target video file, the cache server goes back to the source to read the target video file, that is, the cache server automatically loads the target video file from the storage server, so that the computing platform can always obtain the target video file through the cache server.
[0051] In this embodiment, the target video is provided to the computing platform by the cache server, which speeds up the computing platform's reading speed of the target video file, thereby speeding up the processing speed of the target video file.
[0052] Step S204 , during the video transcoding process, multiple intermediate products generated by the computing platform are stored, and the multiple intermediate products include the first intermediate product.
[0053] Video transcoding can re-encode the content of video files to meet the requirements of different devices, platforms, or network conditions. When the computing platform performs tasks related to video transcoding, the computing platform will generate multiple intermediate products. The multiple intermediate products can be products generated by the computing platform performing slicing tasks, transcoding tasks, etc. These intermediate products will be temporarily stored by the cache server so that they can be provided to the computing platform later.
[0054] In this embodiment, a plurality of intermediate products are temporarily stored in a cache server to accelerate the flow of the intermediate products during the video transcoding process, thereby speeding up the video transcoding speed.
[0055] Step S206 , in response to a read request from the computing platform, providing one or more of the plurality of intermediate products for use in subsequent tasks of the computing platform.
[0056] When the computing platform executes related tasks, it needs to read the corresponding intermediate products from the cache server. For example, when the computing platform executes multiple transcoding tasks in parallel, the cache server needs to provide multiple target video slices so that the computing platform can execute multiple transcoding tasks.
[0057] In this embodiment, the cache server provides the computing platform with the intermediate products required for executing the tasks, so that the computing platform can read the intermediate products more quickly and thus can execute related tasks more quickly.
[0058] In an optional embodiment, step S206 may include: in response to a request from the computing platform, providing the multiple transcoded video slices to the computing platform; wherein the computing platform is used to: merge the multiple transcoded video slices into a target video product, and store the target video product in a storage server.
[0059] When the computing platform issues a merge task, the cache server responds to the computing platform's request to read multiple transcoded video slices and provides the multiple transcoded video slices to the computing platform for the merge task. The computing platform executes the merge task to merge the multiple transcoded video slices into a target video product, and stores the generated target video product in the storage server to facilitate long-term storage and reliable access to the target video product.
[0060] In this embodiment, a cache server provides multiple transcoded video slices to a computing platform, thereby accelerating the speed at which the computing platform reads the multiple transcoded video slices, thereby improving the effect of merging the multiple transcoded video slices.
[0061] In an optional embodiment, the first intermediate product is a product generated in response to a slicing task, and the first intermediate product includes multiple target video slices; the multiple intermediate products also include a second intermediate product.
[0062] The second intermediate product is a product generated in response to the transcoding task, and the second intermediate product includes: the computing platform reads the first intermediate product from the cache server and generates multiple transcoded video slices based on the first intermediate product.
[0063] The first intermediate product may be a plurality of target video slices obtained by slicing the target video file. By slicing the target video file into a plurality of target video slices, the transcoding speeds of the plurality of target video slices may be processed in parallel to improve the video transcoding efficiency. The second intermediate product may be a plurality of transcoded video slices obtained by transcoding the plurality of target video slices. The plurality of transcoded video slices are used to synthesize the target video product.
[0064] In this embodiment, the computing platform reads the intermediate product from the cache server, which speeds up the reading of the intermediate product and further speeds up the video transcoding.
[0065] In an optional embodiment, the video transcoding processing method further includes: responding to a deletion request from the computing platform, deleting the target video file and the plurality of intermediate products.
[0066] After the target video product is stored in the storage server, the storage server notifies the computing platform of the storage result. After receiving the notification, the computing platform issues a garbage collection task, and the cache server responds to the garbage collection task (the computing platform's deletion request) and deletes the target video file and multiple intermediate products. It should be noted that when the computing platform does not need to use a certain intermediate product, it can also directly issue the corresponding garbage collection task to enable the cache server to delete the corresponding intermediate product. For example, after the computing platform has executed multiple transcoding tasks, multiple target video slices in the cache server are no longer needed. The computing platform issues a target video slice recovery task, so that the cache server deletes multiple target video slices in response to the task.
[0067] In this embodiment, the cache server deletes the files and intermediate products of completed tasks in a timely manner, which can prevent the cache server from affecting performance due to insufficient space, and at the same time avoid unnecessary space resource consumption and reduce operating costs.
[0068] Embodiment 2 This method embodiment can be executed in a computing platform. The computing platform is taken as the execution subject of this process. It should be noted that the technical details and technical effects of this embodiment can refer to the first embodiment.
[0069] Figure 4 The flowchart of the video transcoding processing method according to the second embodiment of the present application is schematically shown.
[0070] like Figure 4 As shown, the video transcoding processing method may include steps S400 to S404, wherein: Step S400, in response to the slicing task, obtain the target video file from the cache server, and divide the target video file into multiple target video slices and store them in the cache server; the target video file is pre-read from the storage server and stored in the cache server.
[0071] Step S402, in response to a plurality of transcoding tasks, the plurality of target video slices are read from the cache server and the read plurality of target video slices are transcoded to obtain a plurality of transcoded video slices and store them in the cache server.
[0072] Step S404, in response to the slice merging task, read the multiple transcoded video slices from the cache server and merge the read multiple transcoded video slices to obtain a target video product and store it in the storage server.
[0073] The cache server actively loads the target video file from the storage server to speed up the speed at which the computing platform reads the target video. Directly transcoding the target video file is computationally intensive and time-consuming, so the target video file is divided into multiple smaller target video slices to facilitate parallel transcoding to obtain multiple transcoded video slices. Multiple transcoded video slices are merged into the target video product and stored in the storage server for long-term preservation and distribution.
[0074] In this embodiment, the computing platform obtains the target video file and the intermediate product from the cache server to speed up the computing platform to read the target video file and the intermediate product, thereby improving the speed of video transcoding to meet the needs of large-scale transcoding. In addition, the reading time of the target video file and the intermediate product is reduced, which can reduce the idle time of computing resources, shorten the processing cycle, and reduce computing costs.
[0075] In an optional embodiment, if Figure 5 As shown, the step S400 includes: Step S500: determining the slice positions of the target video file according to the key frames of the target video file.
[0076] Step S502: Slice the target video file according to the slice positions to obtain the multiple target video slices; wherein the multiple target video slices all start with a key frame.
[0077] Using key frames to determine the fragmentation position of the target video file can make the key frame the starting point of the target video slice, so that each target video slice can be decoded and played from this starting point without relying on other video segments. A key frame (Intra-coded Frame) is a complete image frame that exists independently of other frames and can be decoded independently without relying on the information of other frames. It is similar to a static image and can be regarded as a reference point in a video sequence.
[0078] In this embodiment, the slice position is determined by the key frame, and the key frame is used as the start of each target video slice, so that each target video slice can be decoded independently without relying on other video segments.
[0079] In an optional embodiment, if Figure 6 As shown, the step S404 includes: Step S600: determining a corresponding plurality of merging points based on the plurality of shard positions.
[0080] Step S602: align the key frames of the multiple transcoded video slices to corresponding merging points respectively, so as to merge them to obtain the target video product.
[0081] Based on the slice positions determined when executing the slicing task, the positions where the target video slices need to be spliced when merging are determined. Multiple merging points correspond to key frame positions in multiple target video slices, so that the spliced target video product can be consistent with the frame sequence and timeline of the target video file.
[0082] In this embodiment, multiple transcoded video slices can be seamlessly merged by aligning key frames with merge points, and the merged target video product can be seamlessly played, avoiding playback freezes caused by frame misalignment.
[0083] In an optional embodiment, if Figure 7 As shown, the video transcoding processing method also includes: Step S700: receiving a notification from the storage server that the target video product is stored.
[0084] Step S702: according to the notification, send a deletion request to the cache server, so that the cache server deletes the target video file, the multiple target video slices and the multiple transcoded video slices based on the deletion request.
[0085] In order to make this application easier to understand, the following Figure 8 Provide an example application, the operation process is as follows: S1. The user uploads a video manuscript, and the storage server (object storage service) stores the video manuscript.
[0086] S2. The cache server (cache service) actively loads the video manuscript from the storage server (preheats to the cache server) and notifies the storage server of the preheating result (responds to the preheating result).
[0087] S3. The storage server receives the preheating result. If the preheating is successful, the storage server sends the execution result notification to the computing platform. The execution result notification is a callback function, which can be the logic in the computing task or the logic of the computing platform framework layer.
[0088] In the case of preheating failure, an alarm notification is sent to the terminal because preheating failure is an unexpected result when the cache server is preheated in advance.
[0089] S4. The computing platform receives the execution result notification and issues the slicing task through the scheduling service set by the computing platform. The computing task (computing unit) set by the computing platform responds to the slicing task and reads the video manuscript from the cache server.
[0090] S5. The cache server responds to the request to read the video manuscript of the computing task and determines whether the cache is hit, that is, queries whether the video manuscript exists in the cache server.
[0091] In the case of a cache hit, the cache server provides the video manuscript to the computing task.
[0092] In the case of a cache miss, the cache server reads back from the storage server, that is, loads the video manuscript from the storage server and then provides it to the computing task.
[0093] S6. The computing task executes the slicing task to obtain multiple video slices, and sends the execution result notification to the scheduling service.
[0094] S7. After receiving the execution result notification, the scheduling service issues multiple transcoding tasks. In response to the multiple transcoding tasks, the computing task caches the multiple video slices in the cache server and reads the multiple video slices (slice data) from the cache server.
[0095] S8. The cache server provides multiple video slices to the computing task in response to the computing task's request to read multiple video slices.
[0096] S9, the computing task executes multiple transcoding tasks in parallel to obtain multiple transcoded video products (transcoding products), and stores the multiple transcoded video products in a cache server.
[0097] S10. The cache server caches multiple transcoded video products and then notifies the computing task, so that the computing task notifies the scheduling service of the execution result, so that the scheduling service sends a slice merging task to the computing task.
[0098] S11. The computing task responds to the slice merging task and reads multiple transcoded video products (slice product data) from the cache server.
[0099] S12. The cache server provides a plurality of transcoded video products to the computing task in response to the read request of the computing task.
[0100] S13, the computing task executes the slice merging task and stores the generated video product (slice merging product) to the storage server.
[0101] S14. The storage server notifies the computing task after storing the video product, so that the computing task notifies the scheduling service of the execution result, so that the scheduling service sends a garbage collection task (GC task) to the cache server.
[0102] S15. The cache server deletes the video manuscript data and the intermediate product data in response to the garbage collection task.
[0103] In this exemplary application, the target video file is actively cached by the cache server, and the intermediate products generated by the computing platform are cached. This method speeds up the speed at which the computing platform reads the target video file and the intermediate products, thereby increasing the speed of video transcoding to meet the needs of large-scale transcoding. In addition, the reading time of the target video file and the intermediate products is reduced, which can reduce the idle time of computing resources, shorten the processing cycle, and reduce computing costs.
[0104] Embodiment 3 Fig. 9 The block diagram of the video transcoding processing device according to the third embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are 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 program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Fig. 9 As shown, the device 1600 may include: a reading module 1610, a generating module 1620, a storage module 1630, and a providing module 1640, wherein: The reading module 1610 is used to read the target video file from the storage server to cache the target video file; A generating module 1620, configured to provide the target video file to a computing platform, so that the computing platform generates a first intermediate product according to the target video file; A storage module 1630, configured to store a plurality of intermediate products generated by the computing platform during the video transcoding process, wherein the plurality of intermediate products include the first intermediate product; The providing module 1640 is used to provide one or more of the plurality of intermediate products in response to a read request of the computing platform for use in subsequent tasks of the computing platform.
[0105] As an optional embodiment, the providing module 1640 is further used for: If the target video file has been stored, providing the target video file to the computing platform; or In the absence of the target video file, the target video file is loaded from the storage server and then provided to the computing platform.
[0106] As an optional embodiment, the first intermediate product is a product generated in response to the slicing task, and the first intermediate product includes a plurality of target video slices; The plurality of intermediate products further includes a second intermediate product; The second intermediate product is a product generated in response to the transcoding task, and the second intermediate product includes: the computing platform reads the first intermediate product from the cache server and generates multiple transcoded video slices based on the first intermediate product.
[0107] As an optional embodiment, the providing module 1640 is further used to: provide the plurality of transcoded video slices to the computing platform in response to a request of the computing platform; The computing platform is used to merge the multiple transcoded video slices into a target video product, and store the target video product in a storage server.
[0108] As an optional embodiment, the device 1600 is further used to: respond to a deletion request from the computing platform, and delete the target video file and the multiple intermediate products.
[0109] Embodiment 4 Fig.10 The block diagram of the video transcoding processing device according to the fourth embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are 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 program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Fig.10 As shown, the device 1700 may include: a slicing module 1710, a transcoding module 1720, and a merging module 1630, wherein: The slicing module 1710 is used to obtain a target video file from a cache server in response to a slicing task, and to slice the target video file into a plurality of target video slices and store them in the cache server; the target video file is pre-read from a storage server and stored in the cache server; The transcoding module 1720 is used for reading the multiple target video slices from the cache server in response to the multiple transcoding tasks and transcoding the multiple target video slices read to obtain multiple transcoded video slices and store them in the cache server; The merging module 1730 is used to respond to the slice merging task, read the multiple transcoded video slices from the cache server and merge the read multiple transcoded video slices to obtain the target video product and store it in the storage server.
[0110] As an optional embodiment, the merging module 1730 is also used to: receive a notification from the storage server that the target video product is stored; and based on the notification, send a deletion request to the cache server so that the cache server: deletes the target video file, the multiple target video slices and the multiple transcoded video slices based on the deletion request.
[0111] As an optional embodiment, the slicing module 1710 is also used to: determine the slicing position of the target video file according to the key frame of the target video file; slice the target video file according to the slicing position to obtain the multiple target video slices; wherein the multiple target video slices all start with a key frame.
[0112] As an optional embodiment, the merging module 1730 is further used to: determine a corresponding plurality of merging points based on the plurality of fragment positions; and align the key frames of the plurality of transcoded video slices to the corresponding merging points respectively to merge and obtain the target video product.
[0113] Embodiment 5 Fig.11 The schematic diagram of the hardware architecture of a computer device 10000 suitable for implementing the video transcoding processing method according to the third embodiment of the present application is shown schematically. 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 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. Fig.11 As shown, the computer device 10000 includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them: The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as 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 memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10010 can 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 can 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 memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 10010 can 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 in the computer device 10000, such as program codes of a video transcoding processing method, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or are to be output.
[0114] 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 run the program code stored in the memory 10010 or process data.
[0115] The network interface 10030 may include a wireless network interface or a wired network interface, and 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 through 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 communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.
[0116] It should be pointed out that Fig.11 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0117] In this embodiment, the video transcoding processing 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.
[0118] Embodiment 6 An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the video transcoding processing method in the embodiment are implemented.
[0119] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), 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 memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can 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 can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the computer-readable storage medium can also include both the 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 video transcoding processing method in the embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.
[0120] Embodiment 7 An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.
[0121] 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, optionally, they can be implemented by executable program codes of 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 executed in a different order from that herein, 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.
[0122] It should be noted that the above are only preferred embodiments of the present application, and the patent protection scope of the present application is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A video transcoding method, characterized in that: For a cache server, the method comprises: Reading a target video file from a storage server to cache the target video file; Providing the target video file to a computing platform so that the computing platform generates a first intermediate product according to the target video file; During the video transcoding process, storing a plurality of intermediate products generated by the computing platform, the plurality of intermediate products including the first intermediate product; In response to a read request from the computing platform, one or more of the plurality of intermediate products are provided for use in subsequent tasks of the computing platform.
2. The method according to claim 1, characterized in that Providing the target video file to a computing platform includes: If the target video file has been stored, providing the target video file to the computing platform; or In the absence of the target video file, the target video file is loaded from the storage server and then provided to the computing platform.
3. The method according to claim 1, characterized in that The first intermediate product is a product generated in response to the slicing task, and the first intermediate product includes a plurality of target video slices; The plurality of intermediate products further includes a second intermediate product; The second intermediate product is a product generated in response to the transcoding task, and the second intermediate product includes: the computing platform reads the first intermediate product from the cache server and generates multiple transcoded video slices based on the first intermediate product.
4. The method according to claim 3, characterized in that: The providing one or more of the plurality of intermediate products in response to the read request of the computing platform comprises: In response to a request from the computing platform, providing the plurality of transcoded video slices to the computing platform; The computing platform is used to merge the multiple transcoded video slices into a target video product, and store the target video product in a storage server.
5. The method according to claim 3, characterized in that: The method further comprises: In response to the deletion request of the computing platform, the target video file and the plurality of intermediate products are deleted.
6. A video transcoding method, characterized in that: For a computing platform, the method comprises: In response to the slicing task, a target video file is obtained from a cache server, and the target video file is sliced into a plurality of target video slices and stored in the cache server; the target video file is pre-read from a storage server and stored in the cache server; In response to the multiple transcoding tasks, the multiple target video slices are read from the cache server and the read multiple target video slices are transcoded to obtain multiple transcoded video slices and stored in the cache server; In response to the slice merging task, the multiple transcoded video slices are read from the cache server and the read multiple transcoded video slices are merged to obtain a target video product and store it in a storage server.
7. The method according to claim 6, characterized in that The method further comprises: receiving a notification from the storage server that the target video product is stored; According to the notification, a deletion request is sent to the cache server, so that the cache server deletes the target video file, the multiple target video slices, and the multiple transcoded video slices based on the deletion request.
8. The method according to claim 6, characterized in that The step of dividing the target video file into a plurality of target video slices and storing the slices in a cache server includes: Determining the slice positions of the target video file according to the key frames of the target video file; Slicing the target video file according to the slicing positions to obtain the multiple target video slices; Wherein, the multiple target video slices all start with a key frame.
9. The method according to claim 8, characterized in that The merging of the read multiple transcoded video slices includes: Based on the plurality of shard positions, determining a corresponding plurality of merge points; The key frames of the multiple transcoded video slices are respectively aligned with corresponding merging points to merge and obtain the target video product.
10. A video transcoding processing device, characterized in that: Used for a cache server, the device comprises: A reading module, used for reading a target video file from a storage server to cache the target video file; A generating module, configured to provide the target video file to a computing platform, so that the computing platform generates a first intermediate product according to the target video file; A storage module, used for storing a plurality of intermediate products generated by the computing platform during the video transcoding process, wherein the plurality of intermediate products include the first intermediate product; A providing module is used to provide one or more of the plurality of intermediate products in response to a read request of the computing platform for use in subsequent tasks of the computing platform.
11. A video transcoding processing device, characterized in that: For a computing platform, the device comprises: A slicing module, for obtaining a target video file from a cache server in response to a slicing task, and slicing the target video file into a plurality of target video slices and storing them in the cache server; the target video file is pre-read from a storage server and stored in the cache server; a transcoding module, configured to, in response to a plurality of transcoding tasks, read the plurality of target video slices from the cache server and transcode the plurality of target video slices read to obtain a plurality of transcoded video slices and store them in the cache server; The merging module is used to respond to the slice merging task, read the multiple transcoded video slices from the cache server and merge the read multiple transcoded video slices to obtain the target video product and store it in the storage server.
12. A computer device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; 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 according to any one of claims 1 to 9.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to claims 1 to 9 are implemented.