Method of processing a video, related apparatus and computer program product
By determining the transcoding duration based on the video description information and selecting the appropriate transcoding subject and method, the problem of low transcoding efficiency during video transmission is solved, and fast transcoding and efficient transmission are achieved.
Patent Information
- Application Number
- CN202411297489.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-09-14
AI Technical Summary
During the video transmission process, existing technologies find it difficult to efficiently perform transcoding without affecting the transcoding quality, resulting in resource waste and inefficient video uploading and publishing.
Determine the transcoding duration based on the video description information, perform transcoding locally or on the target device, and select the appropriate transcoding subject and method to achieve fast transcoding and synchronous delivery.
It improves the efficiency of video synchronization and transmission across various devices, reduces the transcoding burden on the platform, and optimizes resource utilization.
Smart Images

Figure CN119211604B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and apparatus for processing video, an electronic device, a computer-readable medium, and a computer program product. Background Art
[0002] As society develops, internet technology is also advancing. The internet provides a platform for users to communicate, exchange ideas, and share content with other users by posting videos online. For example, users can post videos on the "platform" or provide and share videos with other users through "directed transmission" between their devices and other users' devices.
[0003] In this context, to improve video playback quality and protect data, the players used by users and the platforms providing video sharing services often restrict the video formats that can be played. For example, the platform may only support playback of certain formats that meet the required clarity and data risk requirements.
[0004] In this context, if the source video format provided by the user does not meet the requirements, the platform needs to transcode the source video to obtain a video that can actually be used and played. Therefore, how to perform transcoding more effectively and efficiently during the transmission and communication of video without affecting the video transcoding quality is worthy of attention and urgent needs. Summary of the Invention
[0005] Various aspects of the present application provide a method, apparatus, electronic device, computer-readable storage medium, and computer program product for processing videos, which can determine the subject and method for performing video transcoding based on the transcoding capabilities of the video provider and receiver and the actual transcoding situation. This allows the subject and method for performing transcoding to be selected more accurately in accordance with the actual situation, allowing videos that need to be transcoded to be transcoded and adjusted to a usable state as quickly as possible, thereby improving the synchronization and transmission efficiency of videos between various devices.
[0006] In one aspect of the present application, a method for processing a video is provided, comprising: determining, based on description information of the video, a transcoding time required to transcode the video into a target format; in response to the transcoding time being less than or equal to a time threshold, locally transcoding the video to obtain a video in a target format; and sending the video in the target format to a target device based on a preconfigured communication path.
[0007] Another aspect of the present application provides an apparatus for processing a video, comprising: a transcoding duration determination module configured to determine, based on description information of the video, a transcoding duration required to transcode the video into a target format; a first format conversion module configured to locally transcode the video to obtain a video in a target format in response to the transcoding duration being less than or equal to a time threshold; and a first video sending module configured to send the video in the target format to a target device based on a preconfigured communication path.
[0008] Another aspect of the present application provides an electronic 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 to enable the at least one processor to execute the method for processing video provided above.
[0009] In another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the method for processing a video as provided above.
[0010] In another aspect of the present application, a computer program product includes a computer program having computer program instructions stored thereon. When the computer program is executed by a processor, the method for processing a video as provided above can be implemented.
[0011] In the solution provided by the embodiment of the present application, the transcoding time required to transcode the video into the target format is determined based on the video description information; in response to the transcoding time being less than or equal to the time threshold, the video is transcoded locally to obtain the video in the target format; and based on the pre-configured communication path, the video in the target format is sent to the target device. This makes it possible to more accurately select the subject and method for performing transcoding, so that the video to be transcoded can be transcoded and adjusted to a usable state as quickly as possible, thereby improving the synchronization and transmission efficiency of videos between various devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0014] Figure 1A schematic diagram of a video processing process provided in one embodiment of the present application;
[0015] Figure 2 A schematic diagram of a process for sending a video when the transcoding duration is greater than a time threshold, provided by an embodiment of the present application;
[0016] Figure 3 A schematic diagram of an architecture for implementing a video processing process in a specific application scenario provided by an embodiment of the present application;
[0017] Figure 4 A schematic diagram of the structure of a device for processing video provided in one embodiment of the present application;
[0018] Figure 5 The figure is a schematic diagram of the structure of an electronic device suitable for implementing the solution in the embodiment of the present application.
[0019] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0020] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. 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.
[0021] In a typical configuration of the present application, the terminal and the equipment of the service network each include one or more processors (CPUs), input / output interfaces, network interfaces and memories.
[0022] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0023] Computer-readable media include both permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology for information storage. Information can be computer program instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc-read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0024] As discussed above, how to perform transcoding more effectively and efficiently in the process of sending and communicating videos without affecting the quality of video transcoding is worthy of attention and an urgent need.
[0025] In some solutions, a transcoding tool is configured on the video receiver side, so that after the video receiver receives the sent video, it uses the transcoding tool to perform transcoding to obtain a transcoded video that meets the format requirements and is in a usable state.
[0026] However, this approach imposes stringent requirements on the computing power configuration of platforms, such as video receivers. Furthermore, due to the peaks and valleys in video volume, there may be excess computing power, resulting in wasted resources. For example, when a platform provides services to multiple users and users frequently or in large numbers send videos, the platform may be unable to complete transcoding in a timely and efficient manner due to limited computing power, thus affecting the efficiency of video upload and publishing.
[0027] In this regard, an embodiment of the present application provides a method for processing a video. The method determines the transcoding time required to transcode the video into a target format based on the video's description information; in response to the transcoding time being less than or equal to a time threshold, the method transcodes the video locally to obtain the target format; and based on a pre-configured communication path, the target format video is sent to the target device. This allows the subject and method for performing transcoding to be selected more accurately in accordance with the actual situation, allowing the video to be transcoded to be completed and adjusted to a usable state as quickly as possible, thereby improving the synchronization and transmission efficiency of the video between various devices.
[0028] In practical scenarios, the method can be executed by a user device, a device formed by integrating a user device and a network device via a network, or an application running on such a device. User devices include, but are not limited to, computers, mobile phones, tablets, smart watches, wristbands, and other terminal devices. Network devices include, but are not limited to, network hosts, single network servers, multiple network server clusters, or cloud computing-based computer collections. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a group of loosely coupled computers forming a virtual computer.
[0029] When the execution subject is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules, or as a single software or software module, and is not specifically limited here.
[0030] For ease of understanding, in the embodiments of this application, the platform is used as an example of the subject receiving and publishing videos. For example, the device that ultimately receives the video is the platform's server. Accordingly, the execution subject of the embodiments of this application can be the terminal device used by the user, compared to the server used by other subjects on the platform, etc.
[0031] Figure 1 A video processing process 100 provided in an embodiment of the present application is shown. The process 100 includes at least the following processing steps:
[0032] (Step) S101, based on the description information of the video, determining the transcoding time required to transcode the video into a target format.
[0033] In an embodiment of the present application, after the execution entity determines the video that needs to be uploaded (for example, the video is selected by the user based on a video database stored on the execution entity), it estimates the transcoding time required to transcode the video into the target format based on the description information of the video.
[0034] In some embodiments, the description information may include information related to actual transcoding, such as the video's playback duration, encoding format, packaging format, resolution, bitrate, and frame rate. The target format can be determined based on actual scenarios and requirements. For example, the target format can be the format that the platform expects users to upload and can be directly used by the platform.
[0035] Accordingly, the execution entity can similarly estimate the transcoding time required to transcode the video into the target format based on the description information. For example, the execution entity can estimate the transcoding time based on the workload required to convert the video from the current format to the target format. For example, the execution entity can determine the required computing resources based on differences in information such as the video size and format. The execution entity can then determine the time required to consume these computing resources based on the capabilities of the locally available processor, thereby estimating the transcoding time.
[0036] Alternatively or additionally, in the process of determining the target format, the format with the highest frequency of use or the one with the highest preset ranking can be selected as the target format based on the frequency of use of each format in the format set acceptable to the platform. In some embodiments, there can actually be multiple candidates for the target format, so that the execution entity can determine the actual target format from the candidates based on its own needs. For example, the execution entity can select a candidate that can be converted and has the shortest conversion time based on its own transcoding performance (for example, based on the description information, the time required to convert the video from the current state and format to the target format is determined, and the candidate with the shortest time can be regarded as the one with the highest conversion efficiency) as the target format.
[0037] In some embodiments, when the execution entity uploads videos multiple times, the execution entity may also determine the target format for this time based on the target format selection results in the past, for example, based on the format that has been selected the most times in the past as the target format.
[0038] Upon receiving a user's request to use a target application, the execution entity responds and determines the target application. For example, if the execution entity is a terminal device used by the user, the launch request may be manifested as a user launching or clicking on the application. For another example, if the execution entity is a server, the launch request may be manifested as a user launching or clicking on the application using the terminal device.
[0039] In some embodiments, the historical transcoding situation of the execution subject can be similarly utilized to more efficiently estimate and speculate the transcoding time required to transcode the video into the target format.
[0040] Specifically, a pre-trained regression model with this estimation capability can be selected, so that subsequent execution entities can estimate and infer the transcoding time required to transcode a video into a target format by utilizing the pre-trained regression model. The initial regression model can be trained using the historical time taken to transcode historical videos into the target format locally as sample output, and the historical description information corresponding to the historical videos as sample input, to complete the training of the initial regression model and obtain a (pre-trained) regression model.
[0041] Accordingly, when executing this step, the executing entity may alternatively or alternatively utilize the regression model to process the video description information to determine the transcoding time required to transcode the video into the target format. This can more efficiently estimate and speculate the transcoding time required to transcode the video into the target format.
[0042] S102: Determine whether the transcoding duration is less than or equal to a time threshold.
[0043] In an embodiment of the present application, after obtaining the transcoding duration based on the above S101, the execution entity compares the transcoding duration with the time threshold to determine whether the transcoding duration is less than or equal to the time threshold.
[0044] In some embodiments, the time threshold can be adaptively configured based on different needs. For example, the time threshold can be set based on a configuration provided by a user of the execution entity. In another example, the time threshold can be determined based on the maximum transcoding duration expected to be achieved by the execution entity, as confirmed and accepted by the user after communication between the platform and the user.
[0045] Next, if the execution subject determines that the transcoding duration is less than or equal to the time threshold, S103 is executed.
[0046] S103: Transcode the video locally to obtain a video in a target format.
[0047] In an embodiment of the present application, when the transcoding duration is less than or equal to a time threshold, the execution entity may choose to complete the video transcoding work locally and obtain a video in a target format accordingly.
[0048] Next, the execution entity can continue to select S104 to send the target format video to the target device (e.g., the server used by the platform) according to the pre-configured communication path. In this way, the execution entity can provide "collaborative" transcoding for the platform to reduce the pressure on the platform's server.
[0049] S104 : Send the video in the target format to the target device based on the pre-configured communication path.
[0050] As discussed above, in some embodiments, if the video may not be suitable for transcoding by the execution entity, or transcoding by, for example, the platform party can provide higher transcoding and publishing efficiency (for example, the local performance of the execution entity cannot meet the above-mentioned time threshold requirements for the transcoding time required for video transcoding, that is, the transcoding time is actually greater than the time threshold), then in such a case, the execution entity can choose to provide the video directly to the target device, so that the target device can complete the transcoding and then publish it.
[0051] For example, the above process 100 may further include S105. S105 may be executed when the execution subject determines in S102 that the transcoding duration is greater than the time threshold.
[0052] S105: Send the video to the target device based on the communication path.
[0053] Specifically, the entity can similarly send the video directly to the target device based on the above communication path.
[0054] S106: Control the target device to transcode the video into a target format locally on the target device to obtain the video in the target format.
[0055] Specifically, based on the above S105 directly sending and communicating the video to the target device, the execution entity controls the target device to transcode the video into the target format locally on the target device to obtain the video in the target format.
[0056] Subsequently, the video processing method provided by this application determines the transcoding time required to transcode the video into a target format based on the video's description information; in response to the transcoding time being less than or equal to a time threshold, the video is transcoded locally to obtain the target format video; and based on a pre-configured communication path, the target format video is sent to the target device. This allows the subject and method for performing transcoding to be selected more accurately in accordance with actual conditions, allowing the video to be transcoded to be completed and adjusted to a usable state as quickly as possible, thereby improving the synchronization and transmission efficiency of videos between various devices.
[0057] In some embodiments, as discussed above, for example, the video receiver of the platform may not only provide services for one user or one terminal device. In such a case, due to multiple users, multiple videos, etc., the server on the platform side may have a large number of transcoding tasks waiting to be processed (for example, other video transcoding tasks may already exist in the task execution sequence of the platform's server). In such a case, although the execution subject can still choose to use the target device to provide transcoding services for the video in response to the transcoding duration being greater than the time threshold, such an approach may not be the most "efficient" for the execution subject, which may cause the video sent by the execution subject to be published later. For example, after providing the video to the target device, the execution subject may need to wait for a long time before it can actually control the target device to provide transcoding services.
[0058] In some embodiments, even if the execution entity determines that the target device is needed to transcode the video, the execution entity can choose whether to "provide assistance" to the target device based on the waiting time. For example, for transcoding tasks with excessive waiting times, the execution entity can choose to "partially share" the task to reduce the processing pressure on the target device.
[0059] For this, please continue to refer to Figure 2 . Figure 2 The present invention provides a process 200 for sending a video when the transcoding duration exceeds a time threshold, as provided in an embodiment of the present invention. For example, process 200 may be an alternative or substitute implementation for a subject that determines that the transcoding duration exceeds the time threshold and desires to send the video to a target device over a communication path. Process 200 includes at least the following processing steps:
[0060] S201 : In response to a transcoding duration being greater than a time threshold, obtaining, from a target device, a transcoding waiting duration for a video and a reference transcoding duration required for the target device to transcode the video into a target format.
[0061] Specifically, the execution entity can respond when determining that the transcoding duration is greater than a time threshold, and based on the communication with the target device, obtain from the target device the transcoding waiting duration for the video and the reference transcoding duration required for the target device to transcode the video into the target format.
[0062] For example, the execution entity may request the target device to provide the waiting time required to process the video provided by the execution entity based on the execution status of the local task of the target device. For ease of understanding, this time can be described as the transcoding waiting time (that is, after the target device obtains the video, it needs to go through the transcoding waiting time before it can actually perform transcoding on the video), and request the target device to provide the reference transcoding time required for the target device to transcode the video into the target format locally (for example, the target device can also similarly determine the reference transcoding time based on the regression model trained for the target device discussed above).
[0063] S202: Determine whether the transcoding duration is greater than or equal to the sum of the transcoding waiting duration and the reference transcoding duration.
[0064] Specifically, after obtaining the video transcoding wait time and the reference transcoding time from the target device in step S201, the execution entity may add the two together. The result of the addition is then compared with the video transcoding time (i.e., the time required for the execution entity's local device to complete the video transcoding) to determine whether the transcoding time is greater than or equal to the sum of the transcoding wait time and the reference transcoding time.
[0065] Correspondingly, if the transcoding duration is greater than or equal to the sum of the two, the execution entity may choose to continue executing S203 and send the video to the target device based on the communication path.
[0066] This allows the execution entity to choose to have the target device perform the transcoding even if there is a wait, if it is more efficient to have the target device perform the transcoding entirely. This ensures transcoding efficiency while reducing the computing resource usage and consumption of the execution entity.
[0067] S203: Send the video to the target device based on the communication path.
[0068] As discussed above, in some embodiments, due to excessively long wait times, the sum of the transcoding wait time and the reference transcoding time may actually exceed the time required for the execution entity to complete the transcoding alone. Therefore, in such cases, to improve transcoding efficiency, the execution entity may choose to "provide partial assistance" to the target device by occupying or consuming some of its resources.
[0069] Specifically, the above process 200 may further include S204. S204 may be executed if the execution entity determines in S202 that the transcoding duration is less than the sum of the transcoding wait duration and the reference transcoding duration (i.e., in practice, the target device may perform the transcoding completely more slowly than the execution entity alone).
[0070] S204: Split the video into a first sub-video and a second sub-video based on the transcoding wait time.
[0071] Specifically, the execution entity can estimate the length of the video that can be transcoded by the execution entity within the transcoding wait time based on the local video transcoding capabilities. Then, based on this length, the execution entity splits the video into two parts: a first sub-video and a second video. The sub-transcoding duration corresponding to the first sub-video is equal to the transcoding wait time. In other words, the length of the first sub-video corresponds to the portion of the video that the execution entity can complete transcoding within the transcoding wait time.
[0072] S205 , starting a transcoding process of transcoding the first sub-video into a target format locally, and sending the second sub-video to a target device based on the communication path.
[0073] Specifically, the execution subject may synchronously select to start a transcoding process of transcoding the first sub-video into a target format locally, start transcoding the first sub-video, and send the second sub-video to the target device based on the above-mentioned communication path.
[0074] S206: Control the target device to transcode the second sub-video into a target format.
[0075] Specifically, the execution subject is similar to that discussed above, and continues to control the target device to transcode the second sub-video into the target format to obtain the second sub-video in the target format.
[0076] It should be understood that although the executing entity controls the target device to transcode the second sub-video into the target format in this step, in fact, the target device may not be able to immediately transcode the second sub-video upon receiving the second sub-video due to reasons such as processing a previous transcoding task, as discussed above.
[0077] Next, if the execution entity completes transcoding for the first sub-video locally and obtains the first sub-video in the target format, the execution entity may execute S207 in response thereto.
[0078] S207, sending the first sub-video in the target format to the target device based on the communication path, and controlling the target device to locally combine the first sub-video in the target format and the second sub-video in the target format obtained by transcoding the second sub-video to obtain a video in the target format.
[0079] Specifically, when the execution entity locally completes transcoding of the first sub-video and obtains the first sub-video in the target format, the execution entity selects to send the first sub-video in the target format to the target device based on the communication path. Furthermore, when the execution entity controls the target device to locally complete transcoding of the second sub-video and obtain the second sub-video in the target format, the target device combines the first sub-video and the second sub-video to obtain the video in the target format.
[0080] Therefore, during the waiting time, the execution entity can choose to complete part of the transcoding of the video, so as to utilize the transcoding capabilities of the target device while collaboratively and auxiliaryly utilizing the local transcoding capabilities of the execution entity, thereby improving the transcoding efficiency of the video in a collaborative manner between the two entities.
[0081] Based on any of the above embodiments, a platform's target device, for example, may desire to configure multiple "videos" (or video files) in different formats, bitrates, resolutions, and other formats for the same video content to meet different user playback requirements. For example, a user may request the platform to provide an appropriate bitrate to ensure smooth playback based on the performance of their terminal device.
[0082] Thus, after providing a target-format video, the execution entity can control the target device to generate a set of transcoded videos based on the target-format video locally, according to the bitrate-resolution list. The bitrate-resolution list indicates the bitrate and / or resolution associated with the required transcoded videos. This allows for the provision of transcoded videos with different bitrates and / or resolutions tailored to the video content.
[0083] For example, for video A in format X, a set of transcoded videos can be generated, consisting of video A in format X at bitrate Y1, video A in format X at bitrate Y2, and video A in format X at bitrate Y3. This can meet the personalized needs of different users for the same video at different bitrates.
[0084] In some embodiments, the transcoded video may also be configured to be in a format other than the target format to meet personalized requirements for formats in different scenarios.
[0085] In some embodiments, there may be requirements for video playback permission classification. For example, the platform may adaptively configure the user's video playback permission based on the video classification results. For example, if a video is classified as the first category, it may be allowed to be directly accessed and viewed by all users. If the video is classified as the second category, it may be allowed to be directly accessed and viewed by some users. If the video is classified as the third category, it may not be allowed to be provided to users for viewing.
[0086] In such a case, the execution subject may choose to control the target device to determine the playback authority classification of the video in the target format, and obtain a playback authority classification result.
[0087] Then, the execution entity associates the permission classification result with each transcoded video in a group of transcoded videos to indicate the playback permission classification of each transcoded video.
[0088] As a result, the execution entity can synchronize the classification results of the target format video to each transcoded video derived from the target format video, so as to improve the classification efficiency.
[0089] In some embodiments, the process of classifying the playback permission classification of the target format video can also be carried out in parallel with the process of generating the transcoded video. For example, the target device can choose to concurrently generate a set of transcoded videos based on the target format video while being controlled by the execution subject to perform the process of determining the playback permission classification of the target format video. In this way, after the transcoded videos are generated, they can be efficiently labeled and the playback permission classification corresponding to each transcoded video can be determined based on the classification results provided in the parallel classification process.
[0090] In some embodiments, the execution entity may first perform a classification process for the playback permission classification of the target format video, and upon determining that the playback permission classification meets the requirements (for example, in the case of the first and second classifications described above), generate a set of transcoded videos based on the target format video. This avoids erroneously generating transcoded videos of a video when the video is determined to be unplayable to the user, thereby wasting resources.
[0091] For easier understanding, you can also refer to Figure 3 . Figure 3 The embodiment of the present application provides an architecture 300 for implementing a video processing process in a specific application scenario.
[0092] In the architecture 300 , for example, the terminal device 310 may be used as the execution subject of the process of processing the video, and the server 330 may be used as the target device for receiving the video.
[0093] In the architecture 300 , when the terminal device 310 desires to send a video 313 to the server 330 , the terminal device 310 may utilize a recall model 315 to determine a transcoding duration 317 required to encode the video 313 into a target format.
[0094] Next, if the transcoding duration 317 is less than or equal to the time threshold, the terminal device 310 may encode the video 313 into a target format to obtain a video 323 in the target format.
[0095] Next, the terminal device 310 may send the video 323 in the target format to the server 330 based on the pre-configured communication path.
[0096] Accordingly, upon receiving the target format video 323, the server 330 may determine a playback permission classification result 325 for the target format video 323, and process the target format video 323 in parallel to generate a set of transcoded videos 340 corresponding to the target format video 323. For example, the set of transcoded videos 340 may include transcoded videos 341, 342, ..., 34N (where N is a positive integer).
[0097] Moreover, after determining the playback permission classification result 325 of the target format video 323, the server 330 can associate the playback permission classification result 325 of the target format video 323 with a group of transcoded videos 340 to indicate the playback permission classification results corresponding to videos 341, 342...34N, that is, the playback permission classification results of videos 341, 342...34N are all playback permission classification results 325.
[0098] The embodiment of the present application also provides a device for processing video, the structure of which is as follows: Figure 4 The device 400 shown includes: a transcoding duration determination module 410 configured to determine, based on video description information, the transcoding duration required to transcode the video into a target format; a first format conversion module 420 configured to, in response to the transcoding duration being less than or equal to a time threshold, locally transcode the video to obtain a video in a target format; and a first video sending module 430 configured to send the video in the target format to a target device based on a preconfigured communication path.
[0099] In some embodiments, the device 400 also includes: a second video sending module, configured to send the video to the target device based on the communication path in response to the transcoding duration being greater than the time threshold; a second format conversion module, configured to control the target device to transcode the video into a target format locally on the target device to obtain a video in the target format.
[0100] In some embodiments, the second video sending module includes: a duration confirmation submodule, configured to obtain the transcoding waiting time for the video and the reference transcoding time required for the target device to transcode the video into the target format from the target device in response to the transcoding duration being greater than the time threshold; a video sending submodule, configured to send the video to the target device based on the communication path in response to the transcoding duration being greater than or equal to the sum of the transcoding waiting time and the reference transcoding duration.
[0101] In some embodiments, the device 400 also includes: a video segmentation module, configured to, in response to the transcoding time being less than the sum of the transcoding waiting time and the reference transcoding time, segment the video into a first sub-video and a second sub-video based on the transcoding waiting time, wherein the sub-transcoding time corresponding to the first sub-video is equal to the transcoding waiting time; a sub-video transcoding and sending module, configured to locally start the transcoding process of transcoding the first sub-video into a target format, and send the second sub-video to the target device based on the communication path; a third format conversion module, configured to control the target device to transcode the second sub-video into a target format; a transcoding result sending and combination control module, configured to, in response to the completion of local transcoding of the first sub-video, obtain a first sub-video in a target format, send the first sub-video in a target format to the target device based on the communication path, and control the target device to locally combine the first sub-video in the target format and the second sub-video in the target format obtained by transcoding the second sub-video to obtain a video in the target format.
[0102] In some embodiments, the apparatus 400 further includes: a transcoded video group generation module, configured to control the target device to generate a group of transcoded videos based on the target format video locally on the target device according to the indication of the bit rate-resolution list after obtaining the target format video, wherein the bit rate-resolution is used to indicate the bit rate and / or resolution associated with the required transcoded video.
[0103] In some embodiments, the device 400 also includes: a video classification module, configured to control the target device to determine the playback permission classification of the video in the target format, and obtain the playback permission classification result; a classification result association module, configured to associate the permission classification result to each transcoded video in a group of transcoded videos to indicate the playback permission classification of each transcoded video.
[0104] In some embodiments, the transcoding time determination module 410 is further configured to use a regression model to process the description information of the video to determine the transcoding time required to transcode the video into the target format, wherein the regression model is trained based on the historical time consumed in locally transcoding historical videos into the target format as sample output and the historical description information of the historical videos as sample input.
[0105] Based on the same inventive concept, an electronic device, a readable storage medium, and a computer program product are also provided in an embodiment of the present application. The method corresponding to the electronic device can be the method for processing video in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The electronic device provided in an embodiment of the present application includes: 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 to enable the at least one processor to execute the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.
[0106] An electronic device can be a user device, or a device formed by integrating a user device and a network device via a network, or an application running on any of the above devices. User devices include, but are not limited to, computers, mobile phones, tablets, smart watches, wristbands, and other terminal devices. Network devices include, but are not limited to, network hosts, single network servers, multiple network servers, or a collection of computers based on cloud computing, and can be used to implement some of the processing functions required for setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a group of loosely coupled computers forming a virtual computer.
[0107] Figure 5 The structure of an electronic device suitable for implementing the methods and / or technical solutions in the embodiments of the present application is shown. The electronic device 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 502 or programs loaded from a storage unit 508 into a random access memory (RAM) 503. RAM 503 also stores various programs and data required for system operation. CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to bus 504.
[0108] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, a touch screen, a microphone, an infrared sensor, and the like; an output section 507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, and speakers; a storage section 508 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, and a semiconductor memory; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 509 performs communication processing via a network such as the Internet.
[0109] In particular, the methods and / or embodiments of the present application can be implemented as computer software programs. For example, the embodiments disclosed herein include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the method illustrated in the flowchart. When the computer program is executed by the central processing unit (CPU) 501, the aforementioned functions defined in the method of the present application are performed.
[0110] Another embodiment of the present application further provides a computer-readable storage medium and a computer program product, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application.
[0111] Specifically, this embodiment may employ any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may, for example, be a system, device, or component including, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or device.
[0112] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0113] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0114] The computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0115] The flow chart or block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the equipment, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code include one or more executable instructions for realizing the logical function of the specification. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs the function or operation of the specification, or can be implemented with a combination of dedicated hardware and computer instructions.
[0116] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0117] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules and units is only a logical function division. There may be other division methods in actual implementation. For example, with units as an example, for example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0118] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0119] In addition, the functional modules and units in the various embodiments of the present application may be integrated into a single processing module or unit, or each module or unit may exist physically separately, or two or more units may be integrated into a single module or unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional modules or units.
[0120] The above-mentioned integrated modules and units implemented in the form of software functional modules and units can be stored in a computer-readable storage medium. The above-mentioned software functional modules and units are stored in a storage medium and include a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard drives, read-only memories (ROM), random access memories (RAM), magnetic disks, optical disks, and other media that can store program code.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
[0122] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. Terms such as "first" and "second" are used to indicate names and do not imply any particular order.
Claims
1. A method for processing a video, comprising: Determining, based on the video description information, a transcoding time required to transcode the video into a target format; In response to the transcoding duration being less than or equal to a time threshold, locally transcoding the video to obtain a video in a target format; sending the video in the target format to the target device based on a preconfigured communication path; In response to the transcoding duration being greater than the time threshold, obtaining, from the target device, a transcoding wait duration for the video and a reference transcoding duration required for the target device to transcode the video into a target format; In response to the transcoding duration being greater than or equal to the sum of the transcoding wait duration and the reference transcoding duration, sending the video to a target device based on the communication path; The target device is controlled to transcode the video into the target format locally on the target device to obtain the video in the target format.
2. The method according to claim 1, further comprising: In response to the transcoding duration being less than the sum of the transcoding wait duration and the reference transcoding duration, dividing the video into a first sub-video and a second sub-video based on the transcoding wait duration, wherein the sub-transcoding duration corresponding to the first sub-video is equal to the transcoding wait duration; Starting a transcoding process locally to transcode the first sub-video into the target format, and sending the second sub-video to the target device based on the communication path; controlling the target device to transcode the second sub-video into the target format; In response to the completion of local transcoding of the first sub-video, a first sub-video in a target format is obtained, the first sub-video in a target format is sent to the target device based on the communication path, and the target device is controlled to locally combine the first sub-video in the target format and the second sub-video in the target format obtained by transcoding the second sub-video on the target device to obtain a video in a target format.
3. The method according to any one of claims 1 to 2, further comprising: After the target device obtains the video in the target format, it controls the target device to generate a set of transcoded videos based on the video in the target format according to the instructions of the bit rate-resolution list locally on the target device, wherein the bit rate-resolution is used to indicate the bit rate and / or resolution associated with the required transcoded video.
4. The method according to claim 3, further comprising: Controlling the target device to determine the playback permission classification of the video in the target format, and obtaining the playback permission classification result; The permission classification result is associated with each transcoded video in the group of transcoded videos to indicate the playback permission classification of each transcoded video.
5. The method according to claim 1, wherein Determining, based on the description information of the video, a transcoding time required to transcode the video into a target format includes: A regression model is used to process the description information of the video to determine the transcoding time required to transcode the video into a target format, wherein the regression model is trained based on the historical time consumed to locally transcode historical videos into a target format as sample output and the historical description information of the historical videos as sample input.
6. A device for processing video, comprising: a transcoding duration determining module configured to determine a transcoding duration required to transcode the video into a target format based on the description information of the video; A first format conversion module is configured to, in response to the transcoding duration being less than or equal to a time threshold, locally transcode the video to obtain a video in a target format; A first video sending module is configured to send the video in the target format to a target device based on a preconfigured communication path; Also includes: The second video sending module includes: a duration confirmation submodule configured to, in response to the transcoding duration being greater than the time threshold, obtain, from the target device, a transcoding wait duration for the video and a reference transcoding duration required for the target device to transcode the video into a target format; a video sending submodule configured to, in response to the transcoding duration being greater than or equal to the sum of the transcoding wait duration and the reference transcoding duration, send the video to the target device based on the communication path; The second format conversion module is configured to control the target device to transcode the video into the target format locally on the target device to obtain the video in the target format.
7. An electronic device, comprising: at least one processor; as well as 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 5.
8. A computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 5.
9. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Video rendering method and system for reducing local computing power load
CN116828215A