Video processing method, related device and equipment

By making different video segments share the same decoder in the video file, the problem of tight decoder resources in video processing is solved, and the resource usage is reduced.

CN115695903BActive Publication Date: 2025-08-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110825049.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-21
Publication Date
2025-08-12
Estimated Expiration
2041-07-21

AI Technical Summary

Technical Problem

In video processing, due to the large number of video segments, the decoder resources are tight, and the number of decoders is limited under hardware limitations, which increases resource usage.

Method used

By making different video segments share the same decoder for decoding in the same video file, the number of decoders coexist on the terminal device is reduced.

Benefits of technology

Effectively reduce the number of decoders coexisting on terminal devices and reduce resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695903B_ABST
    Figure CN115695903B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method, related apparatus and equipment for video processing, which are used to reduce the number of coexisting decoders and achieve the effect of reducing resource usage. The method of the embodiment of the present application includes: based on the video editing application interface, responding to the first video upload instruction, obtaining the first video file; and determining the first video segment and the second video segment from the first video file. Calling the first decoder to decode the first video segment within the target time period, wherein the target time period includes the end decoding time for the first video segment. Based on the video editing application interface, responding to the decoding instruction for the second video segment, determining the initial decoding time of the second video segment; if the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to the preset duration, calling the first decoder to decode the second video segment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video processing, and in particular to a video processing method, related apparatus and equipment. Background Art

[0002] In the video field, video files can be edited to make them more enjoyable to watch. This process also involves video encoding and decoding. Video encoding technology can compress the size of video files to facilitate transmission. During video playback, video decoding can be used to restore the video.

[0003] In one video processing method, a video file may be segmented to obtain multiple video segments, and different decoders may be used to decode different video segments.

[0004] In this approach, decoders are pre-created before decoding begins. Therefore, decoders corresponding to multiple video segments may exist at any given moment, resulting in decoder coexistence. When there are many video segments, the number of coexisting decoders on the playback device increases. Due to hardware limitations, the number of coexisting decoders on a decoding device is limited. This approach increases decoder resources and increases resource usage. Summary of the Invention

[0005] In view of this, the present application provides a video processing method, related devices and equipment, which use the same decoder to decode different video segments in the same video file, reducing the number of coexisting decoders on the terminal device and achieving the effect of reducing resource usage.

[0006] On one hand, the present application provides a video decoding method, comprising:

[0007] Based on the video editing application interface, responding to the first video upload instruction, obtaining the first video file;

[0008] determining a first video segment and a second video segment from the first video file;

[0009] Invoking a first decoder to decode the first video segment within a target time period, wherein the target time period includes a termination decoding time for the first video segment;

[0010] Based on the video editing application interface, responding to the decoding instruction for the second video segment, determining an initial decoding time of the second video segment;

[0011] If the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to the preset duration, the first decoder is called to decode the second video segment.

[0012] Another aspect of the present application provides a video processing device, comprising:

[0013] An acquiring unit, configured to acquire a first video file in response to a video upload instruction based on a video editing application interface;

[0014] A processing unit for:

[0015] determining a first video segment and a second video segment from the first video file;

[0016] Invoking a first decoder to decode the first video segment within a target time period, wherein the target time period includes a termination decoding time for the first video segment;

[0017] Based on the video editing application interface, responding to the decoding instruction for the second video segment, determining an initial decoding time of the second video segment;

[0018] If the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to the preset duration, the first decoder is called to decode the second video segment.

[0019] In one possible design, in an implementation of another aspect of the embodiment of the present application, the acquiring unit is further configured to acquire a first decoding identifier based on the first video segment, wherein the first decoding identifier includes a first editing track identifier, and the first editing track identifier is used to indicate a first editing track of the first video segment in a video editing application;

[0020] The processing unit is further configured to determine the first decoder according to the first decoding identifier.

[0021] In one possible design, in an implementation of another aspect of the embodiment of the present application, the acquiring unit is further configured to acquire a second decoding identifier based on the second video segment, wherein the second decoding identifier includes a second editing track identifier, and the second editing track identifier is used to indicate a second editing track of the second video segment in a video editing application;

[0022] The processing unit is specifically configured to call the first decoder to decode the second video segment if the second decoding identifier is the same as the first decoding identifier and the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to a preset duration.

[0023] In one possible design, in an implementation of another aspect of the embodiment of the present application, the acquiring unit is further configured to acquire a second decoding identifier based on the second video segment, wherein the second decoding identifier includes a second editing track identifier, and the second editing track identifier is used to indicate a second editing track of the second video segment in a video editing application;

[0024] If the second decoding identifier is different from the first decoding identifier, obtaining a first interval of the first video segment on the first editing track and a second interval of the second video segment on the second editing track;

[0025] The processing unit is specifically used to call the first decoder to decode the second video segment if the second decoding identifier is different from the first decoding identifier, there is no overlapping interval between the first interval and the second interval, and the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to a preset duration.

[0026] In one possible design, in an implementation of another aspect of the embodiment of the present application, the processing unit is further used to remove the first decoding identifier from the decoding identifier pool corresponding to the first decoder if the decoding of the first video segment is completed.

[0027] In one possible design, in an implementation of another aspect of the embodiment of the present application, the processing unit is further configured to determine that the first decoder is in a disabled state if there is no decoding identifier in the decoding identifier pool corresponding to the first decoder; or

[0028] The first video file also includes a third video segment; the processing unit is further configured to:

[0029] Based on the video editing application interface, responding to the decoding instruction for the third video segment, determining an initial decoding time of the third video segment;

[0030] If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is greater than a preset duration, it is determined that the first decoder is in a disabled state.

[0031] In one possible design, in an implementation of another aspect of the embodiment of the present application, the first video file further includes a third video segment; and the processing unit is further configured to:

[0032] Based on the video editing application interface, responding to the decoding instruction for the third video segment, determining an initial decoding time of the third video segment;

[0033] If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is less than or equal to the preset duration, the first decoder is called to decode the third video segment.

[0034] In one possible design, in an implementation of another aspect of the embodiment of the present application, the acquiring unit is further configured to acquire a second decoding identifier corresponding to the second video segment if a difference between an initial decoding time of the second video segment and an end decoding time of the first video segment is less than or equal to a preset duration;

[0035] The processing unit is further configured to call a second decoder corresponding to the second decoding identifier to decode the second video segment.

[0036] In one possible design, in an implementation of another aspect of the embodiment of the present application, the acquiring unit is further configured to:

[0037] Based on the video editing application interface, responding to the second video upload instruction, obtaining a second video file, wherein the second video file includes a fourth video segment;

[0038] Obtaining a third interval of the fourth video segment on the editing application interface, wherein the third interval overlaps with the second interval of the second video segment on the editing application interface;

[0039] The processing unit is further configured to respond to a decoding instruction for the fourth video segment based on the video editing application interface and call the third decoder to decode the fourth video segment.

[0040] In a possible design, in an implementation of another aspect of the embodiment of the present application, the second video file further includes a fifth video segment; the acquisition unit is further configured to acquire a termination decoding time of decoding the fourth video segment;

[0041] The processing unit is also used to:

[0042] In response to the decoding instruction for the fifth video segment, the initial decoding time of the fifth video segment is determined based on the video editing application interface;

[0043] If the difference between the initial decoding time of the fifth video segment and the termination decoding time of the fourth video segment is less than or equal to the preset duration, the third decoder is called to decode the fifth video segment.

[0044] In one possible design, in an implementation of another aspect of the embodiment of the present application, the processing unit is further configured to:

[0045] Dividing the first video segment into N video frames to obtain a first sequence of frames, and dividing the first video segment into M video frames to obtain a second sequence of frames, where M and N are both positive integers;

[0046] generating a first video segment corresponding to a portable animated graphics (PAG) format according to the first sequence of frames, and generating a second video segment corresponding to the PAG format according to the second sequence of frames;

