Video processing method, electronic equipment and computer readable storage medium
By displaying video frames as a video timeline in the mobile phone system and using sliding operations to determine the target video time, the problem of inefficiency in screening video clips for mobile phone system users is solved, and accurate correspondence and efficient screening of the video frame timeline and video content are achieved. .
Patent Information
- Application Number
- CN202411023880.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-10-08
AI Technical Summary
Mobile system users need to browse video content one by one when looking for video clips, resulting in low filtering efficiency.
The video frames are displayed as a video timeline through the data display control, and the user's sliding operation is used to determine the video time at the target position to achieve accurate correspondence between the video frame timeline and the video content.
It improves the efficiency of users in finding video clips that need to be played back or edited during video playback or editing. The target video is accurately positioned by sliding the offset, making video processing more efficient.
Smart Images

Figure CN118748739A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a video processing method, an electronic device, and a computer-readable storage medium. Background Art
[0002] In the prior art, a mobile phone system user needs to play back or edit a video stored in a video recording device. In order to find the video clip that he needs to play back or edit, the mobile phone system user needs to browse the video content one by one to find the video clip that he needs to play back or edit.
[0003] This method requires a lot of time to screen to find the required video, which is very inefficient. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a video processing method, an electronic device and a computer-readable storage medium to solve the inefficiency problem that users of current mobile phone systems need to spend a lot of time screening to find the required images from the video.
[0005] In a first aspect, the present invention provides a video processing method, the method comprising: obtaining a user's sliding operation on a video timeline of a target video; wherein the video timeline displays and generates multiple video frames extracted from the target video based on a data display control; determining a timeline offset corresponding to the sliding operation according to the sliding operation; obtaining a unit width-to-time ratio and an initial timeline position; wherein the unit width-to-time ratio represents the time ratio of each width of the data display control to the target video, and the initial timeline position represents the timeline position before the sliding operation is generated; calculating a target video time corresponding to the target position according to the timeline offset, the unit width-to-time ratio and the initial timeline position; wherein the target video time is used to display the video frame at the corresponding time point based on the target video time after the sliding operation.
[0006] The video processing method designed above displays multiple video frames in the extracted video in the form of a video timeline through the data display control of the mobile phone system, and determines the target video time corresponding to the target position after the sliding operation through the offset of the user's sliding operation on the data display control, so that after the sliding operation, the video frame of the corresponding time point is displayed based on the target video time. As a result, the video processing method designed in this scheme enables the user to quickly find the video clip part that needs to be played back or edited through the video timeline displayed by multiple video frames when playing back or editing the video, thereby improving the user's efficiency in screening video clips, and accurately locates the target video corresponding to the target position after sliding through the offset of the user's sliding, so that the target video content and the video timeline progress are better linked, thereby achieving accurate correspondence between the video frame timeline and the video content.
[0007] In an optional implementation of the first aspect, before obtaining the user's sliding operation on the video timeline of the target video, the method also includes: obtaining the target video; extracting multiple video frames from the target video in sequence at preset intervals to form a video frame set; and generating and displaying a video timeline based on the data display control and the multiple video frames in the video frame set.
[0008] In the above implementation mode, the present solution generates a video timeline from the extracted multiple video frames and displays them through a data display control, so that the video timeline displayed by the multiple video frames can prompt the user to quickly find the video clips that need to be played back or edited, thereby improving efficiency and user experience.
[0009] In an optional implementation of the first aspect, before acquiring the target video, the method further includes: configuring the operating environment and display parameters of the data display control.
[0010] In an optional implementation of the first aspect, the operating environment and display parameters of the data display control are configured, including: adding the data display control through the layout manager and creating an adapter corresponding to the data display control; and configuring the display height and display width of the data display control.
[0011] In the above implementation mode, the present invention displays the extracted multiple video frames in the form of a video timeline through the data display control of the mobile phone system, so that the video timeline has low drawing cost, smooth sliding, good scalability of the video timeline style, and low maintenance cost.
[0012] In an optional implementation of the first aspect, obtaining the unit width-to-time ratio includes: obtaining the total display width of the data display control; obtaining the total video length of the target video; calculating the ratio of the total display width of the data display control to the total video length of the target video to obtain the unit width-to-time ratio.
[0013] In an optional implementation of the first aspect, the target video time corresponding to the target position is calculated based on the time axis offset, the unit width time ratio and the initial time axis position, including: calculating the product of the time axis offset and the unit width time to obtain the offset time; calculating the sum of the offset time and the initial time axis position to obtain the target video time corresponding to the target position.
[0014] In the above implementation mode, this solution accurately locates the target video corresponding to the target position after sliding through the offset of the user's sliding, so that the target video content and the progress of the video timeline are better linked, thereby achieving accurate correspondence between the video frame timeline and the video content.
[0015] In an optional implementation of the first aspect, determining a time axis offset corresponding to a sliding operation according to the sliding operation includes: monitoring whether an indicator of a data display control generates sliding; if sliding of the indicator of the data display control is detected, obtaining a sliding distance of the indicator of the data display control to determine a time axis offset corresponding to the sliding operation.
[0016] In a second aspect, the present application provides a video processing device, which includes an acquisition module, a determination module and a calculation module, wherein the acquisition module is used to acquire a user's sliding operation on a video timeline of a target video; wherein the video timeline is generated by displaying multiple video frames extracted from the target video based on a data display control; the determination module is used to determine, according to the sliding operation, a timeline offset corresponding to the sliding operation; the acquisition module is also used to acquire a unit width-to-time ratio and an initial timeline position; wherein the unit width-to-time ratio represents the time ratio of each width of the data display control to the target video, and the initial timeline position represents the timeline position before the sliding operation is generated; the calculation module is used to calculate the target video time corresponding to the target position based on the timeline offset, the unit width-to-time ratio and the initial timeline position; wherein the target video time is used to display the video frame of the corresponding time point based on the target video time after the sliding operation.
[0017] The video processing device designed as above, this scheme displays multiple video frames in the extracted video in the form of a video timeline through the data display control of the mobile phone system, and determines the target video time corresponding to the target position after the sliding operation through the offset of the user's sliding operation on the data display control, so that after the sliding operation, the video frame of the corresponding time point is displayed based on the target video time, so that the video processing method designed in this scheme, when the user is playing back or editing the video, can quickly find the video clip part that needs to be played back or edited through the video timeline displayed by multiple video frames, thereby improving the efficiency of the user in screening video clips, and accurately locates the target video corresponding to the target position after sliding through the offset of the user's sliding, so that the target video content and the progress of the video timeline are better linked, thereby realizing the accurate correspondence between the video frame timeline and the video content.
[0018] In an optional implementation of the second aspect, the acquisition module is also used to acquire the target video; the extraction module is used to extract multiple video frames from the target video in sequence according to a preset interval time to form a video frame set; the generation and display module is used to display controls according to the data, and based on the multiple video frames in the video frame set, generate a video timeline and display it.
[0019] In an optional implementation of the second aspect, the device further includes a configuration module for configuring an operating environment and display parameters of the data display control.
[0020] In an optional implementation of the second aspect, the configuration module is specifically used to add a data display control through a layout manager, and create an adapter corresponding to the data display control; and configure the display height and display width of the data display control.
[0021] In an optional implementation of the second aspect, the acquisition module is specifically used to obtain the total display width of the data display control; obtain the total video length of the target video; calculate the ratio of the total display width of the data display control to the total video length of the target video to obtain a unit width-to-time ratio.
[0022] In an optional implementation of the second aspect, the calculation module is specifically used to calculate the product of the time axis offset and the unit width time to obtain the offset time; calculate the sum of the offset time and the initial time axis position to obtain the target video time corresponding to the target position.
[0023] In an optional implementation of the second aspect, the determination module is specifically used to monitor whether the indicator of the data display control slides; if the indicator of the data display control slides, the sliding distance of the indicator of the data display control is obtained to determine the time axis offset corresponding to the sliding operation.
[0024] In a third aspect, the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes any optional method described in the first aspect when executing the computer program.
[0025] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs any optional method described in the first aspect.
[0026] In a fifth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, performs the steps of any optional method described in the first aspect.
[0027] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 A schematic diagram of a video processing method according to an embodiment of the present invention;
[0030] Figure 2 A schematic diagram of a video timeline display provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of the structure of a video processing device provided in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0033] Icons: 10 - video content; 20 - video timeline; 300 - acquisition module; 310 - determination module; 320 - calculation module; 330 - extraction module; 340 - generation and display module; 350 - configuration module; 4 - electronic device; 401 - processor; 402 - memory; 403 - communication bus. DETAILED DESCRIPTION
[0034] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0036] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0037] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0038] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0039] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0040] In the description of the embodiments of the present application, the technical terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the embodiments of the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the embodiments of the present application.
[0041] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0042] In the prior art, when a user of a mobile phone system (e.g., Android system) needs to play back or edit a video stored in a video recording device, the user of the mobile phone system (e.g., Android system) needs to browse the video contents one by one to find the video clip that needs to be played back or edited. This method requires a lot of time to screen to find the required video, which is very inefficient.
[0043] Based on the above problems, the present application designs a video processing method, an electronic device and a computer-readable storage medium, which displays multiple video frames in the extracted video in the form of a video timeline through the data display control of the mobile phone system, and determines the target video time corresponding to the target position after the sliding operation through the offset of the user's sliding operation on the data display control, so that after the sliding operation, the video frame of the corresponding time point is displayed based on the target video time, so that the video processing method designed in this scheme can enable the user to quickly find the video clip part that needs to be played back or edited through the video timeline displayed by multiple video frames when playing back or editing the video, thereby improving the user's efficiency in screening video clips, and accurately locate the target video corresponding to the target position after sliding through the offset of the user's sliding, thereby achieving accurate correspondence between the video frame timeline and the video content.
[0044] Based on the above ideas, the present application first provides a video processing method, which can be applied to electronic devices, specifically electronic devices with mobile phone systems, such as mobile phones with mobile phone systems, tablet computers with mobile phone systems, etc., wherein the mobile phone system can be specifically an Android system, or other mobile phone systems, such as Hongmeng, etc. Figure 1 As shown, the video processing method can be implemented in the following ways, including:
[0045] Step S100: Acquire the user's sliding operation on the video timeline of the target video.
[0046] Step S110: According to the sliding operation, determine the time axis offset corresponding to the sliding operation.
[0047] Step S120: Obtain the unit width-to-time ratio and the initial time axis position.
[0048] Step S130: Calculate the target video time corresponding to the target position according to the time axis offset, the unit width time ratio and the initial time axis position.
[0049] In the above implementation, the video content of the target video and the video timeline of the target video can be displayed on the display screen of the electronic device, wherein the video timeline of the target video can be generated by displaying multiple video frames extracted from the target video based on the data display control. The data display control can specifically be a Recyclerview control of the Android system.
[0050] Specifically, the process of generating the video timeline of the target video in this solution is as follows: this solution first obtains the target video, which can be obtained by real-time shooting or downloading from a video source; in the case of obtaining the video, this solution extracts multiple video frames from the target video in sequence according to a preset interval time to form a video frame set, and then generates and displays the video timeline based on the multiple video frames in the video frame set according to the data display control. For example, the target video obtained by this solution is a 1-minute video, and the preset interval time designed by this solution is 12 seconds. In this case, this solution can extract 5 video frames from the target video in sequence, and the data display control Recyclerview generates a video timeline based on the 5 video frames in the video frame set and displays it on the screen.
[0051] Furthermore, the video content and the video timeline display content can be as follows Figure 2As shown, the upper part shows the video content 10 corresponding to the video frame, and the lower part shows the video timeline 20 formed by multiple video frames. Since the video timeline 20 is formed by multiple video frames, each video frame of the video timeline shows the content corresponding to the frame of video. In this way, the user can understand the video content represented by each video frame through the content of each video frame of the video timeline 20, and then quickly filter the video content. It should be noted here that Figure 2 The example shown is only an example of this solution, and the preset interval time can be adaptively adjusted according to the time length of the target video. The time axis formed by the 5 video frames in the previous example of this solution is only for the convenience of understanding this solution. When the time length of the target video is long, the efficiency of screening video clips will be significantly reduced. In this solution, the video time axis formed by the extracted video frames allows users to quickly locate the video clips to be screened through the video time axis.
[0052] When the electronic device displays the video content and the video timeline, the user can perform operations on the screen of the electronic device. For example, the user can slide the video timeline, play the video content, and so on.
[0053] When the electronic device obtains a sliding operation generated by the user, the electronic device can determine the time axis offset corresponding to the sliding operation according to the sliding operation. Specifically, the electronic device can monitor whether the indicator of the data display control slides, and if the indicator of the data display control slides, the sliding distance of the indicator of the data display control is obtained, and the sliding distance of the indicator is used as the time axis offset corresponding to the sliding operation.
[0054] When the time axis offset is obtained, the present solution further obtains the unit width time ratio and the initial time axis position, wherein the unit width time ratio indicates the time ratio of each width of the data display control to the target video, and the initial time axis position indicates the time axis position before the sliding operation is generated. The initial time axis position can be obtained by identifying the position of the indicator of the data display control before sliding.
[0055] As a possible implementation method, the unit width-to-time ratio designed in the present scheme can be calculated in the following manner: first, the total display width of the data display control is obtained, and the total display width can be obtained by configuring the data display control in advance; then, the total video length of the target video is obtained, and the ratio of the total display width of the data display control to the total video length of the target video is calculated to obtain the unit width-to-time ratio.
[0056] It should be noted here that the unit width time ratio of this solution can be calculated in real time after the time offset is obtained, or can be calculated in advance before the time offset is obtained.
[0057] When the time axis offset, unit width time ratio and initial time axis position are obtained in the above manner, this solution can calculate the target video time corresponding to the target position according to the time axis offset, unit width time ratio and initial time axis position.
[0058] As a specific implementation method, this scheme can calculate the product of the time axis offset and the unit width time to obtain the offset time, and then calculate the sum of the offset time and the initial time axis position to obtain the target video time corresponding to the target position, and then display the video frame of the corresponding time point and the corresponding video content based on the target video time.
[0059] The video processing method designed above uses the data display control of the Android system to display multiple video frames in the extracted video in the form of a video timeline, and determines the target video time corresponding to the target position after the sliding operation through the offset of the user's sliding operation on the data display control, so that after the sliding operation, the video frame of the corresponding time point is displayed based on the target video time. As a result, the video processing method designed in this scheme allows the user to quickly find the video clip part that needs to be played back or edited through the video timeline displayed by multiple video frames when playing back or editing the video, thereby improving the user's efficiency in screening video clips, and accurately locates the target video corresponding to the target position after sliding through the offset of the user's sliding, so that the target video content and the video timeline progress are better linked, thereby achieving accurate correspondence between the video frame timeline and the video content.
[0060] In the optional implementation of this embodiment, it is described above that this solution displays the extracted multiple video frames in the form of a video timeline through a data display control. Before this, this solution needs to configure the data display control. Specifically, this solution can configure the operating environment and display parameters of the data display control.
[0061] As a possible implementation, this solution can add a data display control through a layout manager, create an adapter corresponding to the data display control, and configure the display height and display width of the data display control.
[0062] Specifically, adding data display controls through the layout manager can be achieved as follows: 1. Use AndroidStudio to create a new project, build and run the new project. 2. Open the activity_main.xml layout file, delete the TextView control in it, and add a Recyclerview control. 3. Use Android Studio to add the dependencies of the recyclerview control to the Gradle file. 4. Open the module build.gradle file to record the new dependencies. 5. Add a layout manager to the RecyclerView XML.
[0063] The display height and width of the data display control can be configured in the following ways:
[0064] 1. Create a time_item_view.xml layout file.
[0065] 2. Delete all specified codes in time_item_view.xml.
[0066] 3. Add Image View, where the width and height of the control can be set according to actual conditions.
[0067] 4. Create a Time Item View Holder class.
[0068] 5. Import android.widget.ImageView and
[0069] androidx.recyclerview.widget.RecyclerView.
[0070] Creating an adapter corresponding to a data display control can be implemented in the following ways:
[0071] 1. Create a new kotlin class called Time Adapter. Let the Time Adapter class extend Recyclerview.Adapter. 2. At the top level of Time Adapter, create a listof Time List variable to hold the data. 3. In Time Adapter, replace the on Bind View Holder() function. The Recycler View calls the on Bind ViewHolder() function to display the data of a list item at a specified position. Therefore, the on Bind View Holder() method takes two parameters: the View Holder, and the position to bind the data. For this application, the View Holder is the TimeItem View Holder, and the position is the position in the list.
[0072] The above method can realize the configuration of the operating environment and display parameters of the data display control Recycler View, so that the video timeline can be generated and displayed through the data display control Recycler View in the subsequent video processing process.
[0073] In the above implementation mode, the present invention displays the extracted multiple video frames in the form of a video timeline through the data display control Recycler View of the Android system, so that the video timeline has low drawing cost, smooth sliding, good scalability of the video timeline style, and low maintenance cost.
[0074] Figure 3 The present application provides a schematic structural block diagram of a video processing device. It should be understood that the device is applied to the electronic device described above. Figure 1 to Figure 2The method embodiment executed in the embodiment corresponds to the method embodiment executed in the embodiment, and the steps involved in the aforementioned method can be executed. The specific functions of the device can be referred to the description above. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in a memory in the form of software or firmware or fixed in the operating system (OS) of the device. Specifically, the device includes: an acquisition module 300, a determination module 310 and a calculation module 320, wherein the acquisition module 300 is used to acquire the user's sliding operation on the video timeline of the target video; wherein the video timeline is generated by displaying multiple video frames extracted from the target video based on the data display control; the determination module 310 is used to determine the timeline offset corresponding to the sliding operation according to the sliding operation; the acquisition module 300 is also used to acquire the unit width time ratio and the initial timeline position; wherein the unit width time ratio represents the time ratio of each width of the data display control to the target video, and the initial timeline position represents the timeline position before the sliding operation is generated; the calculation module 320 is used to calculate the target video time corresponding to the target position according to the timeline offset, the unit width time ratio and the initial timeline position; wherein the target video time is used to display the video frame of the corresponding time point based on the target video time after the sliding operation.
[0075] The video processing device designed as above, this scheme displays multiple video frames in the extracted video in the form of a video timeline through the data display control of the Android system, and determines the target video time corresponding to the target position after the sliding operation through the offset of the user's sliding operation on the data display control, so that after the sliding operation, the video frame of the corresponding time point is displayed based on the target video time, so that the video processing method designed in this scheme, when the user is playing back or editing the video, can quickly find the video clip part that needs to be played back or edited through the video timeline displayed by multiple video frames, thereby improving the efficiency of users in screening video clips, and accurately locates the target video corresponding to the target position after sliding through the offset of the user's sliding, so that the target video content and the progress of the video timeline are better linked, thereby achieving accurate correspondence between the video frame timeline and the video content.
[0076] According to some embodiments of the present application, the acquisition module 300 is also used to acquire the target video; the extraction module 330 is used to extract multiple video frames from the target video in sequence at preset intervals to form a video frame set; the generation display module 340 is used to display controls according to data, and based on the multiple video frames in the video frame set, generate a video timeline and display it.
[0077] According to some embodiments of the present application, the device further includes a configuration module 350 for configuring the operating environment and display parameters of the data display control.
[0078] According to some embodiments of the present application, the configuration module 350 is specifically used to add a data display control through a layout manager, and create an adapter corresponding to the data display control; and configure the display height and display width of the data display control.
[0079] According to some embodiments of the present application, the acquisition module 300 is specifically used to obtain the total display width of the data display control; obtain the total video length of the target video; calculate the ratio of the total display width of the data display control to the total video length of the target video to obtain the unit width-to-time ratio.
[0080] According to some embodiments of the present application, the calculation module 320 is specifically used to calculate the product of the time axis offset and the unit width time to obtain the offset time; calculate the sum of the offset time and the initial time axis position to obtain the target video time corresponding to the target position.
[0081] According to some embodiments of the present application, the determination module 310 is specifically used to monitor whether the indicator of the data display control slides; if the indicator of the data display control slides, the sliding distance of the indicator of the data display control is obtained to determine the timeline offset corresponding to the sliding operation.
[0082] According to some embodiments of the present application, Figure 4 As shown, the present application provides an electronic device 4, including: a processor 401 and a memory 402, the processor 401 and the memory 402 are interconnected and communicate with each other through a communication bus 403 and / or other forms of connection mechanisms (not marked), the memory 402 stores a computer program executable by the processor 401, and when the computing device is running, the processor 401 executes the computer program to execute any optional implementation method, such as steps S100 to S130: obtaining a user's sliding operation on the video timeline of the target video; determining a timeline offset corresponding to the sliding operation based on the sliding operation; obtaining a unit width time ratio and an initial timeline position; and calculating a target video time corresponding to the target position based on the timeline offset, the unit width time ratio and the initial timeline position.
[0083] The present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method in any of the aforementioned optional implementations is executed.
[0084] Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.
[0085] The present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the method in any optional implementation manner.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any way. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions that fall within the scope of the claims.
Claims
1. A video processing method, characterized in that: The method comprises: Acquire a user's sliding operation on a video timeline of a target video; wherein the video timeline is generated by displaying multiple video frames extracted from the target video based on a data display control; According to the sliding operation, determining a time axis offset corresponding to the sliding operation; Obtaining a unit width-to-time ratio and an initial time axis position; wherein the unit width-to-time ratio indicates the time ratio of each width of the data display control to the target video, and the initial time axis position indicates the time axis position before the sliding operation is generated; The target video time corresponding to the target position is calculated according to the time axis offset, the unit width-to-time ratio and the initial time axis position; wherein the target video time is used to display the video frame of the corresponding time point based on the target video time after the sliding operation.
2. The method according to claim 1, characterized in that: Before obtaining the sliding operation of the user on the video timeline of the target video, the method further includes: Get the target video; Extracting multiple video frames from the target video in sequence according to a preset interval time to form a video frame set; According to the data display control, and based on the multiple video frames in the video frame set, a video timeline is generated and displayed.
3. The method according to claim 2, characterized in that Before acquiring the target video, the method further includes: Configure the operating environment and display parameters of the data display control.
4. The method according to claim 3, characterized in that The configuration of the operating environment and display parameters of the data display control includes: Add data display controls through the layout manager and create adapters corresponding to the data display controls; Configure the display height and width of the data display control.
5. The method according to claim 1, characterized in that in, The obtaining of the unit width time ratio includes: Get the total display width of the data display control; Obtain the total video length of the target video; The ratio of the total display width of the data display control to the total video duration of the target video is calculated to obtain the unit width-to-time ratio.
6. The method according to claim 1, characterized in that The calculating the target video time corresponding to the target position according to the time axis offset, the unit width time ratio and the initial time axis position includes: Calculate the product of the time axis offset and the unit width time to obtain the offset time; The sum of the offset time and the initial time axis position is calculated to obtain the target video time corresponding to the target position.
7. The method according to claim 1, characterized in that The determining, according to the sliding operation, a time axis offset corresponding to the sliding operation includes: Monitor whether the indicator of the data display control slides; If it is monitored that the indicator of the data display control slides, the sliding distance of the indicator of the data display control is obtained to determine the time axis offset corresponding to the sliding operation.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
