Method of processing video, related apparatus and computer program product
By determining the transcoding time based on the video description information and selecting a suitable transcoding method, the problem of low transcoding efficiency during video transmission and communication is solved, and efficient synchronization and transmission of videos between various devices is achieved.
Patent Information
- Application Number
- CN202411297489.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-14
AI Technical Summary
During video transmission and communication, it is difficult for the prior art to perform transcoding efficiently without affecting the quality of video transcoding, resulting in waste of resources and low efficiency in uploading and publishing of videos.
Determine the transcoding time based on the description information of the video, and determine whether to transcoding locally or send the video to the target device for transcoding based on the time threshold, so as to select the transcoding subject and method more in line with the actual situation. , improve the synchronization and transmission efficiency of video between various devices.
Through this method, transcoding and adjustment of videos can be done more quickly, synchronizing and sending videos between various devices can be improved, reducing pressure on the platform and avoiding waste of resources.
Smart Images

Figure CN119211604A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for processing a video, an electronic device, a computer-readable medium, and a computer program product. Background Art
[0002] As society develops, Internet technology is also improving. The Internet can provide users with a platform for communication, allowing users to communicate, exchange and share content with other users by posting videos on the Internet. For example, users can post videos on the "platform" or provide and share videos with other users through "directional transmission" between the device they use and the devices used by other users.
[0003] In this context, in order to improve video playback quality and protect data, the players used by users and the platforms that provide video sharing services usually restrict the video formats that can be played. For example, the platform may only provide playback support for some formats that meet the requirements for clarity and data risk.
[0004] In this context, if the format of the source video 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 in the process of sending and communicating videos without affecting the quality of video transcoding is worthy of attention and urgent needs. Summary of the invention
[0005] The present application provides a method, device, electronic device, computer-readable storage medium and computer program product for processing videos, which can determine the subject and method of executing video transcoding based on the transcoding capabilities of the video provider and the receiver and the actual transcoding situation. As a result, the subject and method of executing transcoding can be selected more in line with the actual situation, so that the video to be transcoded can be transcoded and adjusted to a usable state as soon as possible, and the synchronization and transmission efficiency of the video between various devices can be improved.
[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 the transcoding duration required to transcode the video into a target format based on description information of the video; 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 so that the at least one processor can 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, based on the description information of the video, the transcoding time required to transcode the video into the target format is determined; 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; based on the pre-configured communication path, the video in the target format is sent to the target device. As a result, it is possible to select the subject and method of performing transcoding more in line with the actual situation, so that the video to be transcoded can be transcoded and adjusted to a usable state as quickly as possible, which can improve the synchronization and transmission efficiency of the video 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 the description 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 paying any creative labor.
[0013] Other features, objects and advantages of the present application will become more apparent by 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 by an embodiment of the present application;
[0015] Figure 2 A schematic diagram of a process of sending a video when the transcoding time 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 a video provided in an embodiment of the present application;
[0018] Figure 5 The present invention 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] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work 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 (CPU), input / output interface, network interface and memory.
[0022] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0023] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer program instructions, data structures, modules of programs 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, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media 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 without affecting the quality of video transcoding during the process of sending and communicating videos 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 side obtains 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, in this way, for example, the video receivers on the platform, on the one hand, strict requirements are placed on the computing power configuration of the platform, and on the other hand, with the peak and valley changes in the video volume, there may be excess computing power, resulting in a waste of resources. For example, in the process of the platform providing services to multiple users, when users frequently send videos or a large number of users send videos, the platform may be unable to complete transcoding in a timely and efficient manner due to the limited computing power provided by the platform, affecting the efficiency of uploading and publishing videos.
[0027] In this regard, an embodiment of the present application provides a method for processing a video, which determines the transcoding time required to transcode the video into a target format based on the description information of the video; in response to the transcoding time being less than or equal to a time threshold, the video is transcoded locally to obtain a video in a target format; based on a pre-configured communication path, the video in the target format is sent to a target device. Thus, it is possible to select the subject and method for performing transcoding more in line with the actual situation, so that the video to be transcoded can be transcoded and adjusted to a usable state as quickly as possible, and the synchronization and transmission efficiency of the video between various devices can be improved.
[0028] In actual scenarios, the execution subject of the method can be a user device, or a device formed by integrating a user device and a network device through a network, or an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablet computers, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[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 no specific limitation is made here.
[0030] For ease of understanding, in the embodiments of the present application, the platform is used as an example of the subject that receives and publishes the video. For example, the device that ultimately receives the video is the server of the platform. Accordingly, the execution subject of the embodiments of the present application can be the terminal device used by the user, compared to the server used by other subjects of the platform, etc.
[0031] Figure 1 A process 100 for processing a video provided by 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 the video's playback duration, encoding format, packaging format, resolution, bit rate, and frame rate, etc., and information related to actual transcoding. The target format may be determined in combination with actual scenarios and requirements. For example, the target format may be a format that the platform expects users to upload and that can be directly used by the platform.
[0035] Accordingly, the execution subject can similarly estimate the transcoding time required to transcode the video into the target format based on the description information, for example, based on the workload required to convert the video from the current format to the target format. For example, the execution subject can determine the required amount of computing resources based on the difference between the size of the video, format information, and other information. Then, the execution subject determines the time required to consume these computing resources based on the capabilities of the local processor that can be used, and then estimates 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 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 may 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, determine the time required to convert the video from the current state and format to the target format, where 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 subject uploads videos multiple times, the execution subject may also determine the target format this time based on the selection results of the target format in history, for example, based on the format selected the most times in history as the target format.
[0038] The execution subject responds to the user's request to use the target application and determines the target application. For example, when the execution subject is exemplified as a terminal device used by the user, the start request can be expressed as the user's start operation or click operation on the application. For another example, when the execution subject is exemplified as a server, the start request can be expressed as the user's start operation or click operation on the application using the terminal device.
[0039] In some embodiments, the historical transcoding situation of the execution subject can also be similarly used 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 the estimation capability may be selected so that the subsequent execution subject can estimate and speculate the transcoding time required to transcode the video into the target format by using the pre-trained regression model. The initial regression model may be trained based on the historical time taken to transcode the historical video into the target format locally as sample output and the historical description information corresponding to the historical video as sample input to complete the training of the initial regression model and obtain the (pre-trained) regression model.
[0041] Accordingly, when executing this step, the execution subject may, as an alternative or substitute, use the regression model to process the description information of the video to determine the transcoding time required to transcode the video into the target format, thereby more efficiently estimating and inferring the transcoding time required to transcode the video into the target format.
[0042] S102, determining whether the transcoding duration is less than or equal to a time threshold.
[0043] In an embodiment of the present application, after the transcoding duration is obtained 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 requirements. For example, the time threshold can be set accordingly based on the configuration provided by the user using the execution subject. For another example, the time threshold can also be determined based on the longest transcoding duration expected to be achieved by the execution subject after the platform communicates with the user and is confirmed and accepted by 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, transcoding 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 subject may continue to select execution S104 to send the target format video to the target device (e.g., the server used by the platform party) according to the pre-configured communication path. Thus, the execution subject can provide "cooperative" transcoding for the platform party to reduce the pressure on the platform party's server.
[0049] S104: Send the video in the target format to the target device based on the preconfigured 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 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 as to complete the transcoding using the target device, and then publish it.
[0051] For example, the above process 100 may further include S105. S105 may be executed in the above S102 when the execution subject determines that the transcoding time 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, controlling 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 that directly sends and communicates the video to the target device, the execution subject 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] Then, the method for processing videos provided by the present application determines the transcoding time required to transcode the video into the target format based on the description information of the video; 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; based on the pre-configured communication path, the video in the target format is sent to the target device. Thus, it is possible to select the subject and method for performing transcoding more in line with the actual situation, so that the video to be transcoded can be transcoded and adjusted to a usable state as quickly as possible, and the synchronization and transmission efficiency of the video between various devices can be improved.
[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 in the server of the platform). 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 a method 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 actually controlling the target device to provide transcoding services.
[0058] In some embodiments, even if the execution subject determines that the target device is needed to transcode the video, the execution subject can choose whether to "provide assistance" to the target device based on the waiting time. For example, for transcoding tasks with too long waiting time, the execution subject can choose to "partially share" to reduce the processing pressure of the target device.
[0059] For this, please continue to refer to Figure 2 . Figure 2 A process 200 for sending a video when the transcoding time is longer than a time threshold provided by an embodiment of the present application is shown. For example, process 200 may be an alternative or replacement implementation when the execution subject determines that the transcoding time is longer than the time threshold and desires to send the video to the target device based on the 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 determine that the transcoding duration is greater than a time threshold and respond based on the communication with the target device to obtain the transcoding waiting time for the video and the reference transcoding time required for the target device to transcode the video into a target format from the target device.
[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, the 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 transcode the video), and request the target device to provide the reference transcoding time required for the target device's local transcoding of the video to the target format (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 the execution subject obtains the transcoding waiting time and the reference transcoding time for the video from the target device based on the above S201, the two can be added together. The result of the addition is then compared with the transcoding time of the video (i.e., the time required for the execution subject to complete the transcoding of the video locally) to determine whether the transcoding time is greater than or equal to the sum of the transcoding waiting 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 subject may choose to continue to execute S203 and send the video to the target device based on the communication path.
[0066] Thus, the execution subject can 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 in its entirety. Thus, while taking into account the efficiency of transcoding, the occupation and consumption of the computing resources of the execution subject are reduced.
[0067] S203: Send the video to the target device based on the communication path.
[0068] As discussed above, in some embodiments, due to the long waiting time, the sum of the transcoding waiting time and the reference transcoding time may actually be greater than the time required for the execution subject to complete the transcoding alone. Therefore, in such a case, in order to improve the transcoding efficiency, the execution subject may choose to occupy and consume part of the execution subject's resources to "provide partial assistance" to the target device.
[0069] Specifically, in the above process 200, S204 may also be included. S204 may be executed when the execution subject determines in S202 that the transcoding duration is less than the sum of the transcoding waiting duration and the reference transcoding duration (that is, in fact, the complete transcoding performed by the target device may become "slower" than being completed by the execution subject alone).
[0070] S204: Divide the video into a first sub-video and a second sub-video based on the transcoding waiting time.
[0071] Specifically, the execution subject can estimate the length of the video that can be transcoded by the execution subject during the transcoding waiting time based on the local transcoding capability of the video. Then, based on the length, the execution subject splits the video into two parts, the first sub-video and the second video. The sub-transcoding time corresponding to the first sub-video is equal to the transcoding waiting time. That is, the length of the first sub-video corresponds to the part of the video that the execution subject can complete transcoding during the transcoding waiting 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 can synchronously select to start the transcoding process of transcoding the first sub-video into the 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 subject completes the transcoding of the first sub-video locally and obtains the first sub-video in the target format, the execution subject 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 subject completes the transcoding of the first sub-video locally and obtains the first sub-video in the target format, the first sub-video in the target format is sent to the target device based on the communication path. Furthermore, when the execution subject controls the target device to complete the transcoding of the second sub-video locally on the target device and obtains the second sub-video in the target format, the target device obtains the video in the target format by combining the first sub-video and the second sub-video.
[0080] Therefore, during the waiting time, the execution subject can be selected to complete partial transcoding of the video, so as to collaboratively and auxiliary utilize the local transcoding capabilities of the execution subject while utilizing the transcoding capabilities of the target device, thereby improving the transcoding efficiency of the video in a collaborative manner between the two subjects.
[0081] Based on any of the above embodiments, for example, the target device of the platform may expect to configure multiple "videos" (or video files) in different formats, bit rates, resolutions, etc. for the same video content to meet different user playback requirements. For example, based on the performance of the terminal device used, the user may require the platform to provide a suitable bit rate that can meet the smooth playback requirements.
[0082] Thus, when the execution subject provides the video in the target format, the target device can be controlled 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 on the local of the target device after obtaining the video in the target format. Bit rate-resolution is used to indicate the bit rate and / or resolution associated with the required transcoded video. That is, transcoded videos with different bit rates and / or resolutions are provided differently for the video content.
[0083] For example, for video A in X format, a group of transcoded videos consisting of video A in X format with Y1 bit rate, video A in X format with Y2 bit rate, and video A in X format with Y3 bit rate can be generated accordingly, thereby satisfying the personalized needs of different users for the same video at different bit rates.
[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 the format in different scenarios.
[0085] In some embodiments, there may be a requirement for the classification of playback permissions for videos. For example, the platform may adaptively configure the user's playback permissions for videos based on the classification results of the videos. For example, if a video is classified into the first category, it may be allowed to be directly acquired and viewed by all users; if the video is classified into the second category, it may be allowed to be directly acquired and viewed by some users; if the video is classified into the third category, it may not be allowed to be provided to users for viewing.
[0086] In this 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 the 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 video in the target format to each transcoded video derived from the video in the target format, so as to improve the classification efficiency.
[0089] In some embodiments, the classification process for 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 group 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. Thus, after the transcoded videos are generated, they can be efficiently marked 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 subject may also first perform a classification process for the playback permission classification of the target format video, and after determining that the playback permission classification meets the requirements (for example, in the case of the first classification and the second classification mentioned above), generate a set of transcoded videos based on the target format video. In this way, it is avoided that when the video is determined to be unplayable to the user, the transcoded video of the video is mistakenly generated, resulting in a waste of resources.
[0091] For easier understanding, you can also refer to Figure 3 . Figure 3 The structure 300 for implementing a video processing process in a specific application scenario provided by an embodiment of the present application is shown.
[0092] In the architecture 300 , illustratively, the terminal device 310 can be used as the execution subject of the process of processing the video, and the server 330 can 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 preconfigured communication path.
[0096] Accordingly, upon receiving the target format video 323, the server 330 may determine the playback permission classification result 325 of 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] Furthermore, 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 present application also provides a device for processing a video. The structure of the device is as follows: Figure 4 The device 400 shown. The device 400 includes: a transcoding duration determination module 410, configured to determine the transcoding duration required to transcode the video into a target format based on the description information of the video; a first format conversion module 420, configured to locally transcode the video in response to the transcoding duration being less than or equal to a time threshold to obtain a video in a target format; 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, 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 in response to a transcoding duration being greater than a time threshold; a video sending submodule, configured to send the video to the target device based on a communication path in response to a transcoding duration being greater than or equal to the sum of the transcoding waiting duration and the reference transcoding duration.
[0101] In some embodiments, the device 400 also includes: a video segmentation module, configured to respond to the transcoding duration being less than the sum of the transcoding waiting duration and the reference transcoding duration, and to segment the video into a first sub-video and a second sub-video based on the transcoding waiting duration, wherein the sub-transcoding duration corresponding to the first sub-video is equal to the transcoding waiting duration; a sub-video transcoding and sending module, configured to locally start a transcoding process of transcoding the first sub-video into a target format, and send the second sub-video to a target device based on a 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 respond to the completion of local transcoding of the first sub-video to 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 a target format and the second sub-video in a target format obtained by transcoding the second sub-video to obtain a video in a 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 with 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 a 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 may 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 connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.
[0106] The electronic device may be a user device, or a device formed by integrating a user device and a network device through a network, or an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablet computers, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, which can be used to implement some processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[0107] Figure 5 The structure of an electronic device suitable for implementing the method and / or technical solution in the embodiment of the present application is shown, and the electronic device 500 includes a central processing unit (CPU, Central Processing Unit) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM, Read Only Memory) 502 or the program loaded from the storage part 508 to the random access memory (RAM, Random Access Memory) 503. In RAM 503, various programs and data required for system operation are also stored. CPU 501, ROM 502 and RAM 503 are connected to each other through bus 504. Input / output (I / O, Input / Output) 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, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, etc., and a speaker, etc.; a storage section 508 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, a semiconductor memory, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet.
[0109] In particular, the methods and / or embodiments in the embodiments of the present application may be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 501, the above functions defined in the method of the present application are executed.
[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, the present embodiment can adopt any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, systems, devices or devices including but not limited to electricity, magnetism, light, electromagnetic, infrared, or semiconductors, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0112] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0113] The program code embodied on the 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] Computer program code for performing the operations of the present application may 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 may be executed entirely on the user's computer, partially on the user's computer, as a separate 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 may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0115] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0116] Those skilled in the art can 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 the present 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, 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] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0119] In addition, each functional module or unit in each embodiment of the present application may be integrated into one processing module or unit, or each module or unit may exist physically separately, or two or more units may be integrated into one module or unit. The above-mentioned integrated unit 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 function modules and units can be stored in a computer-readable storage medium. The above-mentioned software function modules and units are stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform some steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[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 it. 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] In addition, 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 stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A method for processing a video, comprising: Determine, based on the description information of the video, 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; Based on a preconfigured communication path, the video in the target format is sent to the target device.
2. The method according to claim 1, further comprising: In response to the transcoding duration being greater than the time threshold, sending the video to the 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.
3. The method according to claim 2, wherein: In response to the transcoding duration being greater than the time threshold, sending the video to the target device based on the communication path includes: In response to the transcoding duration being greater than the time threshold, acquiring, from the target device, a transcoding waiting 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 waiting duration and the reference transcoding duration, the video is sent to a target device based on the communication path.
4. The method according to claim 3, further comprising: In response to the transcoding duration being less than the sum of the transcoding waiting duration and the reference transcoding duration, dividing the video into a first sub-video and a second sub-video based on the transcoding waiting duration, wherein the sub-transcoding duration corresponding to the first sub-video is equal to the transcoding waiting 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 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 locally on the target device to obtain a video in the target format.
5. The method according to any one of claims 1 to 4, further comprising: After the target device obtains the video in the target format, the target device is controlled 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.
6. The method according to claim 5, 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.
7. The method according to claim 1, wherein: The step of 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 the target format as sample output and the historical description information of the historical videos as sample input.
8. A device for processing video, comprising: A transcoding duration determination module is 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 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; The first video sending module is configured to send the video in the target format to the target device based on a preconfigured communication path.
9. 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 7.
10. 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 7.
11. 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 7.
Citation Information
Patent Citations
Method and system for acquiring media files
CN102780878A
Video distributed coding format converting method
CN102780918A
Method and system for converting video with non-supporting format in mobile terminal
CN105049931A
System and method of automated test on concurrency performance of transcoding server
CN108304286A
Video transcoding processing method and device, computer equipment and storage medium
CN110049350A