[0047] The processing unit is specifically configured to call the first decoder to decode the first video segment corresponding to the PAG format within a target time period; and call the first decoder to decode the second video segment corresponding to the PAG format.

[0048] In one possible design, in an implementation of another aspect of the embodiment of the present application, the processing unit is further configured to:

[0049] Editing the decoded first video segment and the decoded second video segment to obtain a target video template;

[0050] In response to the upload instruction for the target video template, the target video template is added to the video template library.

[0051] On the other hand, the present application provides a computer device, comprising: a memory, a processor and a bus system; the memory is used to store program code; the processor is used to execute the video processing method described in any of the above aspects according to instructions in the program code.

[0052] On the other hand, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the video processing method described in any one of the above aspects.

[0053] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the video processing method described in any of the above aspects.

[0054] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0055] Different video segments in the same video file can share the same decoder for decoding, reducing the number of coexisting decoders on the terminal device and achieving the effect of reducing resource usage. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0057] Figure 1 A schematic diagram of the architecture of the video processing method in an embodiment of the present application;

[0058] Figure 2 A flowchart of a video processing method in an embodiment of the present application;

[0059] Figure 3 A schematic diagram of a video editing application interface in an embodiment of the present application;

[0060] Figure 4 A schematic diagram of an application scenario of the video processing method in an embodiment of the present application;

[0061] Figure 5a This is a schematic diagram of another application scenario of the video processing method in an embodiment of the present application;

[0062] Figure 5b This is a schematic diagram of another application scenario of the video processing method in an embodiment of the present application;

[0063] Figure 5c This is a schematic diagram of another application scenario of the video processing method in an embodiment of the present application;

[0064] Figure 6 This is a schematic diagram of another application scenario of the video processing method in an embodiment of the present application;

[0065] Figure 7 A schematic diagram of a principle of a video processing method in an embodiment of the present application;

[0066] Figure 8 This is a schematic diagram of another application scenario of the video processing method in an embodiment of the present application;

[0067] Figure 9 This is a schematic diagram of another application scenario of the video processing method in an embodiment of the present application;

[0068] Figure 10 This is a structural diagram of a video processing device in an embodiment of the present application;

[0069] Figure 11 This is a structural diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0070] The present application provides a video decoding method, related devices and equipment, which reduce the number of coexisting decoders on the decoding device by sharing decoders for different video segments in the same video file without affecting the decoding process of different video files, thereby achieving the effect of reducing resource usage.

[0071] The terms "first," "second," "third," "fourth," etc. (if any) in the specification and claims of the present application and in the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential sequence. It should be understood that the numbers used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein or, for example, can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "corresponding to," and any variations thereof, are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or apparatus.

[0072] The following describes the application architecture of the video processing method in the embodiment of the present application. Figure 1 , Figure 1 Schematic diagram of the application scenario of the video processing method in the embodiment of the present application.

[0073] like Figure 1 As shown, terminal device 101 can establish a communication connection with terminal device 102. A video editing application can be installed on terminal device 102 and display the video editing application interface. Terminal device 102 can receive the first video file from terminal device 101 or retrieve the first video file from its own memory. In addition, the first video file can also be obtained through other methods, for example, receiving the first video file downloaded from the cloud by server 103. The method for terminal device 102 to obtain the first video file is selected according to the actual application needs and is not limited here. After obtaining the first video file, terminal device 102 can decode the video file. Specifically, terminal device 102 can determine a first video segment and a second video segment from the first video file and decode the first video segment and the second video segment. Assume that terminal device 102 decodes the first video segment first and then decodes the second video segment. Terminal device 102 can call the first decoder to decode the first video segment within a target time period, where the target time period includes the time when decoding of the first video is terminated. The terminal device 102 determines an initial decoding time of the second video segment in response to a decoding instruction for the second video segment obtained based on an operation instruction of the video editing application interface. If the difference between the initial decoding time of the second video segment and the final decoding time of the first video segment is less than or equal to a preset duration, the terminal device 102 may invoke the first decoder to decode the second video segment.

[0074] Optionally, the terminal device 102 may also have a video playback function and may play the decoded video file. The terminal device 102 may also obtain an editing instruction for the first video file based on the video editing application interface, obtain the edited video file, and send the edited video file to the terminal device 101.

[0075] It is understandable that Figure 1 A variety of terminal devices are shown in the figure. In actual scenarios, there may be more or fewer types of terminal devices participating in the video processing process. The specific number and type depend on the actual scenario and are not limited here.

[0076] In the embodiments of the present application, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this. The terminal device and the server can be directly or indirectly connected by wired or wireless communication, and the terminal device and the server can also be connected to form a blockchain network, which is not limited in this application.

[0077] Next, the video processing method provided by the embodiment of the present application is described. Figure 2 , Figure 2 This is a flow chart of a video processing method in an embodiment of the present application, including:

[0078] 201. Based on the video editing application interface, respond to a first video upload instruction and obtain a first video file.

[0079] The terminal device can be installed with a video editing application, and the corresponding operation can be performed by responding to the operation instructions of the video editing application interface. Specifically, the terminal device will respond to the first video upload instruction and obtain the first video file. Figure 3 For detailed instructions, see Figure 3 , Figure 3 A schematic diagram of the video editing application interface provided in an embodiment of the present application.

[0080] like Figure 3As shown, the video editing application interface may include an import control, a preview sub-interface, and an editing track. The terminal device can respond to a touch command on the import control to display a video file list. The video file list includes at least one video file. The terminal device then responds to a selection command for a first video file in the video file list to determine the first video file. After determining the first video file, the terminal device may display a progress bar corresponding to the first video file on the editing track. The preview sub-interface also displays decoded image frames of the first video file.

[0081] Optionally, the terminal device may have a video recording function and store the recorded video file in its own memory. In this case, the first video file may be a video file recorded by the terminal device itself. In addition, the first video file may also be a video file received by the terminal device from another device. The specific details are not limited here.

[0082] 202. Determine a first video segment and a second video segment from a first video file.

[0083] The terminal device obtains the first video file and can display the progress bar of the first video file on the editing track. The terminal device responds to the touch instruction for the first video file, segments the first video file, and displays the video segments on the video editing application interface, each video segment includes at least one video frame. The terminal device can determine the first video segment and the second video segment from the first video file. In the embodiment of the present application, there are multiple ways for the terminal device to determine the first video segment and the second video segment. The possible situations are described below. Please refer to Figure 4 , Figure 4 A schematic diagram of the video editing application interface provided in the embodiment of the present application. Figure 4 As shown, the first video file includes video segment 1, video segment 2 and video segment 3.

[0084] (1) The first video segment and the second video segment are the same as the displayed video segment.

[0085] Optionally, the terminal device can decode the video segments in the order after segmentation. Figure 4 In the illustrated embodiment, the terminal device can decode each video segment in the order of video segment 1, video segment 2, and video segment 3. After decoding one video segment, the terminal device can proceed to decode the next video segment. In this case, the first video segment and the second video segment are the same as the video segments displayed in the video editing application interface. For example, the first video segment can be video segment 1, and the second video segment can be video segment 2.

[0086] Optionally, the terminal device may also decode the video segments in a different order than the segmented sequence. Figure 4 In the illustrated embodiment, the terminal device may first decode video segment 1. When decoding reaches the video frame corresponding to position B, the terminal device will respond to the decoding instruction for video segment 3 and decode video segment 3 starting from the video frame corresponding to position C. In this case, after decoding video segment 1, the terminal device skips decoding video segment 2. The first video segment corresponds to video segment 1, and the second video segment corresponds to video segment 3. It will be appreciated that in addition to skipping backward, the terminal device can also skip forward. For example, the terminal device may first decode video segment 3, and then respond to the decoding instruction for video segment 1 and decode video segment 1 starting from the video frame corresponding to position A.

