Video frame previewing method and device
Technical Field
The present invention relates to terminal technologies, and in particular, to a method and an apparatus for previewing video frames.
Background
With the continuous development of terminal technology, more and more functions can be provided by terminals, such as: social, shopping, navigation, and video viewing, among others. The video watching on the terminal has the characteristics of strong real-time performance, high convenience, realization at any time and any place and the like, so that the quantity of users using the function is gradually huge. When a user watches a video, the most frequently used function is a progress bar, the progress bar can allow the user to perform processing such as fast forwarding or rewinding on the video, and how to quickly locate the content that the user wants to watch through the progress bar is an extremely important subject at present.
In the prior art, a user roughly judges whether a corresponding playing content corresponds to a position or not through duration information corresponding to different positions on a progress bar, however, the method cannot enable the user to quickly locate the content to be watched, and often needs to try many times to successfully locate the content, so that the user experience is not high.
Disclosure of Invention
The invention provides a video frame previewing method and device. The method and the device are used for solving the problem that the prior art can not enable a user to quickly locate the video content to be watched.
In a first aspect, the present invention provides a method for previewing video frames, including:
receiving a video frame preview request triggered by a user through a User Interface (UI), wherein the video frame preview request carries progress information corresponding to a video frame requested to be previewed by the user;
acquiring a video frame requested to be previewed by the user according to the progress information;
and displaying the video frame requested to be previewed by the user.
Optionally, the UI includes a progress bar containing a control point, and the progress information is position information of the control point on the progress bar;
correspondingly, the receiving a video frame preview request triggered by a user through a user interface UI includes:
receiving the video frame preview request triggered by the user by dragging the control point on the progress bar.
Optionally, the obtaining the video frame requested to be previewed by the user according to the progress information includes:
determining the playing time corresponding to the position information according to the position information of the control point on the progress bar;
and acquiring the video frame requested to be previewed by the user from the currently played video according to the playing time length.
Optionally, the determining, according to the position information of the control point on the progress bar, a playing time length corresponding to the position information includes:
determining the ratio of the length of the played progress bar and the total length of the progress bar corresponding to the position information according to the position information of the control point on the progress bar;
and determining the playing time length according to the proportion and the total time length of the currently played video.
Optionally, the UI includes a preview window, and the displaying the video frame requested to be previewed by the user includes:
and displaying the video frame requested to be previewed by the user in the preview window.
Optionally, the UI includes a play window, and after receiving a video frame preview request triggered by the user through the UI, the method further includes:
and displaying the video frame which is being played when the video frame preview request is received in the playing window.
Optionally, the method further includes:
receiving a playing instruction triggered when the user stops dragging the control point on the progress bar;
and playing the currently played video in the playing window from the video frame requested to be previewed by the user.
In a second aspect, the present invention provides a video frame preview device, including:
the receiving module is used for receiving a video frame preview request triggered by a user through a user interface UI, wherein the video frame preview request carries progress information corresponding to a video frame requested to be previewed by the user;
the acquisition module is used for acquiring the video frame requested to be previewed by the user according to the progress information;
and the first display module is used for displaying the video frame requested to be previewed by the user.
Optionally, the UI includes a progress bar containing a control point, and the progress information is position information of the control point on the progress bar;
the receiving module is specifically configured to receive the video frame preview request triggered by the user dragging the control point on the progress bar.
Optionally, the obtaining module includes: a determining unit and an acquiring unit;
the determining unit is used for determining the playing time length corresponding to the position information according to the position information of the control point on the progress bar;
and the acquisition unit is used for acquiring the video frame requested to be previewed by the user from the currently played video according to the playing duration.
Optionally, the determining unit is specifically configured to determine, according to the position information of the control point on the progress bar, a ratio of a length of the progress bar that has been played and a total length of the progress bar, which correspond to the position information;
and determining the playing time length according to the proportion and the total time length of the currently played video.
Optionally, the first display module is specifically configured to display the video frame requested to be previewed by the user in the preview window.
Optionally, the UI includes a play window, and the apparatus further includes: a second display module;
the second display module is configured to display, in the play window, the video frame that is being played when the video frame preview request is received.
Optionally, the apparatus further includes: a processing module;
the processing module is used for receiving a playing instruction triggered when the user stops dragging the control point on the progress bar;
and playing the currently played video in the playing window from the video frame requested to be previewed by the user.
In a third aspect, the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described video frame preview method.
In a fourth aspect, the present invention provides a terminal, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to implement the video frame preview method described above via execution of the executable instructions.
According to the method and the device for previewing the video frame, after the video frame previewing request triggered by the user is received, the video frame requested to be previewed by the user is obtained according to the progress information carried in the video frame previewing request, and then the video frame requested to be previewed by the user is displayed, so that the user can quickly locate the content to be watched, and the user experience is improved.
Drawings
Fig. 1 is a flowchart of a first embodiment of a video frame preview method provided in the present invention;
fig. 2 is a flowchart of a second embodiment of a video frame previewing method according to the present invention;
FIG. 3 is a schematic diagram of a progress bar and control points provided by the present invention;
FIG. 4 is a diagram of a user interface provided by the present invention;
FIG. 5 is a diagram of another user interface provided by the present invention;
FIG. 6 is a schematic structural diagram of a video frame preview device according to a first embodiment of the present invention;
fig. 7 is a schematic structural diagram of a second embodiment of a video frame previewing apparatus according to the present invention;
fig. 8 is a schematic diagram of a hardware structure of the terminal provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, when a user watches a video on a terminal, a content to be watched is generally positioned by a progress bar, and in the process of dragging the progress bar, the terminal displays duration information corresponding to different positions on the progress bar. The user can roughly judge whether the position corresponds to the corresponding video content or not through the duration information corresponding to different positions on the progress bar. However, this method does not allow the user to quickly locate the desired content, often requires multiple attempts to successfully locate the desired content, and is not very user friendly.
Based on the technical problem, the invention provides a video frame preview method and a video frame preview device. The method and the device have the advantages that the video frame preview request triggered by the user can be received in real time, the video frame requested to be previewed by the user is obtained according to the progress information carried in the video frame preview request, the video frame requested to be previewed by the user is displayed, the user can visually see the video frames corresponding to different positions on the progress bar, the user can accurately judge whether the content is the content to be watched or not according to the video frame, the efficiency of the user for positioning the content to be watched is improved, and the user experience is improved.
Optionally, the terminal mentioned above may be a device such as a smart phone, a tablet computer, and a game console, and the system applied to the terminal may be an android system.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a video frame preview method according to a first embodiment of the present invention. As shown in fig. 1, the method for previewing video frames according to this embodiment includes:
s101, receiving a video frame preview request triggered by a user through a user interface UI, wherein the video frame preview request carries progress information corresponding to a video frame requested to be previewed by the user.
The user can trigger the video frame preview request in the following two realizable modes:
the first realizable way: the user interface UI comprises a progress bar containing a control point, and the progress information is position information of the control point on the progress bar; the user may trigger a video frame preview request by dragging a control point on the progress bar.
Second realizable way: the user interface UI comprises a playing window, and the progress information is position information of different positions of the playing window from left to right; the user may trigger a video frame preview request by sliding left and right in the play window.
And S102, acquiring the video frame requested to be previewed by the user according to the progress information.
And S103, displaying the video frame requested to be previewed by the user.
The method for acquiring the video frame requested to be previewed by the user according to the progress information comprises the following steps:
firstly, acquiring a playing time length corresponding to a video frame requested to be previewed by a user according to progress information; and then, calling a video frame corresponding to the playing time length from the currently played video according to the playing time length, wherein the called video frame is the video frame which is requested to be previewed by the user.
According to the video frame previewing method provided by the embodiment, after a video frame previewing request triggered by a user is received, the video frame requested to be previewed by the user is obtained according to the progress information carried in the video frame previewing request, and then the video frame requested to be previewed by the user is displayed, so that the user can quickly locate the content to be watched, and the user experience is improved.
The following describes in detail how to implement the whole process of the video frame preview method when the user triggers the video frame preview request in the first implementable manner in S101 with reference to fig. 2.
Fig. 2 is a flowchart of a second embodiment of a video frame previewing method according to the present invention. As shown in fig. 2, the method for previewing video frames according to this embodiment includes:
s201, receiving the video frame preview request triggered by the user dragging the control point on the progress bar.
For a specific implementation process, reference may be made to the above embodiments, which are not described herein again.
S202, according to the position information of the control point on the progress bar, determining the playing time length corresponding to the position information.
The implementation manner of determining the playing time length corresponding to the position information is as follows:
firstly, according to the position information of the control point on the progress bar, determining the proportion of the length of the played progress bar and the total length of the progress bar corresponding to the position information.
And then, determining the playing time length according to the proportion and the total time length of the currently played video.
S203, according to the playing duration, obtaining the video frame requested to be previewed by the user from the currently played video.
The following illustrates the implementation of S202-S203:
fig. 3 is a schematic diagram of a progress bar and a control point provided by the present invention. As shown in fig. 3, the value corresponding to the end where the control point is located when the video starts playing is the minimum value 0, and the value corresponding to the end where the control point is located when the video ends playing is the maximum value h (it can also be understood that the total length of the progress bar is h). As the video is played, the control point moves from left to right. Assuming that when the control point moves to the position of the reference numeral 1 in fig. 3, the user drags the control point, assuming that the control point is dragged to the position of the reference numeral 2, the value corresponding to the position of the reference numeral 2 is x (it can also be understood that the length of the played progress bar corresponding to the reference numeral 2 is x), and then the ratio of the length of the played progress bar corresponding to the reference numeral 2 to the total length of the progress bar is x/h. Assuming that the total duration of the currently played video is m, the corresponding playing duration at the label 2 is mxx/h. And then searching a video frame with the corresponding playing time length of m x/h from the currently played video, wherein the video frame is the video frame requested to be previewed by the user.
And S204, the user interface UI comprises a preview window, and the video frame requested to be previewed by the user is displayed in the preview window.
Optionally, an achievable way of displaying the video frame requested to be previewed by the user is as follows: continuing with fig. 3, if the user drags the control point from reference numeral 1 to reference numeral 2 and stays at reference numeral 2 for longer than the preset duration, the video frame corresponding to reference numeral 2, which the user requests to preview, is displayed. If the stay is less than or equal to the preset time at the reference numeral 2, the display is not performed.
The UI includes a preview window, and fig. 4 is a user interface diagram provided by the present invention, and as shown in fig. 4, the preview window may be disposed right above the control point. And directly displaying the video frame requested to be previewed by the user in the preview window.
As shown in fig. 5, the UI may further include a play window, where the play window may occupy the entire screen, and after receiving a video frame preview request triggered by a user, the terminal displays, in the play window, a video frame that is being played when the request is received.
S205, receiving a playing instruction triggered when the user stops dragging the control point on the progress bar;
wherein the user stopping dragging the control point on the progress bar refers to: and the user leaves the touch source from the operation of the progress bar. Such as: if the user uses a finger to trigger, stopping dragging the control point on the progress bar refers to: and (5) operation of removing the finger from the progress bar.
S206, starting to play the currently played video from the video frame requested to be previewed by the user in the playing window.
The implementation of S204-S206 is illustrated by taking fig. 3 and fig. 5 as an example, and the control point moves from left to right as the video is played. Assuming that the control point moves to the position of reference numeral 1 in fig. 3, the user moves the control point from reference numeral 1 to reference numeral 2, that is, a video frame preview request is triggered to request to preview the corresponding video frame at reference numeral 2. The video frame corresponding to the label 1 is a video frame a, the video frame corresponding to the label 2 is a video frame b obtained through S201-S203, the video frame a displayed on the window is played all the time in the process that the user drags the control point from the label 1 to the label 2, and the video frame b is displayed on the preview window after the control point stays at the label 2 for more than the preset time. When the user leaves the progress bar from the position of the label 2, the video is controlled to be played in the playing window from the video frame b.
In the video frame preview method provided by this embodiment, the progress bar including the control point is set on the user interface UI, so that the user can trigger the video frame preview request by dragging the control point on the progress bar. Meanwhile, the ratio of the length of the played progress bar corresponding to the position information to the total length of the progress bar can be determined according to the position information of the control point on the progress bar; and determining the playing time length corresponding to the position information according to the proportion and the total time length of the currently played video, and acquiring the video frame requested to be previewed by the user from the currently played video according to the playing time length. And the video frame requested to be previewed by the user can be displayed in the preview window, so that the user can quickly position the content to be watched through the displayed video frame, and the user experience is improved.
Fig. 6 is a schematic structural diagram of a video frame preview device according to a first embodiment of the present invention. As shown in fig. 6, the video frame preview device provided in this embodiment includes:
the receiving module 601 is configured to receive a video frame preview request triggered by a user through a user interface UI, where the video frame preview request carries progress information corresponding to a video frame requested to be previewed by the user;
an obtaining module 602, configured to obtain, according to the progress information, a video frame requested to be previewed by the user;
a first display module 603, configured to display the video frame requested to be previewed by the user.
The video frame preview device provided in this embodiment may be used to execute the method in the embodiment shown in fig. 1, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of a second embodiment of a video frame previewing apparatus according to the present invention. In this embodiment, the user interface UI includes a progress bar including a control point, and the progress information is position information of the control point on the progress bar;
the receiving module 601 is specifically configured to receive the video frame preview request triggered by the user dragging the control point on the progress bar.
Optionally, the obtaining module 602 includes: a determining unit and an acquiring unit;
the determining unit 701 is configured to determine, according to the position information of the control point on the progress bar, a playing duration corresponding to the position information;
the obtaining unit 702 is configured to obtain, according to the playing duration, a video frame requested to be previewed by the user from a currently played video.
Optionally, the determining unit 701 is specifically configured to determine, according to the position information of the control point on the progress bar, a ratio of a length of the played progress bar to a total length of the progress bar, where the ratio corresponds to the position information;
and determining the playing time length according to the proportion and the total time length of the currently played video.
Optionally, the first display module 603 is specifically configured to display the video frame requested to be previewed by the user in the preview window.
Optionally, the UI includes a play window, and the video frame preview apparatus provided in this embodiment further includes: a second display module 703;
the second display module 703 is configured to display, in the playing window, the video frame that is being played when the video frame preview request is received.
Optionally, the video frame preview device provided in this embodiment further includes: a processing module 704;
the processing module 704 is configured to receive a play instruction triggered when the user stops dragging the control point on the progress bar;
and playing the currently played video in the playing window from the video frame requested to be previewed by the user.
The video frame preview device provided in this embodiment may be used to execute the method in the embodiment shown in fig. 2, and the implementation principle and technical effect are similar, which are not described herein again.
Fig. 8 is a schematic diagram of a hardware structure of the terminal provided by the present invention. As shown in fig. 8, the terminal of the present embodiment may include:
a memory 801 for storing program instructions.
The processor 802 is configured to implement the video frame preview method described in any of the above embodiments when the program instructions are executed, and specific implementation principles may refer to the above embodiments, which are not described herein again.
The present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the video frame preview method described in any of the above embodiments.
The present invention also provides a program product comprising a computer program stored in a readable storage medium, the computer program being readable from the readable storage medium by at least one processor, the computer program being executable by the at least one processor to cause a terminal to implement the video frame preview method described in any of the above embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the above embodiments of the terminal device, it should be understood that the Processor may be a Central Processing Unit (CPU), other general-purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor, or in a combination of the hardware and software modules in the processor.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.