Disclosure of Invention
The application provides a video playing method, a video playing device, an electronic device and a storage medium, which are used for solving the problems that in the prior art, the playing speed is improved, the mode of obtaining information in a video is shortened, the rhythm of the video is accelerated due to the change of the playing speed of the video, the difference between the rhythm and the source video is large, the ornamental value is influenced, and accurate information in the original video cannot be presented possibly.
In a first aspect, an embodiment of the present application provides a video playing method, including:
after a zoom instruction of a current video playing interface is monitored, determining the number of target playing windows corresponding to the zoom instruction and playing information of each target playing window;
and controlling each target playing window, and playing the video to be played on the current video playing interface according to the respective playing information, wherein the playing start frames of the video to be played in different target playing windows are different.
Optionally, the monitoring a zoom instruction for the current video playing interface includes:
monitoring the distance between two contact points of the current video playing interface, wherein the two contact points are generated after a user touches the current video playing interface;
when the distance is reduced, determining as a reduction instruction of the current video playing interface;
and when the distance is increased, determining as an amplification instruction of the current video playing interface.
Optionally, the determining the number of the target playing windows corresponding to the zoom instruction includes:
determining a target scaling multiple corresponding to the scaling instruction;
and determining the number of target playing windows corresponding to the target scaling times according to the mapping relation between the scaling times and the window number.
Optionally, the determining the number of the target playing windows corresponding to the zoom instruction includes:
when the zooming instruction is a zooming-out instruction, determining that the number of the target playing windows is larger than the number of the playing windows in the current video playing interface;
and when the zooming instruction is a magnifying instruction, determining that the number of the target playing windows is smaller than the number of the playing windows in the current video playing interface.
Optionally, determining the playing information of each target playing window includes:
acquiring the non-playing time length of the video to be played;
determining a playing start frame of a video to be played in each target playing window according to the non-playing time and the number of the target playing windows;
and determining the playing start frame as the playing information.
Optionally, the determining, according to the unplayed time and the number of the target playing windows, a playing start frame of a video to be played in each of the target playing windows includes:
dividing the non-playing time length according to the number of the target playing windows to obtain sub-playing time length;
and determining the playing start frame of each target playing window according to the sub-playing duration.
Optionally, determining the playing information of each target playing window includes:
according to the number of the target playing windows, the current video playing interface is segmented to obtain at least one segmentation interface;
the target playing windows correspond to the segmentation interfaces one by one;
determining the position of the segmentation interface as the playing position of the target playing window in the current video playing interface;
and determining the playing position as the playing information.
Optionally, the playing information includes a playing position of the target playing window in the current video playing interface and a playing start frame of a video to be played in the target playing window;
the controlling each target playing window, and playing the video to be played on the current video playing interface according to the respective playing information includes:
and controlling the target playing window, and playing the video to be played from the playing start frame at the playing position.
Optionally, when the number of the target playing windows is at least two, the method further includes controlling each of the target playing windows, and after the video to be played is played on the current video playing interface according to the respective playing information, the method further includes:
aiming at any one target playing window, acquiring a trigger instruction for playing the target playing window in a full screen mode;
and controlling the target playing window to play in a full screen mode according to the triggering instruction.
In a second aspect, the embodiments of the present application provide a method
The determining module is used for determining the number of target playing windows corresponding to a zooming instruction and playing information of each target playing window after the zooming instruction of a current video playing interface is monitored;
and the control module is used for controlling each target playing window and playing the video to be played on the current video playing interface according to the respective playing information, wherein the playing start frames of the video to be played in different target playing windows are different.
In a third aspect, an embodiment of the present application provides an electronic device, including: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; the memory for storing a computer program;
the processor is configured to execute the program stored in the memory, and implement the video playing method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the video playing method according to the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the method provided by the embodiment of the application, after a zooming instruction of a current video playing interface is monitored, the number of target playing windows corresponding to the zooming instruction and playing information of each target playing window are determined; and controlling each target playing window, and playing the video to be played on the current video playing interface according to the respective playing information, wherein the playing start frames of the video to be played in different target playing windows are different. Therefore, when a user needs to shorten the video playing time, the number of target playing windows corresponding to the zooming instruction and the playing information of each target playing window are determined by monitoring the zooming instruction, each target playing window is controlled, and the video to be played is played on the current video playing interface according to the respective playing information, so that the video to be played can be played in a plurality of target playing windows simultaneously, and the video to be played can be played in advance without increasing the playing rhythm of the video to be played on the premise of not increasing the playing speed due to different playing start frames of the video to be played in different target playing windows, so that the accurate information of the original video is presented.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. 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 application.
According to an embodiment of the present application, a video playing method is provided. Alternatively, in the embodiment of the present application, the video playing method may be applied to a hardware environment formed by the terminal 101 and the server 102 as shown in fig. 1. As shown in fig. 1, a server 102 is connected to a terminal 101 through a network, which may be used to provide services (such as video services, application services, etc.) for the terminal or a client installed on the terminal, and a database may be provided on the server or separately from the server for providing data storage services for the server 102, and the network includes but is not limited to: the terminal 101 is not limited to an electronic device having a touch screen and capable of playing video, such as a mobile phone, a tablet computer, and a notebook computer.
The video playing method according to the embodiment of the present application may be executed by the server 102, or executed by the terminal 101, or executed by both the server 102 and the terminal 101. The terminal 101 may execute the video playing method according to the embodiment of the present application, or may be executed by a client installed thereon.
Taking a terminal as an example to execute the video playing method of the embodiment of the present application, the method may be applied to the terminal, fig. 2 is a schematic flow chart of an optional video playing method according to the embodiment of the present application, and as shown in fig. 2, the flow of the method may include the following steps:
step 201, after a zoom instruction of a current video playing interface is monitored, determining the number of target playing windows corresponding to the zoom instruction and playing information of each target playing window.
In some embodiments, a video player is disposed on the terminal, after the video player starts playing, the terminal starts monitoring related operation instructions, such as a pause instruction, a fast forward instruction, a fast backward instruction, a double speed instruction, a zoom instruction, and the like, on the video playing interface, after monitoring the zoom instruction on the current video playing interface, the number of target playing windows corresponding to the zoom instruction and playing information of each target playing window are determined, so as to complete reduction or increase of playing windows in the current video playing interface, correspondingly, when the zoom instruction is a zoom instruction, the number of playing windows is increased, and when the zoom instruction is a zoom instruction, the number of playing windows is reduced.
The zoom instruction may be generated after a user performs a preset operation on a terminal screen, where the preset operation may be an operation in which two fingers slide towards the middle or outwards on the screen.
In an alternative embodiment, for example, the zoom instruction is generated by a user sliding on the screen through the middle of two fingers, the monitoring of the zoom instruction to the current video playing interface includes:
monitoring the distance between two contact points of the current video playing interface, wherein the two contact points are generated after a user touches the current video playing interface; when the distance is reduced, determining as a reduction instruction of the current video playing interface; when the distance is increased, determining as an amplification instruction for the current video playing interface.
In some embodiments, after a user touches a current video playing interface, a terminal monitors the touch operation of the user, and then generates two contact points at the positions of fingers, and determines whether the current touch operation is a zoom-out instruction or a zoom-in instruction by calculating the distance between the two contact points. Specifically, when the distance between two contacts is reduced, a zoom-out instruction for the current video playing interface is determined; when the distance is increased, determining as an amplification instruction for the current video playing interface.
Further, when the zooming instruction is a zooming-out instruction, determining that the number of the target playing windows is larger than the number of the playing windows in the current video playing interface;
and when the zooming instruction is a magnifying instruction, determining that the number of the target playing windows is smaller than the number of the playing windows in the current video playing interface.
Therefore, when a user wants to adjust the number of the playing windows, corresponding triggering operation can be performed on the screen of the terminal, so that the number of the playing windows can be changed after the terminal monitors the zooming instruction.
It can be understood that, in order to avoid too many playing windows, after the video to be played in the corresponding playing window is too small, the difficulty for the user to see the video to be played clearly is increased. In addition, due to the limited screen size, when the playing windows are the same as the screen size, that is, the number of the playing windows is 1, the zooming instruction is not executed any more.
In an alternative embodiment, determining the number of target playing windows corresponding to the zoom instruction comprises:
determining a target scaling multiple corresponding to the scaling instruction; and determining the number of target playing windows corresponding to the target scaling times according to the mapping relation between the scaling times and the window number.
In some embodiments, after monitoring the zoom instruction, the terminal determines a target zoom multiple corresponding to the zoom instruction, and since a mapping relationship between the zoom multiple and the number of windows is stored in the terminal, after determining the target zoom multiple, the number of target windows corresponding to the target zoom multiple may be determined directly according to the mapping relationship.
The zoom factor is the zoom degree of the video to be played, and the zoom factor is larger, so that the zoom degree of the video to be played is higher. For example, when the zoom factor is 2, the video to be played is reduced to half of the screen size; and when the zoom multiple is 1, the video to be played is played in a full screen mode.
When the target zoom factor is determined, the target zoom factor may be determined based on the zoom factor of the video to be played in the current video playing interface. For example, when the current zoom factor is 2 times, the zoom instruction is a zoom-out instruction, and the target zoom factor is a zoom factor (e.g., 3 times) larger than the current zoom factor; when the zooming instruction is a magnification instruction, the target zooming multiple is 1 time. Wherein, the determining of the target scaling factor corresponding to the scaling instruction, which is larger than the current scaling factor, may specifically include:
acquiring the number of playing windows in a current video playing interface; determining a current zoom multiple corresponding to the number of playing windows in the current video playing interface, and setting a target zoom multiple as a level adjacent to the level of the current zoom multiple according to a preset zoom multiple level.
The different zoom factor levels correspond to different zoom factors, and the zoom factor level is larger, so that the zoom factor is larger. The zoom level may be set according to actual conditions, and is not limited herein, for example, the zoom level is 1-level value 4-level, and the corresponding zoom multiples are 1 time, 2 times, 4 times, and 9 times; alternatively, the zoom level is 1-6 levels, and the corresponding zoom factors are 1, 2, 3, 4, 5, and 6. Accordingly, the larger the zoom factor, the larger the number of playing windows.
Illustratively, taking zoom levels from 1 level to 4 levels and corresponding zoom multiples of 1 time, 2 times, 4 times and 9 times as an example, when the number of playing windows in the current video playing interface is 4, if a zoom instruction is a zoom-out instruction, it is first determined that the number of current playing windows is 4, the corresponding current zoom multiple is 4 times, and the zoom multiple level is 3 levels, so that the target zoom multiple is the previous level of the current zoom multiple, that is, the target zoom level is 4 levels. Further, it may be determined that the target zoom multiple is 9 times when the zoom level is 4 levels, and the number of target playback windows is 9 when the zoom multiple is 9 times in the mapping relationship between the zoom multiple and the number of windows.
Based on the above related embodiment, after the number of the target playing windows is determined, the playing information in each target playing window is also determined, so as to play the video to be played in the target playing window. The playing information includes, but is not limited to, a playing start frame and a playing position.
In an alternative embodiment, the determining the playing information of each target playing window includes:
acquiring the non-playing time length of a video to be played; determining a playing start frame of a video to be played in each target playing window according to the unplayed time and the number of the target playing windows; and determining the playing start frame as playing information.
In some embodiments, when the play start frame of the video to be played in each target play window is determined, the determination may be performed according to the unplayed time length of the video to be played and the number of the target play windows. For example, after monitoring a zoom instruction, the terminal displays a respective playing progress bar of each target playing window on the screen for the user to select, and the terminal acquires a playing start frame of each target playing window by setting a progress bar of each target playing window by the user.
It can be understood that, in the above example, the user needs to set the playing start frame of each target playing window, and in actual application, the terminal may also directly configure the playing start frame according to the unplayed time length and the number of the target playing windows.
In an optional embodiment, determining a play start frame of a video to be played in each target play window according to the unplayed time length and the number of the target play windows includes:
dividing the non-playing time length according to the number of the target playing windows to obtain the sub-playing time length; and determining the playing start frame of each target playing window according to the sub-playing time length.
In some embodiments, the unplayed time is divided into subplayed time of the number of the target playing windows, and each subplayed time corresponds to one unplayed video in the to-be-played video, so that the respective playing start frames can be obtained at the corresponding position of the unplayed video in the to-be-played video according to the subplayed time.
Illustratively, the start frame of the video file is T _ start, the corresponding time axis position of the video file is set as a starting point, that is, T _ start is 0, the time axis position of the last frame is T _ end, and the current time is T _ end from the played frame to the time axis1Then the remaining playing time is T _ end-T1. When the terminal monitors a reduction instruction and the determined target zoom multiple is 4, the time axis position of the first target playing window playing initial frame is set as t1The second target playing window playing start frame is (T _ end-T)1)/4+t1The third target playing window playing start frame is (T _ end-T)1) /4*2+t1The fourth target playing window has a playing start frame of (T _ end-T)1)/4*3+t1And the 4 target playing windows start to take frames from different time axis positions in the video file of the video to be played and play the frames at the same time.
When the user continues to perform the zoom-out operation, after the terminal monitors the zoom-out instruction, when the determined target zoom multiple is 9, the number of the target playing windows is 9, the playing start frame of the first target playing window is set as the time axis position t2The second target playing window playing start frame is (T _ end-T)2)/9+t2The third target playing window playing start frame is (T _ end-T)2) /9*2+t2The fourth target playing window has a playing start frame of (T _ end-T)2)/9*3+t2In this way, the 9 th target playing window playing start frame is (T _ end-T)2)/9*8+t2The 9 target playing windows simultaneously play the video textAnd starting to take frames for playing at different time axis positions in the piece.
In an alternative embodiment, the determining the playing information of each target playing window includes:
according to the number of the target playing windows, dividing the current video playing interface to obtain at least one divided interface; the target playing window is in one-to-one correspondence with the segmentation interface; determining the position of the segmentation interface as the playing position of the target playing window in the current video playing interface; and determining the playing position as playing information.
In some embodiments, since the number of the playing windows changes after the zoom command is monitored, the positions of the playing windows also change. After the number of the target playing windows is determined, the terminal divides the current video playing interface according to the number of the target playing windows. After the division is completed, the target playing window and the division interface are in one-to-one correspondence, so that the playing position of the target playing window can be determined according to the position of the division interface in the current video playing interface.
It can be understood that the playing position of the target playing window may match the target playing window with the splitting interface according to the sequence of the playing start frame of the target playing window, that is, the playing start frame is corresponding to the splitting interface before.
For example, referring to fig. 3, when the number of the target playing windows is 4, the current video playing interface is divided into 4 parts, and when the number of the target playing windows is 9, the current video playing interface is divided into 9 parts. The human face in fig. 3 represents the content of the playing start frame of the video to be played, and the human faces are different and located at different positions, which represents that the playing start frames of the target playing windows are different; the solid line frame is the current video playing interface, and the dotted line represents the division condition of the current video playing interface.
Step 202, controlling each target playing window, and playing the video to be played on the current video playing interface according to the respective playing information, wherein the playing start frames of the video to be played in different target playing windows are different.
In some embodiments, after the number of target playing windows and the playing information are determined, the video to be played through the plurality of target playing windows may be played at different playing start frames. Therefore, when the user needs to shorten the video playing time, the video to be played can be played in advance on the premise of not increasing the playing speed.
In an optional embodiment, controlling each target playing window, and playing the video to be played on the current video playing interface according to the respective playing information specifically includes:
and controlling the target playing window, and playing the video to be played from the playing start frame at the playing position.
In some embodiments, after the number of the target playing windows, the playing start frame and the playing position of the target playing window are determined, the video to be played is played at the playing position of the target playing window from the playing start frame, so that the video to be played can be played in advance without increasing the playing rhythm of the video to be played on the premise of not increasing the playing speed, and accurate information of the original video is presented.
In an optional embodiment, when the number of the target playing windows is at least two, the video playing method further includes:
aiming at any target playing window, acquiring a trigger instruction for playing the target playing window in a full screen mode; and controlling the target playing window to play in a full screen mode according to the triggering instruction.
In some embodiments, in order to facilitate the user to view the video, in the process of viewing the video by the user, if a certain target playing window needs to be enlarged, one of the target playing windows may be selected for triggering, and after the terminal obtains the triggering instruction, the selected target playing window is played in a full screen mode, so that the video to be played in the target playing window is enlarged.
The selection mode of the target playing window can be set according to actual conditions, for example, the selection mode can be set by any one of clicking, double clicking, long pressing, short pressing, heavy pressing and light pressing.
It can be understood that the video playing method of the present application can be applied to various video playing scenes. Such as video auditing and video viewing. Illustratively, when clues are searched in the surveillance video, in order to improve the searching efficiency, the surveillance video does not need to be copied in multiple copies, the playing windows are reduced to be multiple, and the videos in different playing windows are searched by multiple users, so that the searching efficiency is accelerated. The condition that key information is missed when the video is started at double speed is avoided.
Based on the same concept, embodiments of the present application provide a video playing apparatus, and specific implementation of the apparatus can refer to the description of the method embodiment, and repeated details are not repeated, as shown in fig. 4, the apparatus mainly includes:
the determining module 401 is configured to determine, after a zoom instruction for a current video playing interface is monitored, the number of target playing windows corresponding to the zoom instruction and playing information of each target playing window;
and a control module 402, configured to control each target playing window, and play the video to be played on the current video playing interface according to the respective playing information, where the playing start frames of the video to be played in different target playing windows are different.
Based on the same concept, an embodiment of the present application further provides an electronic device, as shown in fig. 5, the electronic device mainly includes: a processor 501, a memory 502 and a communication bus 503, wherein the processor 501 and the memory 502 communicate with each other through the communication bus 503. The memory 502 stores a program executable by the processor 501, and the processor 501 executes the program stored in the memory 502, so as to implement the following steps:
after a zoom instruction of a current video playing interface is monitored, determining the number of target playing windows corresponding to the zoom instruction and playing information of each target playing window;
and controlling each target playing window, and playing the video to be played on the current video playing interface according to the respective playing information, wherein the playing start frames of the video to be played in different target playing windows are different.
The communication bus 503 mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 503 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The Memory 502 may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the aforementioned processor 501.
The Processor 501 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc., and may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.
In still another embodiment of the present application, there is also provided a computer-readable storage medium having stored therein a computer program which, when run on a computer, causes the computer to execute the video playback method described in the above embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The available media may be magnetic media (e.g., floppy disks, hard disks, tapes, etc.), optical media (e.g., DVDs), or semiconductor media (e.g., solid state drives), among others.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or instruction from another entity or instruction without necessarily requiring or implying any actual such relationship or order between such entities or instructions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.