[0087] (2) The first video segment and the second video segment are different from the displayed video segment.

[0088] Optionally, in Figure 4 In the illustrated embodiment, the terminal device can respond to a decoding instruction for video segment 1 and decode video segment 1, starting from the video frame corresponding to position A. When decoding reaches the video frame corresponding to position D, the user can drag the progress bar to position E. In other words, the terminal device will respond to a decoding instruction for video segment 2 and decode video segment 2, starting from the video frame corresponding to position E. In this case, video segment 1 may include two video segments, "1.1" and "1.2," and video segment 2 may include two video segments, "2.1" and "2.2." The first video segment corresponds to video segment "1.1," and the second video segment corresponds to video segment "2.2."

[0089] It is understood that in either case, the first video segment and the second video segment are relative to the decoder and are not necessarily the same as the video segments obtained after segmenting the first video file. The above multiple ways of determining the first video segment and the second video segment increase the flexibility of the video processing method provided in the embodiments of the present application.

[0090] 203. Call a first decoder to decode the first video segment within a target time period, where the target time period includes a decoding termination time for the first video segment.

[0091] The terminal device determines the first video segment and can call the first decoder to decode the first video segment. The time period for decoding the first video segment can be called a target time period, wherein the target time period includes the end time of decoding the first video segment.

[0092] 204. Based on the video editing application interface, in response to a decoding instruction for the second video segment, determine an initial decoding time of the second video segment.

[0093] The user can drag the progress bar to the second video segment in the video editing application interface to make the terminal device decode the second video segment. In other words, the terminal device will also respond to the decoding instruction for the second video segment and determine the initial decoding time of the second video segment.

[0094] 205. If the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to a preset duration, call the first decoder to decode the second video segment.

[0095] The terminal device determines the end decoding time of the first video segment and the initial decoding time of the second video segment, and can compare the relationship between the two times. If the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to a preset duration, the terminal device determines that the two video segments can be decoded by a common decoder and invokes the first decoder to decode the second video segment.

[0096] Optionally, the preset duration can be pre-set based on the compression format of the video file and the decoding capability of the terminal device. For example, for a video file using the common H.264 or H.265 encoding format, the preset duration set on a decoding device running an Android system can be the duration spanned by 10 to 15 frames of encoded images. Optionally, the preset duration can be set to the duration spanned by 12 frames of encoded images.

[0097] It is understandable that after the terminal device determines the first video segment and the second video segment, it can obtain the file identifier corresponding to the first video segment and the file identifier corresponding to the second video segment. The file identifier is used to indicate the file information to which the video segment belongs. Since the first video segment and the second video segment are both contained in the first video file, the file identifier corresponding to the first video segment and the file identifier corresponding to the second video segment are the same. In other words, when decoding the first video segment and the second video segment, a decoder with the same configuration can be used, which provides a prerequisite for the first video segment and the second video segment to share the same decoder. Decoders with the same configuration refer to decoders with the same parameters. For example, for video files encoded in the H.264 format, the same configuration includes: the same sequence parameter set (SPS) and picture parameter set (PPS); for video files encoded in the H.265 format, the same configuration parameters include: the same SPS, the same PPS, and the same video parameter set (VPS).

[0098] In the embodiment of the present application, different video segments in the same video file can share the same decoder for decoding, which reduces the number of coexisting decoders on the terminal device and achieves the effect of reducing resource usage.

[0099] Optionally, in the above Figure 2 On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the video processing method further includes:

[0100] Obtaining a first decoding identifier according to the first video segment, wherein the first decoding identifier includes a first editing track identifier, and the first editing track identifier is used to indicate a first editing track of the first video segment in a video editing application;

[0101] A first decoder is determined according to the first decoding identifier.

[0102] In a video editing application, at least one editing track for editing videos is included. Each track has a corresponding editing track identifier (track ID). When a video file is placed on the editing track, the video segment included in the video file can obtain the corresponding editing track identifier. That is to say, in an embodiment of the present application, the terminal device determines the first video segment and can obtain the first decoding identifier of the first video segment. Among them, the first decoding identifier includes a first editing track identifier, and the first editing track identifier indicates the first editing track of the first video segment in the video editing application. After obtaining the first decoding identifier, the terminal device can determine the first decoder for decoding the first video segment based on the first decoding identifier. After determining the first decoder, the terminal device can execute step 203 to call the first decoder to decode the first video segment within the target time period.

[0103] Alternatively, if the value of the edit track identifier is the default value, it means that the business party has not set the edit track for the video segment, and the decoding device will not select the shared decoder logic when decoding. This situation is not the focus of the present invention and will not be described here.

[0104] Optionally, in actual applications, the first decoding identifier may further include a file identifier corresponding to the first video segment, where the file identifier is used to indicate file information to which the first video segment belongs.

[0105] In the embodiment of the present application, the decoder for decoding the video segment can be determined based on the decoding identifier corresponding to the video segment, which improves the feasibility of the technical solution of the present application.

[0106] Optionally, in the above Figure 2 On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the video processing method further includes:

[0107] Obtaining a second decoding identifier according to the second video segment, wherein the second decoding identifier includes a second editing track identifier, and the second editing track identifier is used to indicate a second editing track of the second video segment in a video editing application;

[0108] If the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to the preset duration, calling the first decoder to decode the second video segment includes:

[0109] If the second decoding identifier is the same as the first decoding identifier, and the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to the preset duration, the first decoder is called to decode the second video segment.

[0110] In an embodiment of the present application, after determining the second video segment, the terminal device may obtain a second decoding identifier of the second video segment, wherein the second decoding identifier includes a second editing track identifier indicating the second editing track of the first video segment in the video editing application.

[0111] After obtaining the first decoding identifier and the second decoding identifier, the terminal device, in step 205, in addition to comparing the end decoding time of the first video segment with the initial decoding time of the second video segment, also needs to compare the first decoding identifier and the second decoding identifier. If the second decoding identifier is the same as the first decoding identifier, it means that the first video segment and the second video segment are located on the same editing track in the video editing application. Due to the limitations of the video editing application, in this case, the intervals of the first video segment and the second video segment on the editing track will not overlap. Therefore, if the second decoding identifier is the same as the first decoding identifier, and the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to the preset duration, then it means that the second video segment can share a decoder with the first video segment, and the terminal device will call the first decoder to decode the second video segment.

[0112] Optionally, in actual application, the second decoding identifier may further include a file identifier corresponding to the second video segment, where the file identifier is used to indicate file information to which the second video segment belongs.

[0113] Optionally, in the above Figure 2 On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the video processing method further includes:

[0114] Obtaining a second decoding identifier according to the second video segment, wherein the second decoding identifier includes a second editing track identifier, and the second editing track identifier is used to indicate a second editing track of the second video segment in a video editing application;

[0115] If the second decoding identifier is different from the first decoding identifier, obtaining a first interval of the first video segment on the first editing track and a second interval of the second video segment on the second editing track;

[0116] If the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to the preset duration, calling the first decoder to decode the second video segment includes:

[0117] If the second decoding identifier is different from the first decoding identifier, and there is no overlapping interval between the first interval and the second interval, and the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to the preset duration, the first decoder is called to decode the second video segment.

[0118] In an embodiment of the present application, after determining the second video segment, the terminal device may obtain a second decoding identifier of the second video segment, wherein the second decoding identifier includes a second editing track identifier indicating the second editing track of the first video segment in the video editing application.

[0119] Optionally, the track identifier can be determined based on the business party's needs for video editing. Figure 5a In the illustrated scenario, when editing a video, the business party can place the first video segment on the first editing track and the second video segment on the second editing track. In this case, the first editing track identifier can be 1; the second editing track identifier can have the same value, which can be 2. In actual applications, the values of the editing track identifiers can be determined based on actual application needs and are not limited to the examples in the embodiments of this application, and are not specifically limited here.

