Video preview method and device
By saving video data and special effect data during video editing, and reading and calculating data changes from the cache during preview for rendering, the problem of video preview takes a long time and improving efficiency and speed.
Patent Information
- Application Number
- CN201811570611.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-21
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2038-12-21
AI Technical Summary
During the video editing process, the lack of data frame driver causes the video to be re-rendered when previewing, which takes a long time, is inefficient and has a high resource overhead.
During the video editing process, the video data and special effect data are saved to the cache, and when a video preview request is received, the data at the target time is read from the cache for rendering, avoiding re-acquisition of data, and calculating the amount of data changes to optimize rendering process and process multiple preview requests based on request priority.
Reduces the consumption of resource reading and rendering, improves video preview speed, saves overhead and improves efficiency.
Smart Images

Figure CN111356012B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video processing, and in particular to a video preview method and device. Background Art
[0002] When a video is playing, it is driven by data frames. During the video editing process, the video is paused. Therefore, if the user drags the progress bar or edits the current screen, the screen will need to be re-rendered. Currently, due to the lack of data frame drivers, when a screen at a certain point in time needs to be rendered, it is necessary to obtain the video data and special effects data corresponding to that point in time and process them all, which is time-consuming, inefficient, and requires large resource consumption. Summary of the invention
[0003] In view of the above problems, the present invention is proposed to provide a video preview method and device that overcome the above problems or at least partially solve the above problems.
[0004] According to one aspect of the present invention, a video preview method is provided, comprising:
[0005] During video editing, video data and special effect data are saved to a cache;
[0006] In response to a video preview request, reading video data and special effect data corresponding to a target time point from the cache;
[0007] The screen is rendered according to the read video data and special effect data.
[0008] Optionally, during the video editing process, saving the video data and special effect data to a cache includes:
[0009] According to the video editing request, the video data and special effect data corresponding to the corresponding time point are saved.
[0010] Optionally, the video preview request includes:
[0011] After editing the current screen, a request is made to display the edited screen;
[0012] and / or,
[0013] A request to display the scene at a target time point in an edited video based on a time point selection operation.
[0014] Optionally, rendering the picture according to the read video data and special effect data includes:
[0015] Calculate the amount of change of the video data and / or special effect data corresponding to the current picture according to the video data and / or special effect data corresponding to the edited picture / the picture at the target time point;
[0016] According to the change amount, picture rendering is performed based on the current picture.
[0017] Optionally, the method further comprises:
[0018] Before calculating the change amount, determine whether the interval between the target time point and the time point corresponding to the current picture reaches a preset threshold. If so, do not calculate the change amount, and directly render the picture based on the video data and special effect data corresponding to the picture at the target time point.
[0019] Optionally, the method further comprises:
[0020] The video preview requests are prioritized according to the request type. When multiple video preview requests are received within a preset time, the processing order of each video preview request is determined according to the priority.
[0021] Optionally, the priority of the video preview request generated during the video dragging operation is lower than the priority of the video preview request generated when the video dragging operation ends.
[0022] According to another aspect of the present invention, a video preview device is provided, comprising:
[0023] A cache unit, adapted to save video data and special effect data to a cache during video editing;
[0024] The preview unit is adapted to respond to a video preview request, read the video data and special effect data corresponding to the target time point from the cache, and perform picture rendering according to the read video data and special effect data.
[0025] Optionally, the cache unit is adapted to store video data and special effect data corresponding to a corresponding time point according to a video editing request.
[0026] Optionally, the video preview request includes:
[0027] After editing the current screen, a request is made to display the edited screen;
[0028] and / or,
[0029] A request to display the scene at a target time point in an edited video based on a time point selection operation.
[0030] Optionally, the preview unit is suitable for calculating the change amount of the video data and / or special effect data corresponding to the current picture based on the video data and / or special effect data corresponding to the edited picture / picture at the target time point; and performing picture rendering based on the current picture according to the change amount.
[0031] Optionally, the preview unit is suitable for judging whether the interval between the target time point and the time point corresponding to the current picture reaches a preset threshold before calculating the change amount. If so, the change amount is not calculated, and the picture is directly rendered according to the video data and special effect data corresponding to the picture at the target time point.
[0032] Optionally, the preview unit is adapted to prioritize the video preview requests according to the request type, and when multiple video preview requests are received within a preset time, determine the processing order of each video preview request according to the priority.
[0033] Optionally, the priority of the video preview request generated during the video dragging operation is lower than the priority of the video preview request generated when the video dragging operation ends.
[0034] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the above methods.
[0035] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, the one or more programs implement any of the methods described above.
[0036] As can be seen from the above, the technical solution of the present invention saves the video data and special effect data to the cache during the video editing process, so that after receiving the video preview request, the video data and special effect data corresponding to the target time point are read from the cache, and the screen is rendered according to the read video data and special effect data. This technical solution avoids re-acquiring the data of the screen at the target time point and re-rendering, reduces the consumption of resource reading and rendering, improves the preview speed, saves overhead, and is more efficient.
[0037] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0039] Figure 1A schematic flow chart of a video preview method according to an embodiment of the present invention is shown;
[0040] Figure 2 A schematic structural diagram of a video preview device according to an embodiment of the present invention is shown;
[0041] Figure 3 A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown;
[0042] Figure 4 A schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0043] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0044] Figure 1 A schematic flow chart of a video preview method according to an embodiment of the present invention is shown.
[0045] like Figure 1 As shown, the method includes:
[0046] Step S110, during the video editing process, the video data and special effect data are saved to a cache.
[0047] Special effect data can be textures, light and shadow effect data, etc. added to the original video. For example, the background of a character in a video is replaced with a texture to create a special scene. Video data is the data of each frame in a video. In an embodiment of the present invention, a user can select video editing materials, such as videos, pictures, etc., and multiple materials can be loaded at the same time; then part or all of the video can be edited according to the selected materials.
[0048] Step S120 , in response to the video preview request, reading the video data and special effect data corresponding to the target time point from the cache.
[0049] At this time, the video is still in a paused state, so unlike the playing state, the rendering cannot be completed by a data frame driven method. Therefore, if the method in the prior art is adopted, the update takes a long time.
[0050] Step S130, performing picture rendering according to the read video data and special effect data.
[0051] visible, Figure 1The method shown saves the video data and special effect data to the cache during the video editing process, and then reads the video data and special effect data corresponding to the target time point from the cache after receiving the video preview request, and renders the screen according to the read video data and special effect data. This technical solution avoids re-acquiring the data of the screen at the target time point for re-rendering, reduces the consumption of resource reading and rendering, improves the preview speed, saves overhead, and is more efficient.
[0052] In one embodiment of the present invention, in the above method, during the video editing process, saving the video data and special effect data to the cache includes: saving the video data and special effect data corresponding to the corresponding time point according to the video editing request.
[0053] In a specific embodiment, each video data and special effect data is saved corresponding to a time point, where the time point refers to a time point corresponding to the time progress of the video itself. For example, a video lasting one minute can save video data and special effect data corresponding to 15s, 20s, 30s, etc. time points.
[0054] In one embodiment of the present invention, in the above method, the video preview request includes: a request to display the edited picture after editing the current picture; and / or, based on a time point selection operation, a request to display the picture at a target time point in the edited video.
[0055] Video preview requests are different from video playback requests. Often, users want to display the screen corresponding to a specific time point. In one example, a user edits the current screen and wants to see the edited screen. In this case, a video preview request is generated. In another example, a user edits the entire or part of a video and wants to view the corresponding screen by dragging the progress bar or clicking a certain time point on the progress bar. This also generates a video preview request.
[0056] It should be noted that the embodiments implemented according to the present invention can be applied to smart terminals, such as various devices using the iOS system. On smart terminals, functions such as dragging the progress bar can also be implemented by directly dragging the video screen, and the present invention does not limit this.
[0057] In one embodiment of the present invention, in the above method, rendering the screen based on the read video data and special effects data includes: calculating the change amount of the video data and / or special effects data corresponding to the edited screen / screen at the target time point relative to the current screen; and rendering the screen based on the current screen according to the change amount.
[0058] Specifically, if rendering is performed based on the full amount of data, it will still consume a lot of resources and be inefficient. Therefore, if the video content does not change much, by calculating the amount of change in the video data and special effect data and rendering the screen based on the amount of change, a lot of resources can be saved and the preview speed can be improved.
[0059] It should also be explained here that the expression "based on the video data and / or special effects data corresponding to the edited picture / the picture at the target time point" means that in scenarios such as viewing the edited picture in real time, it is necessary to calculate the change in the video data and / or special effects data corresponding to the edited picture relative to the current picture based on the video data and / or special effects data corresponding to the edited picture; when the user drags the picture or specifies a certain time point, the change in the video data and / or special effects data corresponding to the picture at the target time point is calculated.
[0060] In one embodiment of the present invention, the above method also includes: before calculating the change amount, determining whether the interval between the target time point and the time point corresponding to the current picture reaches a preset threshold, if so, not calculating the change amount, and directly rendering the picture based on the video data and special effects data corresponding to the picture at the target time point.
[0061] Of course, if the difference between the two pictures is large, then calculating the amount of change is not very meaningful. For example, if it is a recorded video of a live broadcast of a certain anchor, since the anchor's movement amplitude, position, etc. have limited changes over a long period of time, the method of calculating the amount of change has a significant improvement. For action movie clips, the effect of calculating the amount of change is not obvious due to the fast scene switching and large movement amplitude in the picture. In the case of not identifying the content, the control method of setting the interval threshold is adopted. It can be considered that the content of the two pictures with a long interval is quite different. At this time, the method of directly rendering the picture according to the video data and special effects data corresponding to the picture at the target time point is adopted.
[0062] In one embodiment of the present invention, the method further includes: prioritizing the video preview requests according to the request type, and when multiple video preview requests are received within a preset time, determining the processing order of each video preview request according to the priority.
[0063] When a user previews a video, a large number of video preview requests may be triggered in a short period of time. Considering the recognition of the human eye and the actual scenario, the video preview requests can be prioritized and distinguished by adding a priority identifier to each video request. The processing order of each video preview request can be determined according to the priority.
[0064] Specifically, in one embodiment of the present invention, in the above method, the priority of the video preview request generated during the video dragging operation is lower than the priority of the video preview request generated when the video dragging operation ends.
[0065] When users drag a video, they often want to see the corresponding screen when they stop, but they often don't pay attention to the screens in the dragging process. If the dragging operation is too fast, they can't actually see it all. Therefore, the priority of the video preview request generated during the dragging operation can be set lower than the priority of the video preview request generated at the end of the dragging operation. In this way, the video preview request generated at the end of the dragging operation can be processed first, which further improves the user experience and makes the video preview effect better.
[0066] Figure 2 FIG. 2 shows a schematic diagram of the structure of a video preview device according to an embodiment of the present invention. Figure 2 As shown, the video preview device 200 includes:
[0067] The cache unit 210 is adapted to store video data and special effect data in the cache during the video editing process.
[0068] Special effect data can be textures, light and shadow effect data, etc. added to the original video. For example, the background of a character in a video is replaced with a texture to create a special scene. Video data is the data of each frame in a video. In an embodiment of the present invention, a user can select video editing materials, such as videos, pictures, etc., and multiple materials can be loaded at the same time; then part or all of the video can be edited according to the selected materials.
[0069] The preview unit 220 is adapted to respond to a video preview request, read video data and special effect data corresponding to a target time point from a cache, and perform picture rendering according to the read video data and special effect data.
[0070] visible, Figure 2 The device shown saves the video data and special effect data to a cache during the video editing process, and then reads the video data and special effect data corresponding to the target time point from the cache after receiving a video preview request, and renders the screen according to the read video data and special effect data. This technical solution avoids re-acquiring the data of the screen at the target time point for re-rendering, reduces the consumption of resource reading and rendering, improves the preview speed, saves overhead, and is more efficient.
[0071] In one embodiment of the present invention, in the above-mentioned device, the cache unit 210 is adapted to store the video data and special effect data corresponding to the corresponding time point according to the video editing request.
[0072] In a specific embodiment, each video data and special effect data is saved corresponding to a time point, where the time point refers to a time point corresponding to the time progress of the video itself. For example, a video lasting one minute can save video data and special effect data corresponding to 15s, 20s, 30s, etc. time points.
[0073] In one embodiment of the present invention, in the above-mentioned device, the video preview request includes: a request to display the edited picture after editing the current picture; and / or, based on a time point selection operation, a request to display the picture at a target time point in the edited video.
[0074] Video preview requests are different from video playback requests. Often, users want to display the screen corresponding to a specific time point. In one example, a user edits the current screen and wants to see the edited screen. In this case, a video preview request is generated. In another example, a user edits the entire or part of a video and wants to view the corresponding screen by dragging the progress bar or clicking a certain time point on the progress bar. This also generates a video preview request.
[0075] It should be noted that the embodiments implemented according to the present invention can be applied to smart terminals, such as various devices using the iOS system. On smart terminals, functions such as dragging the progress bar can also be implemented by directly dragging the video screen, and the present invention does not limit this.
[0076] In one embodiment of the present invention, in the above-mentioned device, the preview unit 220 is suitable for calculating the change amount of the video data and / or special effect data corresponding to the current picture based on the video data and / or special effect data corresponding to the edited picture / the picture at the target time point; and performing picture rendering based on the current picture according to the change amount.
[0077] Specifically, if rendering is performed based on the full amount of data, it will still consume a lot of resources and be inefficient. Therefore, if the video content does not change much, by calculating the amount of change in the video data and special effect data and rendering the screen based on the amount of change, a lot of resources can be saved and the preview speed can be improved.
[0078] It should also be explained here that the expression "based on the video data and / or special effects data corresponding to the edited picture / the picture at the target time point" means that in scenarios such as viewing the edited picture in real time, it is necessary to calculate the change in the video data and / or special effects data corresponding to the edited picture relative to the current picture based on the video data and / or special effects data corresponding to the edited picture; when the user drags the picture or specifies a certain time point, the change in the video data and / or special effects data corresponding to the picture at the target time point is calculated.
[0079] In one embodiment of the present invention, in the above-mentioned device, the preview unit 220 is suitable for judging whether the interval between the target time point and the time point corresponding to the current picture reaches a preset threshold before calculating the change amount. If so, the change amount is not calculated, and the picture is directly rendered according to the video data and special effect data corresponding to the picture at the target time point.
[0080] Of course, if the difference between the two pictures is large, then calculating the amount of change is not very meaningful. For example, if it is a recorded video of a live broadcast of a certain anchor, since the anchor's movement amplitude, position, etc. have limited changes over a long period of time, the method of calculating the amount of change has a significant improvement. For action movie clips, the effect of calculating the amount of change is not obvious due to the fast scene switching and large movement amplitude in the picture. In the case of not identifying the content, the control method of setting the interval threshold is adopted. It can be considered that the content of the two pictures with a long interval is quite different. At this time, the method of directly rendering the picture according to the video data and special effects data corresponding to the picture at the target time point is adopted.
[0081] In one embodiment of the present invention, in the above-mentioned device, the preview unit 220 is adapted to prioritize the video preview requests according to the request type, and when multiple video preview requests are received within a preset time, determine the processing order of each video preview request according to the priority.
[0082] When a user previews a video, a large number of video preview requests may be triggered in a short period of time. Considering the recognition of the human eye and the actual scenario, the video preview requests can be prioritized and distinguished by adding a priority identifier to each video request. The processing order of each video preview request can be determined according to the priority.
[0083] Specifically, in one embodiment of the present invention, in the above device, the priority of the video preview request generated during the video dragging operation is lower than the priority of the video preview request generated when the video dragging operation ends.
[0084] When users drag a video, they often want to see the corresponding screen when they stop, but they often don't pay attention to the screens in the dragging process. If the dragging operation is too fast, they can't actually see it all. Therefore, the priority of the video preview request generated during the dragging operation can be set lower than the priority of the video preview request generated at the end of the dragging operation. In this way, the video preview request generated at the end of the dragging operation can be processed first, which further improves the user experience and makes the video preview effect better.
[0085] In summary, the technical solution of the present invention saves the video data and special effect data to the cache during the video editing process, so that after receiving the video preview request, the video data and special effect data corresponding to the target time point are read from the cache, and the screen is rendered according to the read video data and special effect data. This technical solution avoids re-acquiring the data of the screen at the target time point and re-rendering, reduces the consumption of resource reading and rendering, improves the preview speed, saves overhead, and is more efficient.
[0086] It should be noted that:
[0087] The algorithm and display provided herein are not inherently related to any particular computer, virtual device or other equipment. Various general-purpose devices can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of device. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific language is for the purpose of disclosing the best mode of the present invention.
[0088] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0089] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0090] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0091] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0092] The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the video preview device according to an embodiment of the present invention. The present invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0093] For example, Figure 3A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown. The electronic device includes a processor 310 and a memory 320 arranged to store computer executable instructions (computer readable program code). The memory 320 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. The memory 320 has a storage space 330 for storing a computer readable program code 331 for executing any method step in the above method. For example, the storage space 330 for storing computer readable program code may include various computer readable program codes 331 respectively used to implement various steps in the above method. The computer readable program code 331 can be read from or written to one or more computer program products. These computer program products include program code carriers such as a hard disk, a compact disk (CD), a memory card or a floppy disk. Such a computer program product is usually, for example Figure 4 The computer-readable storage medium. Figure 4 A schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention is shown. The computer-readable storage medium 400 stores a computer-readable program code 331 for executing the method steps according to the present invention, which can be read by the processor 310 of the electronic device 300. When the computer-readable program code 331 is executed by the electronic device 300, the electronic device 300 executes the various steps in the method described above. Specifically, the computer-readable program code 331 stored in the computer-readable storage medium can execute the method shown in any of the above embodiments. The computer-readable program code 331 can be compressed in an appropriate form.
[0094] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0095] The embodiment of the present invention discloses A1, a video preview method, comprising:
[0096] During video editing, video data and special effect data are saved to a cache;
[0097] In response to a video preview request, reading video data and special effect data corresponding to a target time point from the cache;
[0098] The screen is rendered according to the read video data and special effect data.
[0099] A2. The method as described in A1, wherein, during the video editing process, saving the video data and special effect data to the cache comprises:
[0100] According to the video editing request, the video data and special effect data corresponding to the corresponding time point are saved.
[0101] A3. The method as described in A1, wherein the video preview request includes:
[0102] After editing the current screen, a request is made to display the edited screen;
[0103] and / or,
[0104] A request to display the scene at a target time point in an edited video based on a time point selection operation.
[0105] A4. The method as described in A3, wherein the rendering of the picture according to the read video data and special effect data comprises:
[0106] Calculate the amount of change of the video data and / or special effect data corresponding to the current picture according to the video data and / or special effect data corresponding to the edited picture / the picture at the target time point;
[0107] According to the change amount, picture rendering is performed based on the current picture.
[0108] A5. The method as described in A4, wherein the method further comprises:
[0109] Before calculating the change amount, determine whether the interval between the target time point and the time point corresponding to the current picture reaches a preset threshold. If so, do not calculate the change amount, and directly render the picture based on the video data and special effect data corresponding to the picture at the target time point.
[0110] A6. The method as described in A3, wherein the method further comprises:
[0111] The video preview requests are prioritized according to the request type. When multiple video preview requests are received within a preset time, the processing order of each video preview request is determined according to the priority.
[0112] A7. The method as described in A6, wherein the priority of the video preview request generated during the video dragging operation is lower than the priority of the video preview request generated when the video dragging operation ends.
[0113] The embodiment of the present invention further discloses B8, a video preview device, comprising:
[0114] A cache unit, adapted to save video data and special effect data to a cache during video editing;
[0115] The preview unit is adapted to respond to a video preview request, read the video data and special effect data corresponding to the target time point from the cache, and perform picture rendering according to the read video data and special effect data.
[0116] B9. The device as described in B8, wherein:
[0117] The cache unit is adapted to store video data and special effect data corresponding to a corresponding time point according to a video editing request.
[0118] B10. The device as described in B8, wherein the video preview request includes:
[0119] After editing the current screen, a request is made to display the edited screen;
[0120] and / or,
[0121] A request to display the scene at a target time point in an edited video based on a time point selection operation.
[0122] B11. The device as described in B10, wherein:
[0123] The preview unit is adapted to calculate the amount of change in the video data and / or special effect data corresponding to the current picture based on the video data and / or special effect data corresponding to the edited picture / picture at the target time point; and perform picture rendering based on the current picture according to the amount of change.
[0124] B12. The device as described in B11, wherein
[0125] The preview unit is adapted to determine whether the interval between the target time point and the time point corresponding to the current picture reaches a preset threshold before calculating the change amount. If so, the change amount is not calculated, and the picture is directly rendered according to the video data and special effect data corresponding to the picture at the target time point.
[0126] B13. The device as described in B10, wherein:
[0127] The preview unit is adapted to prioritize video preview requests according to request types, and when multiple video preview requests are received within a preset time, determine a processing order for each video preview request according to the priority.
[0128] B14. The device as described in B13, wherein the priority of the video preview request generated during the dragging video operation is lower than the priority of the video preview request generated when the dragging video operation ends.
[0129] An embodiment of the present invention also discloses C15, an electronic device, wherein the electronic device comprises: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to execute a method as described in any one of A1-A7.
[0130] An embodiment of the present invention further discloses D16, a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, implement the method as described in any one of A1-A7.
Claims
1. A video preview method, comprising: During video editing, video data and special effect data are saved to a cache; In response to a video preview request, reading video data and special effect data corresponding to a target time point from the cache; Render the image based on the read video data and special effect data; The rendering of the picture according to the read video data and special effect data comprises: calculating the change amount of the video data and / or special effect data corresponding to the current picture according to the read video data and / or special effect data corresponding to the target time point; and rendering the picture based on the current picture according to the change amount; The method also includes: before calculating the change amount, determining whether the interval between the target time point and the time point corresponding to the current picture reaches a preset threshold, if so, not calculating the change amount, and directly rendering the picture according to the video data and special effect data corresponding to the picture at the target time point.
2. The method of claim 1, wherein: In the video editing process, saving the video data and special effect data to the cache includes: According to the video editing request, the video data and special effect data corresponding to the corresponding time point are saved.
3. The method of claim 1, wherein: The video preview request includes: After editing the current screen, a request is made to display the edited screen; and / or, A request to display the scene at a target time point in an edited video based on a time point selection operation.
4. The method of claim 3, wherein: The method further comprises: The video preview requests are prioritized according to the request type. When multiple video preview requests are received within a preset time, the processing order of each video preview request is determined according to the priority.
5. The method of claim 4, wherein: The priority of a video preview request generated during a video dragging operation is lower than the priority of a video preview request generated when the video dragging operation ends.
6. A video preview device, comprising: A cache unit, adapted to save video data and special effect data to a cache during video editing; A preview unit, adapted to read video data and special effect data corresponding to a target time point from the cache in response to a video preview request; Render the image based on the read video data and special effect data; The preview unit is adapted to calculate a change amount of the video data and / or special effect data corresponding to the current picture according to the video data and / or special effect data corresponding to the read target time point; According to the change amount, rendering is performed on the basis of the current picture; The preview unit 220 is adapted to determine whether the interval between the target time point and the time point corresponding to the current picture reaches a preset threshold before calculating the change amount. If so, the change amount is not calculated, and the picture is directly rendered according to the video data and special effect data corresponding to the picture at the target time point.
7. The device according to claim 6, wherein: The cache unit is adapted to store video data and special effect data corresponding to a corresponding time point according to a video editing request.
8. The device of claim 6, wherein: The video preview request includes: After editing the current screen, a request is made to display the edited screen; and / or, A request to display the scene at a target time point in an edited video based on a time point selection operation.
9. The device of claim 8, wherein: The preview unit is adapted to prioritize video preview requests according to request types, and when multiple video preview requests are received within a preset time, determine a processing order for each video preview request according to the priority.
10. The device of claim 9, wherein: The priority of a video preview request generated during a video dragging operation is lower than the priority of a video preview request generated when the video dragging operation ends.
11. An electronic device, wherein: The electronic device comprises: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the method according to any one of claims 1 to 5.
12. A computer-readable storage medium, wherein: The computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, the method according to any one of claims 1 to 5 is implemented.