[0120] After obtaining the first decoding identifier and the second decoding identifier, the terminal device can compare the first decoding identifier and the second decoding identifier. If the first decoding identifier and the second decoding identifier are different, it means that the first video segment and the second video segment are located on different editing tracks in the video editing application interface. The terminal device can obtain the first interval of the first video segment on the first editing track and the second interval of the second video segment on the second editing track, and compare the relationship between the first interval and the second interval.

[0121] like Figure 5a As shown, if there is an overlapping interval between the first interval and the second interval, since one decoder decodes two different video segments at the same time, Figure 5a In the case shown, the first and second video segments cannot share the same decoder. That is, if the first decoding identifier and the second decoding identifier are different, and the difference between the initial decoding time of the second video segment and the final decoding time of the first video segment is less than or equal to the preset duration, the terminal device also needs to determine the decoder for decoding the second video segment based on the relationship between the first interval and the second interval. If, in this case, there is no overlap between the first and second intervals, the terminal device will determine that the second video segment can use the same decoder as the first video segment, and will therefore invoke the first decoder to decode the second video segment.

[0122] Optionally, there are multiple situations where there is no overlapping interval between the first interval and the second interval. In practical applications, the interval of a video segment on an editing track is usually represented as an interval with a left-closed and a right-open interval, or an interval with a left-open and a right-closed interval. Figure 5bThere is no overlapping interval between the first interval and the second interval shown. In addition, there may be other situations where there is no overlapping interval, such as Figure 5c The first interval and the second interval are shown.

[0123] In an embodiment of the present application, the terminal device can also obtain the decoding identifier corresponding to the video segment, and adjust the conditions for sharing decoders between different video segments based on the relationship between the decoding identifiers, thereby improving the flexibility of the technical solution of the present application.

[0124] Optionally, in the above Figure 2 On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the video processing method further includes:

[0125] If decoding of the first video segment is completed, the first decoding identifier is removed from the decoding identifier pool corresponding to the first decoder.

[0126] In the embodiment of the present application, a decoding identifier pool can be set up, and decoding identifiers can be stored in the decoding identifier pool. The decoding identifiers contained in the same decoding identifier pool correspond to the same decoder. Figure 6 For a description of the decoding identity pool, see Figure 6 and Figure 7 , Figure 6 A schematic diagram of an application scenario of the video processing method provided in an embodiment of the present application is shown in FIG. Figure 7 A schematic diagram of the principles of the video processing method provided in an embodiment of the present application.

[0127] like Figure 6 As shown, the first video segment and the second video segment are on the same editing track and adjacent to each other. It is understandable that in actual applications, decoders are usually created asynchronously. Figure 6 In the example shown, assuming that the terminal device determines at time T1 that the difference between the initial decoding time of the second video segment and the final decoding time of the first video segment is less than or equal to a preset duration, the terminal device will place the second decoding identifier corresponding to the second video segment into the decoding identifier pool containing the first decoding identifier corresponding to the first video segment, so that the first decoding identifier and the second decoding identifier correspond to the same decoding identifier pool. The terminal device can determine the relationship between the initial decoding time of the second video segment and the final decoding time of the first video segment by comparing the current time with the initial decoding time of the second video segment. Specifically, if the difference between the initial decoding time of the second video segment and the current time is less than or equal to a preset threshold, the terminal device can determine that the difference between the initial decoding time of the second video segment and the final decoding time of the first video segment is less than or equal to a preset duration. The duration of the preset threshold can be equal to or greater than the preset duration.

[0128] like Figure 7 As shown, the decoding identifier pool 1 includes a decoding identifier 1.1 and a decoding identifier 1.2. Assume that the decoding identifier 1.1 is the first decoding identifier and the decoding identifier 1.2 corresponds to the second decoding identifier. In the process of decoding the first video segment, the first decoding identifier can be stored in the decoding identifier pool 1. Figure 6 At time T1 shown, the second decoding identifier may be stored in decoding identifier pool 1 .

[0129] If the terminal device detects the decoding of the first video segment, the terminal device will update the decoding identifier pool corresponding to the first decoding identifier and remove the first decoding identifier from the decoding identifier pool. Figure 7 In the illustrated embodiment, the decoding device removes decoding identifier 1.1 from decoding identifier pool 1. Similarly, when the terminal device detects decoding of a second video segment, the terminal device updates the decoding identifier pool corresponding to the second decoding identifier and removes the second decoding identifier from the decoding identifier pool.

[0130] Optional, such as Figure 7 As shown in FIG, the decoded video frame will enter the rendering buffer and wait for rendering. The rendered video frame will be displayed on the screen of the terminal device.

[0131] In an embodiment of the present application, when the decoding work of a video segment has been completed, the terminal device can remove the decoding identifier corresponding to the video segment from the decoding identifier pool corresponding to the decoding identifier, thereby further reducing memory usage.

[0132] Optionally, in the above Figure 2 On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the video processing method further includes:

[0133] If there is no decoding identifier in the decoding identifier pool corresponding to the first decoder, it is determined that the first decoder is in a disabled state; or,

[0134] The first video file also includes a third video segment; the method further includes:

[0135] Based on the video editing application interface, responding to the decoding instruction for the third video segment, determining an initial decoding time of the third video segment;

[0136] If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is greater than a preset duration, it is determined that the first decoder is in a disabled state.

[0137] In the embodiment of the present application, the terminal device can also update the working state of the first decoder according to the progress of the decoding work. Different situations are described below.

[0138] Optionally, the terminal device can determine the operating status of the first decoder based on the decoding identifier pool corresponding to the first decoder. Specifically, if the decoding identifier pool corresponding to the first decoder does not contain a decoding identifier, it means that there are no video segments that require decoding using the first decoder at the current moment, and the terminal device will determine that the first decoder is inactive. Optionally, in this case, the terminal device can also release the decoding identifier pool corresponding to the first decoder from the terminal device's memory.

[0139] Optionally, the first video file may also include a third video segment. The terminal device may also determine the operating status of the first decoder based on the relationship between the initial decoding time of the third video segment and the termination decoding time of the second video segment. Specifically, the terminal device will determine the initial decoding time of the third video segment in response to a decoding instruction for the third video segment based on the video editing application interface. If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is greater than a preset duration, it means that the third video segment cannot share the same decoder as the second video segment. Therefore, the terminal device will determine that the first decoder is in an inactive state.

[0140] In the embodiment of the present application, the terminal device can determine whether the first decoder is in a working state according to different situations, which enriches the application scenarios of the technical solution of the present application and also improves the flexibility of the technical solution of the present application.

[0141] Optionally, in the above Figure 2 On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the first video file further includes a third video segment; and the video processing method further includes:

[0142] Based on the video editing application interface, responding to the decoding instruction for the third video segment, determining an initial decoding time of the third video segment;

[0143] If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is less than or equal to the preset duration, the first decoder is called to decode the third video segment.

[0144] In an embodiment of the present application, the first decoder can also decode a larger number of video segments. Exemplarily, the first video file can also include a third video segment. The terminal device can determine whether the first decoder can decode the third video segment by comparing the relationship between the end decoding time of the second video segment and the initial decoding time of the third video segment. Specifically, the terminal device will respond to the decoding instruction for the third video segment based on the video editing application interface and determine the initial decoding time of the third video segment. If the difference between the initial decoding time of the third video segment and the end decoding time of the second video segment is less than or equal to the preset duration, it means that the third video segment can share the same decoder with the second video segment. Therefore, the terminal device can call the first decoder to decode the third video segment.

[0145] It is understood that if the difference between the initial decoding time of the third video segment and the final decoding time of the second video segment is greater than the preset duration, this means that the third video segment cannot share the same decoder as the second video segment. In this case, the terminal device can obtain the decoding identifier corresponding to the third video segment and then invoke the decoder corresponding to the decoding identifier to decode the third video segment.

[0146] In the embodiment of the present application, the terminal device can call the first decoder to decode a larger number of video segments, further reducing the number of coexisting decoders on the terminal device and further reducing resource usage.

[0147] Optionally, in the above Figure 2 On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the video processing method further includes:

[0148] If the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to the preset duration, obtaining a second decoding identifier corresponding to the second video segment;

[0149] The second decoder corresponding to the second decoding identifier is called to decode the second video segment.

[0150] In this embodiment of the present application, when a terminal device determines that the difference between the initial decoding time of the second video segment and the final decoding time of the first video segment is greater than a preset duration, this indicates that the first decoder used to decode the first video segment cannot be invoked to decode the second video segment. Therefore, the terminal device needs to determine a decoder for the second video segment. Specifically, the terminal device can obtain a second decoding identifier corresponding to the second video segment. Based on the second decoding identifier, the terminal device then determines the second decoder corresponding to the second decoding identifier and invokes the second decoder to decode the second video segment.

[0151] In an embodiment of the present application, when the second video segment and the first video segment cannot share a decoder, the terminal device can call the second decoder to decode the second video segment according to the second decoding identifier corresponding to the second video segment, thereby ensuring the smooth progress of the decoding work, improving the feasibility of the technical solution of the present application, and also ensuring the efficiency of video processing.

[0152] Optionally, in the above Figure 2 On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the video processing method further includes:

[0153] Based on the video editing application interface, responding to the second video upload instruction, obtaining a second video file, wherein the second video file includes a fourth video segment;

[0154] Obtaining a third interval of the fourth video segment on the editing application interface, wherein the third interval overlaps with the second interval of the second video segment on the editing application interface;

[0155] Based on the video editing application interface, in response to the decoding instruction for the fourth video segment, the third decoder is called to decode the fourth video segment.

[0156] In an embodiment of the present application, a terminal device can decode multiple video files. Similar to how the first video file is obtained, the terminal device can obtain the second video file based on the video editing application interface in response to a second video upload instruction. A progress bar corresponding to the second video file will then be displayed on the editing track of the video editing application interface. The second video file includes a fourth video segment. The terminal device will obtain the third interval of the fourth video segment on the video editing application interface. This third interval overlaps with the second interval of the second video segment on the editing application interface. Since video files on the same editing track cannot overlap in the video editing application, the second and fourth video segments are displayed on different editing tracks. Furthermore, a single decoder cannot decode multiple decoders simultaneously. Since the second and third intervals overlap, the first decoder cannot decode the fourth video segment. The terminal device can obtain a decoding identifier corresponding to the fourth video segment and then invoke a third decoder corresponding to the decoding identifier to decode the fourth video segment.

[0157] In the embodiment of the present application, the terminal device can call multiple decoders to decode different multiple video files respectively, thereby improving the decoding efficiency of the terminal device.

[0158] Optionally, in the above Figure 2On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the second video file further includes a fifth video segment; and the video processing method further includes:

[0159] Obtaining a decoding termination time for decoding the fourth video segment;

[0160] In response to the decoding instruction for the fifth video segment, the initial decoding time of the fifth video segment is determined based on the video editing application interface;

[0161] If the difference between the initial decoding time of the fifth video segment and the termination decoding time of the fourth video segment is less than or equal to the preset duration, the third decoder is called to decode the fifth video segment.

[0162] In the embodiment of the present application, the second video file also includes a fifth video segment, and the fourth video segment and the fifth video segment can also share a decoder. This situation is explained below. The terminal device will respond to the decoding instruction for the fifth video segment based on the video editing application interface and determine the initial decoding time of the fifth video segment. The terminal device can also obtain the termination decoding time of the fourth video segment. Then, the relationship between the initial decoding time of the fifth video segment and the termination decoding time of the fourth video segment is determined. If the difference between the initial decoding time of the fifth video segment and the termination decoding time of the fourth video segment is less than or equal to the preset duration, it means that the fourth video segment and the fifth video segment can share a decoder, and the terminal device will call the third decoder to decode the fifth video segment.

[0163] It is understood that if the difference between the initial decoding time of the fifth video segment and the final decoding time of the fourth video segment is greater than a preset duration, it means that the fourth and fifth video segments cannot share a decoder. The terminal device can obtain a decoding identifier corresponding to the fifth video segment and then invoke the decoder corresponding to the decoding identifier to decode the fifth video segment.

[0164] In an embodiment of the present application, different videos in the second video file can also be decoded using the same decoder. When there are multiple video files to be decoded by the terminal device, resource usage is further reduced by sharing the decoder.

[0165] The following describes the process of decoding the first video file and the second video file by the terminal device. Figure 8 , Figure 8 A schematic diagram of an application scenario of the video processing method provided in an embodiment of the present application.

[0166] like Figure 8 As shown, the first video file includes a first video segment, a second video segment, and a third video segment; the second video file includes a fourth video segment and a fifth video segment.

[0167] At time T1, the terminal device can invoke the first decoder to decode the first video segment. The terminal device then stores the first decoding identifier corresponding to the first video segment in the decoding identifier pool corresponding to the first decoder. While decoding the first video segment, the terminal device can also query whether the initial decoding time of the next video segment is within the predicted time range. For example, at time T2, the terminal device determines that the difference between the initial decoding time of the second video segment and the final decoding time of the first video segment is less than or equal to a preset duration. The terminal device then stores the second decoding identifier of the second video segment in the decoding identifier pool corresponding to the first decoder. At this point, the identifier pool corresponding to the first decoder includes the first decoding identifier and the second decoding identifier. At time T3, the terminal device determines that the decoding of the first video segment has been completed and removes the first decoding identifier from the decoding identifier pool corresponding to the first decoder. Similarly, at time T4, the terminal device determines that the difference between the initial decoding time of the third video segment and the final decoding time of the second video segment is less than or equal to the preset duration. The terminal device then stores the third decoding identifier of the third video segment in the decoding identifier pool corresponding to the first decoder. At time T5, the terminal device determines that the second video segment has been decoded and removes the second decoding identifier from the decoding identifier pool corresponding to the first decoder. At time T7, the terminal device determines that the third video segment has been decoded and removes the third decoding identifier from the decoding identifier pool corresponding to the first decoder.

[0168] At time T3, the terminal device can also invoke the third decoder to decode the fourth video segment. It is understandable that because the fourth video segment and the second video segment belong to different video files, and the interval of the fourth video segment on editing track 2 overlaps with the interval of the second video segment on editing track 1, the second and fourth video segments cannot share the same decoder. Based on the fourth decoding identifier corresponding to the fourth video segment, the terminal device can invoke the third decoder corresponding to the fourth decoding identifier to decode the fourth video segment. The fourth decoding identifier corresponding to the fourth video segment is stored in the decoding identifier pool corresponding to the third decoder. At time T5, the terminal device determines that the difference between the initial decoding time of the fifth video segment and the final decoding time of the fourth video segment is less than or equal to the preset duration. The terminal device then stores the fifth decoding identifier of the fifth video segment in the decoding identifier pool corresponding to the third decoder. At time T6, the terminal device determines that decoding of the fourth video segment is complete and removes the fourth decoding identifier from the decoding identifier pool corresponding to the third decoder. At time T8, the terminal device determines that decoding of the fifth video segment is complete and removes the fifth decoding identifier from the decoding identifier pool corresponding to the third decoder.

[0169] Optionally, in the above Figure 2On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the video processing method further includes:

[0170] Dividing the first video segment into N video frames to obtain a first sequence of frames, and dividing the first video segment into M video frames to obtain a second sequence of frames, where M and N are both positive integers;

[0171] Generate a first video segment corresponding to the PAG format according to the first sequence of frames, and generate a second video segment corresponding to the PAG format according to the second sequence of frames;

[0172] Calling a first decoder to decode the first video segment within a target time period includes:

[0173] Invoking a first decoder to decode a first video segment corresponding to the PAG format within a target time period;

[0174] Calling the first decoder to decode the second video segment includes:

[0175] The first decoder is called to decode the second video segment corresponding to the PAG format.

[0176] In an embodiment of the present application, the terminal device can also process the video file based on the PAG technology. Specifically, after obtaining the first video segment and the second video segment, the terminal device can divide the first video segment into N video frames to obtain a first sequence of frames, and divide the second video segment into M video frames to obtain a second sequence of frames. Wherein, M and N are both positive integers. Then, the terminal device generates a first video segment corresponding to the PAG format based on the first sequence of frames, and generates a second video segment corresponding to the PAG format based on the second sequence of frames. Since the first video segment and the second video segment are both converted into video segments corresponding to the PAG format, calling the first decoder to decode the first video segment in the target time period includes: calling the first decoder to decode the first video segment corresponding to the PAG format in the target time period. Calling the first decoder to decode the second video segment includes: calling the first decoder to decode the second video segment corresponding to the PAG format.

[0177] PAG technology uses a binary data structure to store animation information, allowing a single file to integrate any resource. This also improves decoding speed. Furthermore, PAG technology supports mixed vector and sequence frame export, allowing layers to be populated with images or videos and labeled by layer. This ensures support for all After Effects features while maintaining runtime editability. In other words, PAG technology streamlines the workflow from After Effects animation design to mobile rendering. Designers can export animation files from After Effects using an export plugin, which can then be loaded and rendered on mobile devices using a software development kit (SDK), significantly reducing development costs. PAG technology has been widely used in video editing, user interface (UI) design, sticker and subtitle editing, and photo editing. Overall, PAG technology provides a simplified and comprehensive animation workflow, reducing file size while still supporting all After Effects features and maintaining runtime editability. This significantly improves production efficiency and visual performance for animation-related needs.

[0178] In an embodiment of the present application, the terminal device can convert the first video segment and the second video segment format into PAG format, so that the video processing process can take advantage of the advantages of PAG technology and improve the speed of video decoding.

[0179] Optionally, in the above Figure 2 On the basis of the corresponding embodiment, in an optional embodiment of the video processing method provided in the embodiment of the present application, the video processing method further includes:

[0180] Editing the decoded first video segment and the decoded second video segment to obtain a target video template;

[0181] In response to the upload instruction for the target video template, the target video template is added to the video template library.

[0182] The video editing application can provide users with a variety of templates and simplify the process of video editing for users. After decoding the first video segment and the second video segment, the terminal device will edit the decoded first video segment and the second video segment to obtain a template video template. There are many ways to edit, which can be adding filters, adding background music, or adding subtitles to the decoded first video segment and the second video segment. In addition, there can be other situations, such as adding animated stickers, increasing splicing effects, etc., which are not limited here. After obtaining the target video template, the terminal device can respond to the upload instruction for the target video template and add the target video template to the video template library.

[0183] Optionally, when the user is editing a video based on the video editing application, he can select a video template from the video template library. Figure 9 For an explanation of this situation, see Figure 9 , Figure 9 This is a schematic diagram of an application scenario of the video processing method in an embodiment of the present application.

[0184] like Figure 9 As shown, the terminal device can display a template selection interface. The template selection interface includes multiple templates. The terminal device will respond to the touch command for a certain template and demonstrate the template so that the user can understand the effect of the template when selecting the template. After selecting the template, the terminal device can display the material selection interface, and the material selection decoding displays at least one video or at least one picture. Optionally, different templates can correspond to different numbers of materials, and a prompt bar can also be displayed on the material selection interface, which is used to prompt the number of materials. For example, assuming that the user selects template 1, and the default number of materials for template 1 is at most two, then a prompt bar can also be displayed on the material selection interface, and the prompt bar can display the words "Please select 1 to 2 pieces of material" to prompt the user.

[0185] Assuming that the user has selected two videos for editing, the user can also add special effects to these two videos. That is to say, the terminal device can display a special effect selection interface. The terminal device will respond to the touch command for a special effect in the special effect selection interface and display the effect of the special effect. Optionally, different special effects can have different effects. Taking the addition of transition effects in two video segments as an example, the transition effects included in special effect 1 can be displayed on the screen while video 1 gradually moves upwards, while video 2 gradually advances upwards from the bottom of the screen; or when playing video 1, video 2 gradually appears from the middle of the screen like a blooming flower; in addition, it can also be while video 1 gradually moves downwards, video 2 gradually advances downwards from the top of the screen. The effect of the transition effect displayed on the screen is selected according to the needs of the actual application, and is not specifically limited here. Assuming that the specific transition effect selected by the user is that video 1 gradually moves to the left side of the screen, and video 2 gradually advances from the right side of the screen to the left side of the screen, then the picture displayed on the video preview interface can be as follows Figure 8 shown.

[0186] Optionally, users can modify the selected template, for example, changing the specific content of the subtitles in the template, changing the background music, or adding new animated stickers. In addition, other types of modifications can be made, such as changing the filters in the template or changing the subtitle font, etc., which are not limited here.

[0187] Optionally, the video processing method provided in the embodiment of the present application can also be used in a video display scenario using a "picture-in-picture" effect. The so-called "picture-in-picture" means that while one video image is displayed on the screen, a small area on the screen can also display another video image.

[0188] In an embodiment of the present application, the terminal device can add a target video template to the video template library and optimize the video template library in the video editing application, so that the user can select from the template library when using the video editing application, which not only meets the diverse needs of the user but also simplifies the video editing process.

[0189] In order to better implement the above solution of the embodiment of the present application, the following also provides related devices for implementing the above solution. Figure 10 , Figure 10 This is a schematic diagram of the structure of a video processing device provided in an embodiment of the present application. The video processing device 1000 includes:

[0190] An acquiring unit 1001 is configured to acquire a first video file in response to a video upload instruction based on a video editing application interface;

[0191] The processing unit 1002 is configured to:

[0192] determining a first video segment and a second video segment from the first video file;

[0193] Invoking a first decoder to decode the first video segment within a target time period, wherein the target time period includes a termination decoding time for the first video segment;

[0194] Based on the video editing application interface, responding to the decoding instruction for the second video segment, determining an initial decoding time of the second video segment;

[0195] If the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to the preset duration, the first decoder is called to decode the second video segment.

[0196] Optional, in the above Figure 10 On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided in the embodiment of the present application, the video processing device 1000 includes:

[0197] The acquiring unit 1001 is further configured to acquire a first decoding identifier according to the first video segment, wherein the first decoding identifier includes a first editing track identifier, and the first editing track identifier is used to indicate a first editing track of the first video segment in a video editing application;

[0198] The processing unit 1002 is further configured to determine the first decoder according to the first decoding identifier.

[0199] Optional, in the above Figure 10 On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided in the embodiment of the present application, the video processing device 1000 includes:

[0200] The acquiring unit 1001 is further configured to acquire a second decoding identifier according to the second video segment, wherein the second decoding identifier includes a second editing track identifier, and the second editing track identifier is used to indicate a second editing track of the second video segment in a video editing application;

[0201] The processing unit 1002 is specifically configured to call the first decoder to decode the second video segment if the second decoding identifier is the same as the first decoding identifier and the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to a preset duration.

[0202] Optional, in the above Figure 10 On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided in the embodiment of the present application, the video processing device 1000 includes:

[0203] The acquisition unit 1001 is further configured to:

[0204] Obtaining a second decoding identifier according to the second video segment, wherein the second decoding identifier includes a second editing track identifier, and the second editing track identifier is used to indicate a second editing track of the second video segment in a video editing application;

[0205] If the second decoding identifier is different from the first decoding identifier, obtaining a first interval of the first video segment on the first editing track and a second interval of the second video segment on the second editing track;

[0206] Processing unit 1002 is specifically used to call the first decoder to decode the second video segment if the second decoding identifier is different from the first decoding identifier, there is no overlapping interval between the first interval and the second interval, and the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to the preset duration.

[0207] Optional, in the above Figure 10 On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided in the embodiment of the present application, the video processing device 1000 includes:

[0208] The processing unit 1002 is further configured to remove the first decoding identifier from the decoding identifier pool corresponding to the first decoder if decoding of the first video segment is completed.

[0209] Optional, in the above Figure 10 On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided in the embodiment of the present application, the video processing device 1000 includes:

[0210] The processing unit 1002 is further configured to determine that the first decoder is in a disabled state if there is no decoding identifier in the decoding identifier pool corresponding to the first decoder; or

[0211] The first video file also includes a third video segment; the processing unit 1002 is further configured to:

[0212] Based on the video editing application interface, responding to the decoding instruction for the third video segment, determining an initial decoding time of the third video segment;

[0213] If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is greater than a preset duration, it is determined that the first decoder is in a disabled state.

[0214] Optional, in the above Figure 10 On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided by the embodiment of the present application, the first video file further includes a third video segment; the video processing device 1000 includes:

[0215] The processing unit 1002 is further configured to:

[0216] Based on the video editing application interface, responding to the decoding instruction for the third video segment, determining an initial decoding time of the third video segment;

[0217] If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is less than or equal to the preset duration, the first decoder is called to decode the third video segment.

[0218] Optional, in the above Figure 10 On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided in the embodiment of the present application, the video processing device 1000 includes:

[0219] The acquiring unit 1001 is further configured to acquire a second decoding identifier corresponding to the second video segment if a difference between an initial decoding time of the second video segment and an end decoding time of the first video segment is less than or equal to a preset duration;

[0220] The processing unit 1002 is further configured to call a second decoder corresponding to the second decoding identifier to decode the second video segment.

[0221] Optional, in the above Figure 10On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided in the embodiment of the present application, the video processing device 1000 includes:

[0222] The acquisition unit 1001 is further configured to:

[0223] Based on the video editing application interface, responding to the second video upload instruction, obtaining a second video file, wherein the second video file includes a fourth video segment;

[0224] Obtaining a third interval of the fourth video segment on the editing application interface, wherein the third interval overlaps with the second interval of the second video segment on the editing application interface;

[0225] The processing unit 1002 is further configured to respond to a decoding instruction for the fourth video segment based on the video editing application interface and call the third decoder to decode the fourth video segment.

[0226] Optional, in the above Figure 10 On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided by the embodiment of the present application, the second video file further includes a fifth video segment; the video processing device 1000 includes:

[0227] The acquiring unit 1001 is further configured to acquire a decoding termination time for decoding the fourth video segment;

[0228] The processing unit 1002 is further configured to:

[0229] In response to the decoding instruction for the fifth video segment, the initial decoding time of the fifth video segment is determined based on the video editing application interface;

[0230] If the difference between the initial decoding time of the fifth video segment and the termination decoding time of the fourth video segment is less than or equal to the preset duration, the third decoder is called to decode the fifth video segment.

[0231] Optional, in the above Figure 10 On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided in the embodiment of the present application, the video processing device 1000 includes:

[0232] The processing unit 1002 is further configured to:

[0233] Dividing the first video segment into N video frames to obtain a first sequence of frames, and dividing the first video segment into M video frames to obtain a second sequence of frames, where M and N are both positive integers;

[0234] Generate a first video segment corresponding to the PAG format according to the first sequence of frames, and generate a second video segment corresponding to the PAG format according to the second sequence of frames;

[0235] The processing unit 1002 is specifically configured to call the first decoder to decode the first video segment corresponding to the PAG format within the target time period; and call the first decoder to decode the second video segment corresponding to the PAG format.

[0236] Optional, in the above Figure 10 On the basis of the corresponding embodiment, in another embodiment of the video processing device 1000 provided in the embodiment of the present application, the video processing device 1000 includes:

[0237] The processing unit 1002 is further configured to:

[0238] Editing the decoded first video segment and the decoded second video segment to obtain a target video template;

[0239] In response to the upload instruction for the target video template, the target video template is added to the video template library.

[0240] In the embodiment of the present application, a computer device is also provided, which is described below. Figure 11 , Figure 11 1 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 1100 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1110 (for example, one or more processors) and a memory 1120, and one or more storage media 1130 (for example, one or more mass storage devices) storing application programs 1131 or data 1132. Among them, the memory 1120 and the storage medium 1130 can be short-term storage or persistent storage. The program stored in the storage medium 1130 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device 1100. Furthermore, the central processing unit 1110 can be configured to communicate with the storage medium 1130 to execute a series of instruction operations in the storage medium 1130 on the computer device 1100.

[0241] The computer device 1100 may also include one or more power supplies 1140, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1160, and / or one or more operating systems 1133, such as Windows Server 2003 or Windows Server 2008. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSDTM etc.

[0242] The steps performed by the decoding device in the above embodiment can be based on the Figure 11 The computer device structure shown.

[0243] 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.

[0244] 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 merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or 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.

[0245] The units described as separate components may or may not be physically separate, and the 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.

[0246] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0247] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, an interactive video management device, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0248] As described above, 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 above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above 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.

Claims

1. A video processing method, characterized in that: include: Based on the video editing application interface, responding to the first video upload instruction, obtaining the first video file; Determine a first video segment and a second video segment from the first video file, where the first video segment and the second video segment are the same as or different from the displayed video segment; Invoking a first decoder to decode the first video segment within a target time period, wherein the target time period includes a termination time for decoding the first video segment; determining, based on the video editing application interface, an initial decoding time of the second video segment in response to a decoding instruction for the second video segment; Obtaining a first decoding identifier according to the first video segment, wherein the first decoding identifier includes a first editing track identifier, and the first editing track identifier is used to indicate a first editing track of the first video segment in the video editing application; determining the first decoder according to the first decoding identifier; Acquire a second decoding identifier according to the second video segment, wherein the second decoding identifier includes a second editing track identifier, and the second editing track identifier is used to indicate a second editing track of the second video segment in the video editing application; If the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to a preset duration, calling the first decoder to decode the second video segment; including: if the second decoding identifier is the same as the first decoding identifier, and the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to the preset duration, calling the first decoder to decode the second video segment.

2. The method according to claim 1, characterized in that The method further comprises: Acquire a second decoding identifier according to the second video segment, wherein the second decoding identifier includes a second editing track identifier, and the second editing track identifier is used to indicate a second editing track of the second video segment in the video editing application; If the second decoding identifier is different from the first decoding identifier, obtaining a first interval of the first video segment on the first editing track and a second interval of the second video segment on the second editing track; If the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to a preset duration, calling the first decoder to decode the second video segment includes: If the second decoding identifier is different from the first decoding identifier, and there is no overlapping interval between the first interval and the second interval, and the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to the preset duration, then the first decoder is called to decode the second video segment.

3. The method according to any one of claims 1 to 2, characterized in that The method further comprises: If decoding of the first video segment is completed, the first decoding identifier is removed from the decoding identifier pool corresponding to the first decoder.

4. The method according to any one of claims 1 to 2, characterized in that After calling the first decoder to decode the second video segment, the method further includes: If there is no decoding identifier in the decoding identifier pool corresponding to the first decoder, it is determined that the first decoder is in a disabled state; or, The first video file further includes a third video segment; and the method further includes: determining, based on the video editing application interface, an initial decoding time of the third video segment in response to a decoding instruction for the third video segment; If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is greater than the preset duration, it is determined that the first decoder is in a disabled state.

5. The method according to any one of claims 1 to 2, characterized in that The first video file further includes a third video segment; and the method further includes: determining, based on the video editing application interface, an initial decoding time of the third video segment in response to a decoding instruction for the third video segment; If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is less than or equal to the preset duration, the first decoder is called to decode the third video segment.

6. The method according to claim 1, characterized in that The method further comprises: If the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to a preset duration, obtaining a second decoding identifier corresponding to the second video segment; A second decoder corresponding to the second decoding identifier is called to decode the second video segment.

7. The method according to any one of claims 1 to 2, characterized in that The method further comprises: Responding to a second video upload instruction based on the video editing application interface to obtain a second video file, wherein the second video file includes a fourth video segment; Acquire a third interval of the fourth video segment on the editing application interface, wherein the third interval overlaps with the second interval of the second video segment on the editing application interface; Based on the video editing application interface, in response to the decoding instruction for the fourth video segment, a third decoder is called to decode the fourth video segment.

8. The method according to claim 7, characterized in that The second video file further includes a fifth video segment; and the method further includes: Obtaining a termination decoding time of decoding the fourth video segment; determining, based on the video editing application interface, an initial decoding time of the fifth video segment in response to a decoding instruction for the fifth video segment; If the difference between the initial decoding time of the fifth video segment and the termination decoding time of the fourth video segment is less than or equal to the preset duration, the third decoder is called to decode the fifth video segment.

9. The method according to any one of claims 1 to 2, characterized in that The method further comprises: Dividing the first video segment into N video frames to obtain a first sequence of frames, and dividing the first video segment into M video frames to obtain a second sequence of frames, where M and N are both positive integers; generating a first video segment corresponding to a PAG format according to the first sequence of frames, and generating a second video segment corresponding to a PAG format according to the second sequence of frames; The calling of the first decoder to decode the first video segment within the target time period includes: Invoking a first decoder to decode a first video segment corresponding to the PAG format within a target time period; The calling the first decoder to decode the second video segment includes: The first decoder is called to decode the second video segment corresponding to the PAG format.

10. The method according to claim 1, characterized in that The method further comprises: Editing the decoded first video segment and the decoded second video segment to obtain a target video template; In response to the upload instruction for the target video template, the target video template is added to the video template library.

11. A video processing device, characterized in that: include: An acquiring unit, configured to acquire a first video file in response to a video upload instruction based on a video editing application interface; A processing unit for: Determine a first video segment and a second video segment from the first video file, where the first video segment and the second video segment are the same as or different from the displayed video segment; Invoking a first decoder to decode the first video segment within a target time period, wherein the target time period includes a termination time for decoding the first video segment; determining, based on the video editing application interface, an initial decoding time of the second video segment in response to a decoding instruction for the second video segment; If the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to a preset duration, calling the first decoder to decode the second video segment; The acquiring unit is further configured to acquire a first decoding identifier according to the first video segment, wherein the first decoding identifier includes a first editing track identifier, and the first editing track identifier is used to indicate a first editing track of the first video segment in the video editing application; The processing unit is further configured to determine the first decoder according to the first decoding identifier; The acquiring unit is further configured to acquire a second decoding identifier according to the second video segment, wherein the second decoding identifier includes a second editing track identifier, and the second editing track identifier is used to indicate a second editing track of the second video segment in the video editing application; The processing unit is specifically used to call the first decoder to decode the second video segment if the second decoding identifier is the same as the first decoding identifier, and the difference between the initial decoding time of the second video segment and the termination decoding time of the first video segment is less than or equal to the preset duration.

12. The device according to claim 11, characterized in that The acquisition unit is further configured to: Acquire a second decoding identifier according to the second video segment, wherein the second decoding identifier includes a second editing track identifier, and the second editing track identifier is used to indicate a second editing track of the second video segment in the video editing application; If the second decoding identifier is different from the first decoding identifier, obtaining a first interval of the first video segment on the first editing track and a second interval of the second video segment on the second editing track; The processing unit is specifically configured to call the first decoder to decode the second video segment if the second decoding identifier is different from the first decoding identifier, there is no overlapping interval between the first interval and the second interval, and the difference between the initial decoding time of the second video segment and the end decoding time of the first video segment is less than or equal to a preset duration.

13. The device according to any one of claims 11 to 12, characterized in that: The processing unit is further configured to remove the first decoding identifier from a decoding identifier pool corresponding to the first decoder if decoding of the first video segment is completed.

14. The device according to any one of claims 11 to 12, characterized in that The processing unit is further configured to determine that the first decoder is in a disabled state if there is no decoding identifier in the decoding identifier pool corresponding to the first decoder; or The first video file also includes a third video segment; the processing unit is further configured to: determining, based on the video editing application interface, an initial decoding time of the third video segment in response to a decoding instruction for the third video segment; If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is greater than the preset duration, it is determined that the first decoder is in a disabled state.

15. The device according to any one of claims 11-12, characterized in that The first video file also includes a third video segment; The processing unit is further configured to: determining, based on the video editing application interface, an initial decoding time of the third video segment in response to a decoding instruction for the third video segment; If the difference between the initial decoding time of the third video segment and the termination decoding time of the second video segment is less than or equal to the preset duration, the first decoder is called to decode the third video segment.

16. The device according to claim 11, characterized in that The acquiring unit is further configured to acquire a second decoding identifier corresponding to the second video segment if a difference between an initial decoding time of the second video segment and an end decoding time of the first video segment is less than or equal to a preset duration; The processing unit is further configured to call a second decoder corresponding to the second decoding identifier to perform decoding processing on the second video segment.

17. The device according to any one of claims 11-12, characterized in that The acquisition unit is further configured to: Responding to a second video upload instruction based on the video editing application interface to obtain a second video file, wherein the second video file includes a fourth video segment; Acquire a third interval of the fourth video segment on the editing application interface, wherein the third interval overlaps with the second interval of the second video segment on the editing application interface; The processing unit is further configured to respond to a decoding instruction for the fourth video segment based on the video editing application interface and call a third decoder to decode the fourth video segment.

18. The device according to claim 17, characterized in that The second video file further includes a fifth video segment; The acquisition unit is further configured to acquire a decoding termination time for decoding the fourth video segment; The processing unit is further configured to: determining, based on the video editing application interface, an initial decoding time of the fifth video segment in response to a decoding instruction for the fifth video segment; If the difference between the initial decoding time of the fifth video segment and the termination decoding time of the fourth video segment is less than or equal to the preset duration, the third decoder is called to decode the fifth video segment.

19. The device according to any one of claims 11-12, characterized in that The processing unit is further configured to: Dividing the first video segment into N video frames to obtain a first sequence of frames, and dividing the first video segment into M video frames to obtain a second sequence of frames, where M and N are both positive integers; generating a first video segment corresponding to a PAG format according to the first sequence of frames, and generating a second video segment corresponding to a PAG format according to the second sequence of frames; The processing unit is specifically configured to call the first decoder to decode the first video segment corresponding to the PAG format within a target time period; and call the first decoder to decode the second video segment corresponding to the PAG format.

20. The device according to claim 11, characterized in that The processing unit is further configured to: Editing the decoded first video segment and the decoded second video segment to obtain a target video template; In response to the upload instruction for the target video template, the target video template is added to the video template library.

21. A computer device, characterized in that: The computer device includes a processor and a memory: The memory is used to store program code; The processor is configured to execute the video processing method according to any one of claims 1 to 10 according to instructions in the program code.

22. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer is caused to execute the video processing method according to any one of claims 1 to 10.

23. A computer program product comprising a computer program, characterized in that When the method is run on a computer device, the computer device is enabled to execute the video processing method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Video play method and device

    CN109587570A